You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I saw from the examples in README that oneof_required is supported however there was no mention of anyOf. Looked through the source code and found that there's just one place in the code where anyOf is defined but for oneof_required there were a few lines that was parsing the oneof_required into the parent. Code for that can be found here
My question is whether or not anyof_required is supported in the same way that oneof_required is supported. I tried generating the schema with anyof_required and it didn't generate any anyOf array however anyOf is a valid part of JSON schema so it should be supported?
The text was updated successfully, but these errors were encountered:
Hi! No, not at the moment, but as you say, the implementation would be quite similar to the oneof syntax. PRs welcome :-)
My recommendations for these rare cases would be to avoid the Go tags and define your own JSONSchema method. You can find an example of defining the oneOf property manually here: https://github.com/invopop/gobl/blob/main/org/notes.go#L263-L278 The implementation with anyOf would be very similar.
I saw from the examples in README that
oneof_required
is supported however there was no mention ofanyOf
. Looked through the source code and found that there's just one place in the code whereanyOf
is defined but foroneof_required
there were a few lines that was parsing theoneof_required
into the parent. Code for that can be found hereMy question is whether or not
anyof_required
is supported in the same way thatoneof_required
is supported. I tried generating the schema withanyof_required
and it didn't generate anyanyOf
array howeveranyOf
is a valid part of JSON schema so it should be supported?The text was updated successfully, but these errors were encountered: