-
-
Notifications
You must be signed in to change notification settings - Fork 215
Open
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Fastify version
5.2.1
Plugin version
9.4.0
Node.js version
22.9.0
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Unknown
Description
This was previously reported in #190 but was marked as stale and closed. I'd like to reopen it.
Basically, the issue is if you make a field that has multiple types, e.g.:
"collectionName": {
"type": ["null", "string"]
}You get "Unknown Type: null,string"
I think this has something to do with the underlying swagger implementation using OpenAPI 3.0+ which introduced nullable: true for defining nullable types.
In my case, I'm actually using zod-to-json-schema which outputs the schema (by default) in jsonSchema7 format.
Link to code that reproduces the bug
Expected Behavior
json schema types with multiple values, including nulls, should generate the correct swagger docs.
branets-dasha
Metadata
Metadata
Assignees
Labels
No labels
