-
-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support JSONSchema $defs #1317
Support JSONSchema $defs #1317
Conversation
🦋 Changeset detectedLatest commit: 4a4b837 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
e3617c0
to
23f816d
Compare
Deploying with Cloudflare Pages
|
ef6afaf
to
8ce204c
Compare
subschemaOutput += "{\n"; | ||
indentLv++; | ||
|
||
outer: for (const [name, schemaObject] of getEntries(subschema.schema!)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean up a lot of duplicated transforming of a map of schema objects with transformSchemaObjectMap()
.
@@ -15704,7 +16002,7 @@ export interface external { | |||
vpcs?: external["resources/vpcs/models/vpc.yml"]["vpc"][]; | |||
} & external["shared/pages.yml"]["pagination"] & external["shared/meta.yml"]; | |||
}; | |||
} | |||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More semi fixes
@@ -14970,8 +15105,92 @@ export interface external { | |||
default: external["shared/responses/unexpected_error.yml"]; | |||
}; | |||
} | |||
"resources/uptime/models/alert.yml": unknown; | |||
"resources/uptime/models/check.yml": unknown; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also many unknown
s were fixed by treating more remote $ref
s as Schema Object maps
8ce204c
to
663bd5e
Compare
fc82e59
to
4a4b837
Compare
Changes
Fixes #1261 and adds support for JSONSchema
$defs
that can be defined on any object type or the root schema itselfAlthough in JSONSchema,
$defs
can be defined anywhere, unfortunately TypeScript doesn’t allow you to define keys on anything other than anobject
. For example, if you tried putting$defs
on astring
, how would you access them? Keep in mind that only object types (and the root schema itself) will keep their$defs
.How to Review
Checklist
docs/
updated (if necessary)pnpm run update:examples
run (only applicable for openapi-typescript)