square / fdoc

Documentation format and verification
Other
379 stars 59 forks source link

Different response parameters for different response status #23

Closed chischaschos closed 11 years ago

chischaschos commented 11 years ago

Hi,

What happens when the response parameters differ depending on different response statuses?

Is there a way to specify this difference?

zachmargolis commented 11 years ago

It's all up to your schema.

It's a little noisier, but you could probably use a union type (basically an array of schemas). Anything that works in JSON schema should work in fdoc.

There was a similar question in #16, and I'm totally open to reviewing a PR that adds support for multiple requests/responses.