mirror of
https://github.com/logto-io/logto.git
synced 2024-12-30 20:33:54 -05:00
fix(core): swagger json
This commit is contained in:
parent
6473df99d2
commit
c1546f0ad8
1 changed files with 8 additions and 0 deletions
|
@ -5,6 +5,7 @@ import { conditional } from '@silverhand/essentials';
|
||||||
import type { OpenAPIV3 } from 'openapi-types';
|
import type { OpenAPIV3 } from 'openapi-types';
|
||||||
import type { ZodStringDef } from 'zod';
|
import type { ZodStringDef } from 'zod';
|
||||||
import {
|
import {
|
||||||
|
ZodRecord,
|
||||||
ZodArray,
|
ZodArray,
|
||||||
ZodBoolean,
|
ZodBoolean,
|
||||||
ZodEffects,
|
ZodEffects,
|
||||||
|
@ -201,6 +202,13 @@ export const zodTypeToSwagger = (
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config instanceof ZodRecord) {
|
||||||
|
return {
|
||||||
|
type: 'object',
|
||||||
|
additionalProperties: zodTypeToSwagger(config.valueSchema),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (config instanceof ZodArray) {
|
if (config instanceof ZodArray) {
|
||||||
return {
|
return {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
|
|
Loading…
Reference in a new issue