Replies: 2 comments 7 replies
-
You may use |
Beta Was this translation helpful? Give feedback.
6 replies
-
Do you have a working example for your combination of readOnly + validation? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello @SDA-SE/sda-commons-maintainer ,
we had a discussion some times ago about resource models with read/write models. @christopher-cudennec , you should remember at least ;)
We currently favour the usage of the readonly flag in openapi specifications for such attributes that cannot be set by consumers instead of creating read and write model
This flag can be created with openapi annotations in java:
But this annotation does not cause a real validation, that the field is not set in writing operations.
Validation can be implemented with a custom validator
and used e.g. that way
with activation of this validation only for operations writing the resource
I think this feature can also be helpful for others and I would like to contribute that instead of creating my own library.
André
Beta Was this translation helpful? Give feedback.
All reactions