-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(crd-generator): Add support for more validation constraints #6447
base: main
Are you sure you want to change the base?
Conversation
@@ -148,6 +152,14 @@ static Stream<TestCase> crdApprovalBaseCases(String crdVersion) { | |||
return cases.stream(); | |||
} | |||
|
|||
static Stream<TestCase> crdApprovalCasesApiV2(String crdVersion) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@manusa I have started here with splitting test cases into two groups:
- The existing tests for api-v1 and api-v2.
- Test cases targeting new features in api-v2 only.
I think this change is also important for other feature additions. Please let me know if I should prepare this in an extra PR to be able to merge this faster.
f567837
to
9133c71
Compare
Quality Gate failedFailed conditions |
Description
Add support for the following validation constraints:
@Min
and@Max
annotations@Size
annotation@Size
annotation@Size
annotationNotes:
@Size
will be detected on container types similar to@Pattern
and@Min/@Max
.@Min/@Max
and@Size
is now restricted to their intended types,e.g.
@Min/@Max
is only intended to be used on number types and not on strings.A boolean
inclusive
flag in the annotation, defaulting totrue
.Fixes #5836 (Add support for size constraints)
Fixes #5868 (Add support for exclusiveMinimum/exclusiveMaximum)
TBD:
@Size
be detected on container types, if the type itself is a container?e.g.
List<@Size(min=1) List<@Size(min=2) String>>
@Min
/@Max
annotation has the wrong type for the value. It feels wrong that we are usingdouble
. Are there any plans or thoughts to tackle this?TODO:
Type of change
test, version modification, documentation, etc.)
Checklist