We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8c3b27a + bce2aa6 commit f3c0393Copy full SHA for f3c0393
src/openapi.ts
@@ -26,7 +26,11 @@ import { defineConfig } from 'tsup'
26
export const capitalize = (word: string) =>
27
word.charAt(0).toUpperCase() + word.slice(1)
28
29
-const toRef = (name: string) => t.Ref(`#/components/schemas/${name}`)
+const toRef = (name: string) => t.Ref(
30
+ name.startsWith('#/')
31
+ ? name
32
+ : `#/components/schemas/${name}`
33
+)
34
35
const toOperationId = (method: string, paths: string) => {
36
let operationId = method.toLowerCase()
@@ -237,7 +241,7 @@ const normalizeSchemaReference = (
237
241
238
242
// Convert string reference to t.Ref node
239
243
// This allows string aliases to participate in schema composition
240
- return t.Ref(schema)
244
+ return toRef(schema)
245
}
246
247
/**
0 commit comments