mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-13 21:40:45 +01:00
Update schemas.ts (#12103)
This commit is contained in:
parent
69795e74bf
commit
4b295088fd
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue