0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

feat(core): any-type parameter shows empty object in swagger example (#1110)

This commit is contained in:
IceHe.xyz 2022-06-13 18:32:52 +08:00 committed by GitHub
parent 1d2272186e
commit 7339a85a1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -58,7 +58,7 @@ describe('zodTypeToSwagger', () => {
}); });
it('unknown type', () => { it('unknown type', () => {
expect(zodTypeToSwagger(unknown())).toEqual({}); expect(zodTypeToSwagger(unknown())).toEqual({ example: {} });
}); });
it('native enum type', () => { it('native enum type', () => {

View file

@ -42,7 +42,7 @@ export const zodTypeToSwagger = (config: unknown): OpenAPIV3.SchemaObject => {
} }
if (config instanceof ZodUnknown) { if (config instanceof ZodUnknown) {
return {}; // Any data type return { example: {} }; // Any data type
} }
if (config instanceof ZodObject) { if (config instanceof ZodObject) {