Trying Play with scala and stuck at validation of dtos as case classes #13178
Unanswered
hmalhotra20
asked this question in
Q&A
Replies: 0 comments
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.
-
Exploring both scala and play with latest versions for my mvp project
I can see in java version of docs jsr303/jakarta validation api is still supported but it seems scala version only supports defining a mapping like this
Not sure if this true to best of my research so far?
I was switching to scala/play for concise code but this way of validations is bringing boilerplate code.
Appears validations now require defining DTO case classes first, then apply/unapply methods in them and then defining mappings too for action validations.
For large DTOs with many fields this becomes dirty code in every action class. Also reading out for form validations 22 fields restriction still apply?
Is there any other way in play scala API for REST api json validations for case classes as DTOs. Is JSR or declarative validation to be supported in scala API for play 3.x?
Beta Was this translation helpful? Give feedback.
All reactions