Skip to content
Snippets Groups Projects
Unverified Commit 4b295088 authored by Acid Chicken (硫酸鶏)'s avatar Acid Chicken (硫酸鶏) Committed by GitHub
Browse files

Update schemas.ts (#12103)

parent 69795e74
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment