Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcampa committed Sep 2, 2024
1 parent 9f675b9 commit 3975034
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trpc-to-openapi",
"version": "2.0.0-rc.0",
"version": "2.0.0-rc.1",
"description": "tRPC OpenAPI",
"author": "mcampa",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/node-http/input.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TRPCError } from '@trpc/server';
import { NodeHTTPRequest } from '@trpc/server/dist/adapters/node-http';
import { NodeHTTPRequest } from '@trpc/server/adapters/node-http';
import parse from 'co-body';

export const getQuery = (req: NodeHTTPRequest, url: URL): Record<string, string> => {
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TRPC_ERROR_CODE_KEY } from '@trpc/server/dist/rpc';
import { TRPC_ERROR_CODE_KEY } from '@trpc/server/rpc';
import type {
CreateRootTypes,
Procedure,
Expand All @@ -7,7 +7,7 @@ import type {
} from '@trpc/server/unstable-core-do-not-import';
import type { AnyZodObject, ZodIssue } from 'zod';

export { type OpenAPIObject, type SecuritySchemeObject } from 'openapi3-ts/dist/oas31';
export { type OpenAPIObject, type SecuritySchemeObject } from 'openapi3-ts/oas31';

export type OpenApiMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';

Expand Down
2 changes: 1 addition & 1 deletion src/utils/procedure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const forEachOpenApiProcedure = (
for (const [path, procedure] of Object.entries(procedureRecord)) {
// @ts-expect-error FIXME
const meta = procedure._def.meta as unknown as OpenApiMeta;
const { openapi } = meta;
const { openapi } = meta ?? {};
if (openapi && openapi.enabled !== false) {
const type = getProcedureType(procedure as OpenApiProcedure);
callback({ path, type, procedure: procedure as OpenApiProcedure, openapi });
Expand Down

0 comments on commit 3975034

Please sign in to comment.