|
Hi, I went through the documentation but could only find a guide for a custom validation annotation on the bean, is there a plan to support adding custom validation annotations in the generated models for the attributes of a bean? |
Answered by
hauner
Dec 17, 2023
Replies: 4 comments 3 replies
|
there is no existing plan. If we come up with a usable configuration I can probably add it. Can you provide an example what you have in mind? a few quick thoughts. I can think of two possibilities to configure this:
Maybe like this or
I guess the first would be nice to have that information in the api description. The second could be nice for implementation details. |
2 replies
|
summarizing, it could work like this: components:
schemas:
Foo:
type: object
properties:
bar:
type: string
maxLength: 10
x-constraints-1: "constraint"
x-constraints-2:
- "foo"
- "bar"and then map it to annotations with: map:
extensions:
- x-constraints-1 @ some.custom.Constraint
- x-constraints-2:
- foo @ some.custom.FooConstraint
- bar @ some.custom.BarConstraint |
1 reply
Answer selected by
arvindand
0 replies
|
released with 2024.1 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
summarizing, it could work like this:
and then map it to annotations with: