We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Maybe
required
This works as expected, since_1 is required:
_1
data Foo = Bar { _1 :: LText }
{ "swagger": "2.0", "info": { "version": "", "title": "" }, "definitions": { "Foo": { "required": [ "_1" ], "type": "object", "properties": { "_1": { "type": "string" } } } }, "paths": {} }
So does this, since _1 is not required:
data Foo = Bar { _1 :: Maybe LText }
{ "swagger": "2.0", "info": { "version": "", "title": "" }, "definitions": { "Foo": { "type": "object", "properties": { "_1": { "type": "string" } } } }, "paths": {} }
But this does not, since _2 should not be required:
_2
data Foo = Bar { _1 :: LText } | Baz { _2 :: Maybe LText } deriving (Generic, ToJSON, ToSchema)
{ "swagger": "2.0", "info": { "version": "", "title": "" }, "definitions": { "Foo": { "minProperties": 1, "maxProperties": 1, "type": "object", "properties": { "Bar": { "required": [ "_1" ], "type": "object", "properties": { "_1": { "type": "string" } } }, "Baz": { "required": [ "_2" ], "type": "object", "properties": { "_2": { "type": "string" } } } } } }, "paths": {} }
The text was updated successfully, but these errors were encountered:
looks like a legitimate bug to me. do you have time to work on fixing this?
Sorry, something went wrong.
No branches or pull requests
This works as expected, since
_1
isrequired
:So does this, since
_1
is notrequired
:But this does not, since
_2
should not berequired
:The text was updated successfully, but these errors were encountered: