OAS allows you to set optional/required
properties in models. While serializing a model, optional properties will be omitted if the value of property is not set (i.e. initialized with null) and, required properties will be serialized in any case. This is a case of factoring schema in oneOf/anyOf
. Now with this support, you can define properties with the same names but with different optional/required constraints in request/response
of an endpoint.
4 posts tagged with "oneOf/anyOf"
View All TagsHandling Object Type as Dictionary for oneOf and anyOf in Java SDKs
OpenAPI Specification allows you to add an object
type in oneOf
and anyOf
in Java SDKs. Defining an object
type means any key/value pair is accepted. Object
type in Java means it can refer to any instance, as Object
is the root class. Therefore, this change enforces that for any object
type case falling under oneOf
and anyOf
, the Java SDK will treat it as Map
.
Adding Support for Nullable Types in oneOf and anyOf in Java SDKs
OAS allows marking properties as nullable, but previously this flag was not being respected in the Java SDK where oneOf/anyOf
was being used. Now with this release, the Java SDK fully respects the nullable attribute during serialization & deserialization for oneOf/anyOf
properties.
Adding Support for Enums in oneOf and anyOf in Java SDKs
Java SDKs now support enum types defined as oneOf/anyOf types. You can define as many distinct enum types as required with this support.