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

Create a FormParameter model object instead of BodyParameter #2722

Open
wants to merge 4 commits into
base: master
from

Conversation

@shartte
Copy link

shartte commented Oct 6, 2018

This fixes #2717 by creating the right Swagger model class for parameters of type "formData".
Since those parameters only support a single example, I've also opted to simply copy over the first one.

Sebastian Hartte added 2 commits Oct 6, 2018
…ds that are part of a multipart form (in=formData).
@shartte

This comment has been minimized.

Copy link
Author

shartte commented Oct 6, 2018

I've adapted the class so that it only maps to FormParameter now if the type is one of the types supported by the spec. In other cases it falls back to BodyParameter, which is seemingly wrong, but matches previous behavior better.
I've also added a few unit tests for these cases.
Since the "spec" tests don't run on my own machine, I hope my adapted tests data will work on the CI.

@Carmageddon

This comment has been minimized.

Copy link

Carmageddon commented Oct 19, 2018

Whats up with this PR? Can you please get it fixed so we would not have to build based on your repo on Monday :)

@dilipkrish

This comment has been minimized.

Copy link
Member

dilipkrish commented Oct 23, 2018

@shartte thanks for the PR. It appears that the contract tests are failing. Would you mind taking a look?

@shartte

This comment has been minimized.

Copy link
Author

shartte commented Oct 23, 2018

@dilipkrish Will do, I had some issues with getting them to run initially, but now they work for me. So I'll investigate.

Sebastian Hartte
@codecov

This comment has been minimized.

Copy link

codecov bot commented Oct 23, 2018

Codecov Report

Merging #2722 into master will decrease coverage by 0.05%.
The diff coverage is 76.92%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2722      +/-   ##
============================================
- Coverage     94.77%   94.71%   -0.06%     
- Complexity     3161     3166       +5     
============================================
  Files           354      354              
  Lines          8057     8081      +24     
  Branches        608      612       +4     
============================================
+ Hits           7636     7654      +18     
- Misses          271      276       +5     
- Partials        150      151       +1
Impacted Files Coverage Δ Complexity Δ
...ocumentation/swagger2/mappers/ParameterMapper.java 84.5% <76.92%> (-4.86%) 15 <7> (+5)
@dilipkrish dilipkrish added the PR label Nov 7, 2018
@dilipkrish dilipkrish added this to the 3.0 milestone Nov 7, 2018
@kremers

This comment has been minimized.

Copy link

kremers commented Nov 4, 2019

Having issues with #2717
Very happy with the solution, hope it makes it in 3.0.0-SNAPSHOT soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.