OpenAPI 3.0: How to make objects nullable that use oneOf, allOf, or anyOf
File this in the "notes to self" category. The OpenAPI docs are very sparse when it comes to nullable
, and it is very unclear how to set an object to nullable when it uses oneOf
, allOf
, or anyOf
in OpenAPI 3.0.
I've been working on writing an OpenAPI spec for an existing API, and hooking it in to Postman for our team to use. Unfortunately, Postman was giving me a validation error when making requests, but all it would say was "The response body didn't match the specified schema", with no actual details on which parts of the schema were wrong.
After much struggle and head-desking, I managed to work it out.