Is it possible to use class objects as inputs for a custom annotation? #1272
Unanswered
lillianlouie
asked this question in
Q&A
Replies: 1 comment
-
|
@srinivasankavitha Would you be able to help? |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Hi, w e would like to support validation groups in our schema, but this requires support for class objects. For example:
In this example, we are using the same model for Create and Update, but we want to validate the same model differently based on the operation.
Leveraging https://netflix.github.io/dgs/generating-code-from-schema/#generating-classes-with-custom-annotations, we want to pass a class object or a list of class objects to mark the validation classes. Something like:
However, looking at the DGS CodeGen and GraphQL parser, I do not see support for class objects as a parameter. A possible workaround would be to use a string and then reflection to get the class but would prefer a less brute force method.
Is there a way to do this? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions