From 012d744f4cef76e02fcada86dc561d299d87febf Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 24 Feb 2019 17:28:15 +0900 Subject: [PATCH] Fix doc --- src/prelude/schema.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/prelude/schema.ts b/src/prelude/schema.ts index 7c3d6aac8..e5c24dd46 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)) {