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
In case this concerns a type that is often used, it can be improved of course by creating a custom type for this and overloading the %, but it still results in something custom for each different group of types.
will still result in extra null value(s) (in case of return value), or it will not be properly checked for only one of the values (in case of a parameter). (I've checked with AJV schema validator and it does consider the extra null(s) valid according to the schema, but I wouldn't be surprised if some implementations do complain about the null.)
only works if all types are supposed to be wrapped in an object
PS: Optional fields now can be removed from output and the server also able to handle null fields
The text was updated successfully, but these errors were encountered:
Issue regarding potentially improving support for the
oneOf
JSON schema, and perhaps alsoanyOf
and others.When currently one of two (or more) types are to be accepted, we will typically write something custom, e.g.:
In case this concerns a type that is often used, it can be improved of course by creating a custom type for this and overloading the
%
, but it still results in something custom for each different group of types.For some scenarios the
Option
type can be (ab)used to deal with this, like here: https://github.com/status-im/nim-web3/blob/437c768bc3267da325645a7f346516f75776a05c/web3/ethtypes.nim#L289But it is not ideal as it:
will still result in extranull
value(s) (in case of return value), or it will not be properly checked for only one of the values (in case of a parameter). (I've checked with AJV schema validator and it does consider the extranull
(s) valid according to the schema, but I wouldn't be surprised if some implementations do complain about thenull
.)PS: Optional fields now can be removed from output and the server also able to handle null fields
The text was updated successfully, but these errors were encountered: