-
Notifications
You must be signed in to change notification settings - Fork 91
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
boolean default value #2165
Comments
I see your point, but it would be a pretty significant change to make the scanner automatically behave this way. It could certainly be a configuration option, but I wonder if it would be the type of thing that applies to any primitive, and also properties of objects that are primitive. I don't quite remember - without a |
Yes. If I for example request my resource like The javadoc of DefaultValue also states:
|
I think a nice solution for this would be to use those JAX-RS defaults (those that |
I think this is mostly right. It's worth noting that I also note that |
This is a good point. A solution for this issue could attempt to determine whether the default derived in the absence of
Also true, but do we need to support path parameters (or any other required parameters) with this change? It seems fair to ignore required ones here and for those cases users may still use their own |
This could be done, though it's not simple and we don't currently have any schema validation implementation to use as a base. FWIW, the situation I was thinking of here was where you're injecting an optional integer parameter and I've also realised I misread the request. We already set |
One further concern is that I'm not sure we have a way to unset the default value, if the user didn't want it included in the OpenAPI. |
I have a query param in my resource of type boolean, primitive. If the client does not specify it, it is set to false (since default of primitive boolean).
Can this please also be reflected in openapi?
Instead of:
I want:
Is this something you would add as default in this project, or should I annotate all my booleans with @DefaultValue("false")?
The text was updated successfully, but these errors were encountered: