Skip to content

Commit

Permalink
replace trpc openapi libs and rename metas
Browse files Browse the repository at this point in the history
  • Loading branch information
rotorsoft committed Aug 8, 2024
1 parent 2d89df0 commit 2efd5ce
Show file tree
Hide file tree
Showing 5 changed files with 3,057 additions and 3,160 deletions.
2 changes: 1 addition & 1 deletion libs/adapters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"redis": "4.2.0",
"rollbar": "^2.6.1",
"sequelize": "^6.32.1",
"trpc-openapi": "1.1.2",
"trpc-swagger": "^1.2.6",
"typescript-logging": "^0.6.4",
"zod": "^3.22.4"
},
Expand Down
9 changes: 4 additions & 5 deletions libs/adapters/src/trpc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
type GenerateOpenApiDocumentOptions,
type OpenApiMeta,
type OpenApiRouter,
} from 'trpc-openapi';
} from 'trpc-swagger';
import { ZodSchema, ZodUndefined, z } from 'zod';
import { config } from '../config';

Expand Down Expand Up @@ -136,7 +136,7 @@ export const command = <
.meta({
openapi: {
method: 'POST',
path: `/${tag.toLowerCase()}/{id}/${factory.name}`,
path: `/${factory.name}/{id}`,
tags: [tag],
headers: [
{
Expand Down Expand Up @@ -188,7 +188,7 @@ export const event = <
.meta({
openapi: {
method: 'POST',
path: `/${tag.toLowerCase()}/${factory.name}`,
path: `/${factory.name}`,
tags: [tag],
},
})
Expand All @@ -212,12 +212,11 @@ export const query = <Input extends ZodSchema, Output extends ZodSchema>(
factory: () => QueryMetadata<Input, Output>,
) => {
const md = factory();
//const input = md.input.extend({ address_id: z.string().optional() });
return trpc.procedure
.meta({
openapi: {
method: 'GET',
path: `/${Tag.Query.toLowerCase()}/${factory.name}`,
path: `/${factory.name}`,
tags: [Tag.Query],
headers: [
{
Expand Down
Loading

0 comments on commit 2efd5ce

Please sign in to comment.