pyeve / eve-swagger

Swagger extension for Eve-powered RESTful APIs
http://python-eve.org
Other
154 stars 43 forks source link

How do I distinguish between body of a POST request and response in swagger doc #71

Closed smithbk closed 5 years ago

smithbk commented 6 years ago

Can you please tell me how to make the swagger doc clearly display the POST request and response body separately?

For example, suppose I want to implement a POST /myobject with 'input' in the request body and 'output' in the response body. How do I specify this so that swagger distinguishes between them?

I have the following in my settings.py:

DOMAIN = {
    'myobject': {
        'extra_response_fields': ['input', 'output'],
        'schema': {
            'input':  {'type':'string'},
            'output': {'type':'string'}
        }
    }
}

The resulting swagger doc when viewing through petstore shows the request body with both the 'input' and 'output' fields, but it does not show a response body.

{
  "input": "string",
  "output": "string",
  "_id": "string"
}

Thanks in advance for the help, Keith

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.