-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Required parameters not handled as required #443
Comments
Can you put in a test or two to demonstrate this in a PR to develop_2.0 branch? |
Hi, To be honnest, this little modification has already been merged a few weeks ago, in another PR, about CodegenParameter missing some data (can't remember exactly which one). |
I'm just going over the issues and cleaning out to get a better picture of what's needed for the final release. I don't keep track over all changes in the project, but if you say this issue can be closed, that's great. |
facing this issue right now (using Java server-side code generation)
generated code:
i can add |
@cchafer @sunrisejjj I wonder if you can test with the latest |
@wing328 issue still exists. Maybe issue related to model.mustache file?
should be changed to something like this
? |
So to be clear, this issue is really about the generated code not enforcing the required parameter, not declaring it incorrectly in the swagger.json. It's of course possible to do, but I suggest that's taken into your own templates, as the server generation isn't necessarily doing all validations for you. Please reopen if you disagree or need more advice on this. |
Hi,
At this time, DefaultCodegen doesn't handle rightly required parameters. All of them as marked as NOT required when trying to figure out their type.
This can lead to several problems when, like me, you want to define type type of not required items as Option[...] in Scala.
Here's a simple fix for this :
The text was updated successfully, but these errors were encountered: