Can we produce dependentRequired or other conditions somehow? #328
-
Is there any way we can annotate a class in some magic way to represent conditions and have the generator produce such schemas? Look at the examples here: https://json-schema.org/understanding-json-schema/reference/conditionals.html |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Hi @HenrikPublic, The short answer is: No, no magic annotation (that I know of) would fully cover the nearly endless possibilities there. If you have a concrete example, I may be able to provide you with a concrete suggestion for that use case. |
Beta Was this translation helpful? Give feedback.
-
Thought soo, unfortunately 😊 I was dreaming about something like
For if-then-else, I am not sure how I envisioned this. Perhaps with a list of annotations:
The allOf and anyOf probably gets even more contrived... I just hoped someone already saw that need and had thought of a clever solution ;-) |
Beta Was this translation helpful? Give feedback.
Release v4.30.0 has been published. 🚀
It includes support for the
dependentRequired
keyword as per the aforementioned PR.