Open ettom opened 1 year ago
By default, serde
serializes Option::None
as null
. It does not skip the field altogether.
This means that objects serialized by serde
actually do not adhere to the schema generated by poem-openapi
in case there are Option::None
values.
By default, serde serializes Option::None as null. It does not skip the field altogether.
Isn't this what is happening in the example and PR? A nullable field, albeit manually specified in the PR, would make None
become null
Description of the feature
It would be nice if a type being wrapped in
Option<>
would be shown as nullable in the OpenAPI document. See https://stackoverflow.com/questions/48111459/how-to-define-a-property-that-can-be-string-or-null-in-openapi-swaggerCode example
would generate
Additionally,
would generate
Thanks for the amazing work!