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

Issue 3255 #3259

Merged
merged 3 commits into from Feb 24, 2020
Merged

Issue 3255 #3259

merged 3 commits into from Feb 24, 2020

Conversation

shouldnotappearcalm
Copy link
Contributor

What's this PR do/fix?

fix @Size annotation does not work properly on List

Are there unit tests? If not how should this be manually tested?

You can write the following code in the bean

@ApiModelProperty("list1")
@Size(min = 1, max = 200, message = "1-200")
private List<String> list1;

Then you can see in the generated swagger json

list1:- {
type: "array",
description: "list1",
items:- {
  type: "string"
},
maxItems: 200,
minItems: 1
}

Any background context you want to provide?

As above

What are the relevant issues?

3255

@codecov
Copy link

codecov bot commented Feb 23, 2020

Codecov Report

Merging #3259 into master will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #3259   +/-   ##
=========================================
  Coverage     92.91%   92.91%           
- Complexity     3512     3513    +1     
=========================================
  Files           382      382           
  Lines          9330     9335    +5     
  Branches        768      769    +1     
=========================================
+ Hits           8669     8674    +5     
  Misses          472      472           
  Partials        189      189           

@shouldnotappearcalm
Copy link
Contributor Author

I looked at the test methods in the EnumMapperSpec class, but I feel that ArrayProperty class does not seem to be particularly suitable for current methods, because it does not have properties such as enums and minimum. Do I need to add a test method? @dilipkrish

@dilipkrish
Copy link
Member

dilipkrish commented Feb 24, 2020

Thank you for your contribution 🤘 . You can add a new method for your test. Without that there is no safety net for your change.

@dilipkrish dilipkrish added the bug label Feb 24, 2020
@dilipkrish dilipkrish added this to the 3.0 milestone Feb 24, 2020
@shouldnotappearcalm
Copy link
Contributor Author

Hi,I have added the corresponding unit tests for the new code. Please take a look when you are free. @dilipkrish

@dilipkrish dilipkrish added PR and removed bug labels Feb 24, 2020
@dilipkrish dilipkrish merged commit 34246cf into springfox:master Feb 24, 2020
@dilipkrish
Copy link
Member

Thank you @shouldnotappearcalm

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

Successfully merging this pull request may close these issues.

None yet

2 participants