Skip to main content

4 posts tagged with "oneOf/anyOf"

View All Tags

· 2 min read

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.