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

Validation annotations on collection items #618

Merged
merged 8 commits into from
Aug 30, 2023

Conversation

walaniam
Copy link
Contributor

This PR is to fix issue with missing constraints on primitive collection items
Example spec:

        arrangementIds:
          description: Internal arrangement ids
          type: array
          items:
            type: string
            minLength: 5
            maxLength: 361

will now generate following code for boat spring generator

      @Valid
        private List<@Size(min = 5, max = 361) String> arrangementIds = new ArrayList<>();

Above change was applied in pojo.mustache by use of collectionDataType.mustache

Additionally tests were refactored by factoring out MavenProjectCompiler and VerificationRunner into separate classes.

Copy link
Contributor

@miladbb miladbb left a comment

Choose a reason for hiding this comment

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

LGTM! just update the changelog please

@sonarcloud
Copy link

sonarcloud bot commented Aug 30, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@walaniam walaniam merged commit 2d91d71 into main Aug 30, 2023
3 checks passed
@walaniam walaniam deleted the validationAnnotationsOnCollectionItems branch August 30, 2023 10:35
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.

None yet

3 participants