3

I have a scheme Foo with the fields a, b and c. c is an array which is not returned when I do a GET /foos, but it is returned when I do GET /foos/{foo_id}.

How can I represent that with swagger scheme? (the c field being shown only when GETing a specific Foo)

alexandernst
  • 14,352
  • 22
  • 97
  • 197
  • I think you need 2 different schemes for that return output. Swagger is RESTful. The idea is that the endpoints should return the same output scheme. Meaning: GET /foos should return an array of what ever /foos/{foo_id} returns. With that said, you need to create a seperate scheme, for the different respons models – VisualBean Mar 28 '17 at 12:58
  • Possible duplicate of [How to make a field in a definition required for some operations and not others](http://stackoverflow.com/questions/30895944/how-to-make-a-field-in-a-definition-required-for-some-operations-and-not-others) – Helen Mar 28 '17 at 16:16

0 Answers0