Open Api documentation for a single endpoint multiple posts request

Viewed 3729

I am trying to have Swagger/Open Api documentation for my single endpoint API.

My single endpoint looks like

POST: http://localhost/api/v1/process

the post body determines the logical path and response schema

Body1: {"jsonClass": "AnimalsRankedByLifeSpan"} Response1: schema-1

Body2: {"jsonClass": "AnimalsInRegion", "region":"Africa", "type":"lions"} Response2: schema-2

Expectation from documentation: Each jsonClass is listed as a separate call in swagger (or any other) and I can use the spec to get all the jsonClasses supported.

Doesnt look like, swagger supports this kind of design. If it does, please point me to examples.

Are there any other Api documentation frameworks I can use for providing request-response documentation for each kind of jsonClass supported?

1 Answers
Related