Skip to content

Commit 77a76f7

Browse files
committed
feat: prioritize vendor schema mapping over standard fallback
1 parent 71afc31 commit 77a76f7

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/openapi.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -531,19 +531,19 @@ export const unwrapSchema = (
531531
const vendor = schema['~standard'].vendor
532532

533533
try {
534-
// @ts-ignore
535-
if (schema['~standard']?.jsonSchema?.[io])
536-
// @ts-ignore
537-
return schema['~standard']?.jsonSchema?.[io]?.({
538-
target: "draft-2020-12"
539-
})
540-
541534
if (
542535
mapJsonSchema?.[vendor] &&
543536
typeof mapJsonSchema[vendor] === 'function'
544537
)
545538
return enumToOpenApi(mapJsonSchema[vendor](schema))
546539

540+
// @ts-ignore
541+
if (schema['~standard']?.jsonSchema?.[io])
542+
// @ts-ignore
543+
return schema['~standard']?.jsonSchema?.[io]?.({
544+
target: 'draft-2020-12'
545+
})
546+
547547
switch (vendor) {
548548
case 'zod':
549549
if (warned.zod4 || warned.zod3) break

0 commit comments

Comments
 (0)