Skip to content
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

[JavaSpring] Fixed Issue 9250 - Codegen for file datatype #9490

Merged
merged 2 commits into from
Nov 21, 2019

Conversation

MGoyal92
Copy link
Contributor

Updated mustache file to populate correct code inside @ApiParam annotation and inside @RequestParam annotation, and added "required" attribute (true|false) inside @RequestParam Annotation.

This should fix #9250

…atatype file in @ApiParam, @RequestParam, and set the required flags
Copy link

@CarloMendola CarloMendola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i successfully tested this change and can be merged either to bump-snapshot and master branch.
This change allows codegen to work with multipart file upload with different names other than "file" and support required:false (see example below)

  • in: formData
    name: myFileName
    type: file
    required: false
    description: My File object
    This will translate in:
    @ApiParam(value = "My File object") @Valid @RequestPart(value="myFileName", required=false) MultipartFile myFileName
    Please consider merging this change asap.
    Thanks,
    Carlo

@scara
Copy link

scara commented Nov 20, 2019

Hi @HugoMario and @frantuma,
is there any chance to speed up the review of this PR?

Small but actually valuable, to address the proper mapping of a multipart POST.

TIA,
Matteo

@frantuma frantuma merged commit b028473 into swagger-api:master Nov 21, 2019
@frantuma
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[spring] @RequestPart should use "{{basename}}" instead of "file" and observe "required" attribute
4 participants