[Client Generation] Fix required handling for formdata properties #4994
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is my first pull request for this project.
The goal here is simple: to update nswag such that it respects the required attribute on form-data parameters (currently it does not).
Please let me know if the proposed changes are in an inappropriate location in this project. After stepping through the code multiple times, this seems like the right place for the changes that I included, but if not, I'll update the PR according to the feedback.
The fix I'm ultimately hoping comes out of these changes, is for the nswag CLI to be able to generate a C# client for a REST API containing one or more endpoint that accept form-data input with required parameters. Currently they generate as optional parameters, so I'd like to get that corrected. If additional changes beyond these are required to make that happen, please let me know that as well.
Thank you!