Closed github-actions[bot] closed 1 year ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
openapi-zod-client | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Sep 22, 2023 8:05pm |
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
openapi-zod-client@1.11.1
Patch Changes
536a541
Thanks @astahmer! - Thanks @mayorandrew !OpenAPI 3.0.3 Data Types are defined by JSON Schema Specification Wright Draft 00.
However, the specification mentions that "null is not supported as a type" and the
nullable
keyword should be used instead. While it is a valid solution in most cases, it is not possible to usenullable
together with$ref
. One possible workaround is to define a Null schema and use it in combination withoneOf
, like so:It may look contradictory, but according to the enum section of JSON Schema Validation Wright Draft 00:
This means that
null
is a possible value for the "enum" validation of "type" "string".This schema also passes the
swagger-cli validate
check.The openapi-zod-client library currently crashes when generating a TypeScript type for this construct. Additionally, the generated zod schemas are not correct when using a
null
value in "enum" along with other values. This PR fixes that.https://github.com/astahmer/openapi-zod-client/pull/227