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:
parent
1d2272186e
commit
7339a85a1b
2 changed files with 2 additions and 2 deletions
|
@ -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', () => {
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue