From 3cf8d530ced36c49f59435c91ade17e25f8d6a00 Mon Sep 17 00:00:00 2001 From: Nourman Hajar Date: Fri, 6 Oct 2023 15:28:36 +0000 Subject: [PATCH 1/4] fix: typo in default documentation description --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index f4a2e4b..b7cf5bb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -148,7 +148,7 @@ export const swagger = ...documentation, info: { title: 'Elysia Documentation', - description: 'Developement documentation', + description: 'Development documentation', version: '0.0.0', ...documentation.info } From 05f314670f0825f77b418d39d4dd3540232a29e5 Mon Sep 17 00:00:00 2001 From: Kyle Date: Wed, 18 Oct 2023 15:56:08 -0400 Subject: [PATCH 2/4] chore: Update Swagger --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index f4a2e4b..7916d24 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,7 +15,7 @@ export const swagger = ( { documentation = {}, - version = '5.7.2', + version = '5.9.0', excludeStaticFile = true, path = '/swagger' as Path, exclude = [], @@ -24,7 +24,7 @@ export const swagger = autoDarkMode = true }: ElysiaSwaggerConfig = { documentation: {}, - version: '5.7.2', + version: '5.9.0', excludeStaticFile: true, path: '/swagger' as Path, exclude: [], From 17a140cd0007978f893164f62c87a32698674460 Mon Sep 17 00:00:00 2001 From: "Herdi Tr." <35950229+Hrdtr@users.noreply.github.com> Date: Tue, 24 Oct 2023 10:25:10 +0000 Subject: [PATCH 3/4] fix: parameters mapping, fix #41 --- src/utils.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 955557c..66c620d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -24,12 +24,15 @@ export const mapProperties = ( return Object.entries(schema?.properties ?? []).map(([key, value]) => ({ // @ts-ignore - ...value, + schema: { + // @ts-ignore + ...value, + // @ts-ignore + type: value?.type, + }, in: name, name: key, // @ts-ignore - type: value?.type, - // @ts-ignore required: schema!.required?.includes(key) ?? false })) } From b894874265e8f462d9a806c1c432f8412e5a7dd1 Mon Sep 17 00:00:00 2001 From: "Herdi Tr." <35950229+Hrdtr@users.noreply.github.com> Date: Tue, 24 Oct 2023 11:43:50 +0000 Subject: [PATCH 4/4] fix: remove additionalProperties from top-level response definition & path parameter mapping --- src/utils.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 66c620d..80fe637 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -121,7 +121,7 @@ export const registerSchemaPath = ({ if (typeof responseSchema === 'object') { if (Kind in responseSchema) { - const { type, properties, required, ...rest } = + const { type, properties, required, additionalProperties: _, ...rest } = responseSchema as typeof responseSchema & { type: string properties: Object @@ -151,7 +151,7 @@ export const registerSchemaPath = ({ if(!models[value]) return // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { type, properties, required, ...rest } = models[ + const { type, properties, required, additionalProperties: _, ...rest } = models[ value ] as TSchema & { type: string @@ -165,7 +165,7 @@ export const registerSchemaPath = ({ content: mapTypesResponse(contentTypes, value) } } else { - const { type, properties, required, ...rest } = + const { type, properties, required, additionalProperties: _, ...rest } = value as typeof value & { type: string properties: Object @@ -189,7 +189,7 @@ export const registerSchemaPath = ({ if(!(responseSchema in models)) return // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { type, properties, required, ...rest } = models[ + const { type, properties, required, additionalProperties: _, ...rest } = models[ responseSchema ] as TSchema & { type: string @@ -287,9 +287,9 @@ export const filterPaths = ( ) ) .map((x) => ({ + schema: { type: 'string' }, in: 'path', name: x.slice(1, x.length - 1), - type: 'string', required: true })), ...schema.parameters