diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-02-24 17:28:15 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-02-24 17:28:15 +0900 |
| commit | 012d744f4cef76e02fcada86dc561d299d87febf (patch) | |
| tree | 9e4afa5b7f9e2755d75c1c5556baeb05286089f0 | |
| parent | 10.89.1 (diff) | |
| download | sharkey-012d744f4cef76e02fcada86dc561d299d87febf.tar.gz sharkey-012d744f4cef76e02fcada86dc561d299d87febf.tar.bz2 sharkey-012d744f4cef76e02fcada86dc561d299d87febf.zip | |
Fix doc
| -rw-r--r-- | src/prelude/schema.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/prelude/schema.ts b/src/prelude/schema.ts index 7c3d6aac8f..e5c24dd468 100644 --- a/src/prelude/schema.ts +++ b/src/prelude/schema.ts @@ -28,6 +28,9 @@ export function convertOpenApiSchema(schema: Schema) { if (!['string', 'number', 'boolean', 'array', 'object'].includes(x.type)) { x['$ref'] = `#/components/schemas/${x.type}`; } + if (x.type === 'array' && x.items) { + x.items = convertOpenApiSchema(x.items); + } if (x.type === 'object' && x.properties) { x.required = Object.entries(x.properties).filter(([k, v]: any) => !v.isOptional).map(([k, v]: any) => k); for (const k of Object.keys(x.properties)) { |