0

Have a question regarding how to indicate OR in JSON Documentation(Using Swagger).

I would prefer not to have comments , indicating but wanted to know what is the typical way of showing this?

Say I have the following : Method Type: PATCH

{
   Object1:{...},
   Object2:{...}

}

What is a good way to show the API Caller that one of these fields is required but entering both is optional? essentially XOR or OR

user60808
  • 15
  • 2
  • Do you use OpenAPI 3.0 (`openapi: 3.0.0`) or OpenAPI 2.0 (`swagger: "2.0"`)? Do you mean that a) `Object1` and `Object2` are mutually exclusive (that is, any one of them must be present, but not the other one), or b) either `Object1` or `Object2` **or both** can be present? Are there any other fields in that object other than `Object1` and `Object2`? – Helen Jun 17 '19 at 20:26
  • either Object can be populated, so either Object 1 or Object 2 can be populated, One of them must be present but not the other one, I am using API 2.0. No other fields exist outside these 2 objects – user60808 Jun 17 '19 at 21:20

0 Answers0