-
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? |
Beta Was this translation helpful? Give feedback.
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. |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
released with 2024.1 |
Beta Was this translation helpful? Give feedback.
summarizing, it could work like this:
and then map it to annotations with: