-
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
Conversation
...ator/test/src/test/java/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.java
Outdated
Show resolved
Hide resolved
f567837
to
9133c71
Compare
9133c71
to
9cf38e3
Compare
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.
Looks reasonable to me.
@andreaTP can you have a look on this? You said here:
Are you fine with this implementation (which follows common annotations) or should we follow the JSONSchema terminology? @manusa Do you have an opinion on this? Other open discussion topics are:
|
9cf38e3
to
d81385a
Compare
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.
LGTM, thx!
@manusa Do you have an opinion on this?
I really don't care as long as it's intuitive for users.
Since this doesn't involve any breaking changes I think it's fine if we delay it to 7.1.
What I'd really like is to release v7.0 this week. I'm not sure if there's anything else left.
4e08303
to
7093cb4
Compare
We are following Jakarta Bean Validation here, so this PR should be fine in terms of your goal.
If the following change is considered as bugfix, then we can postpone it:
I have not found anything else breaking, so feel free to create the release with or without this PR. |
Quality Gate passedIssues Measures |
OK; I forgot about that change. I'm merging it now. Maybe you want to add something in the MIGRATIOM-v7.md section for the CRD Generator. |
Description
Fixes #5836 (Add support for size constraints)
Fixes #5868 (Add support for exclusiveMinimum/exclusiveMaximum)
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
.Type of change
test, version modification, documentation, etc.)
Checklist