1

Is it possible to define properties in a Swagger/OpenAPI definition that can be one of two types.

For example, our API allows a source ID to be sent as a string, or a source object. The source object has a fixed schema:

Source ID:

{
    "source": "src_123"
}

Source Object:

{
    "source": {
        "foo": "bar"
    }
}

I am unsure how to represent this in my Swagger definition.

Ben Foster
  • 34,340
  • 40
  • 176
  • 285
  • Possible duplicate of [Swagger 2.0 Anyof](https://stackoverflow.com/questions/34863160/swagger-2-0-anyof) – Helen Oct 26 '17 at 11:45

0 Answers0