Merge remote-tracking branch 'misskey-original/develop' into develop

This commit is contained in:
mattyatea 2023-10-22 12:48:46 +09:00
commit 212986a3a8
6 changed files with 35 additions and 9 deletions

View file

@ -26,7 +26,12 @@ export function convertSchemaToOpenApiSchema(schema: Schema) {
if (schema.allOf) res.allOf = schema.allOf.map(convertSchemaToOpenApiSchema);
if (schema.ref) {
res.$ref = `#/components/schemas/${schema.ref}`;
const $ref = `#/components/schemas/${schema.ref}`;
if (schema.nullable || schema.optional) {
res.allOf = [{ $ref }];
} else {
res.$ref = $ref;
}
}
return res;