Is there a way to make one key's all properties notNull with a single annotation? #378
Replies: 1 comment
-
|
Hi @EdwardJunyan, I've played around with this idea but couldn't come up with an easy solution from the top of my head. One idea would be to write a Creating a separate subtype where all properties are mandatory seems the easier approach to me at this point. 🤔 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Here is the situation:
I only want to make
spotBand spotB'slongitude&latitudebe@NonNull.How to make it happen without creating unnecessary
Positionclass?Is there a way I put an annotation on the
spotBand it's all properties will be nonNull?Here is my goal
{ "properties": { "spotA": { "type": "object", "properties": { "longitude": { "type": "number" }, "latitude": { "type": "number" } } }, "spotB": { "type": "object", "properties": { "longitude": { "type": "number" }, "latitude": { "type": "number" } }, "required": ["longitude", "latitude"] } }, "required": ["spotB"] }Beta Was this translation helpful? Give feedback.
All reactions