Skip to content

Commit a105eb6

Browse files
committed
fix: use allOf for schemas that are refs
1 parent 9aaaad1 commit a105eb6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/openapi-generator/src/openapi.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,13 @@ export function convertRoutesToOpenAPI(
173173
const openapiSchema = schemaToOpenAPI(schema);
174174
if (openapiSchema === undefined) {
175175
return acc;
176+
} else if ('$ref' in openapiSchema) {
177+
return {
178+
...acc,
179+
[name]: {
180+
allOf: [{ title: name }, openapiSchema],
181+
},
182+
};
176183
} else {
177184
return {
178185
...acc,

0 commit comments

Comments
 (0)