Skip to content
This repository has been archived by the owner on Mar 18, 2019. It is now read-only.

No Response class #8

Open
tovmeod opened this issue Jun 20, 2017 · 0 comments
Open

No Response class #8

tovmeod opened this issue Jun 20, 2017 · 0 comments

Comments

@tovmeod
Copy link

tovmeod commented Jun 20, 2017

I'm not sure if this is the right project, I'm just trying to generate a swagger file for my DRF project

In any case I believe that somewhere we need to define a Response class so I can have the responses entries in swagger generated instead of having to add manually.

I wrote an initial version looking here (http://swagger.io/specification/#response-object-58), I can prepare a PR if relevant:

class Response:
def init(self, status, description=None, schema=None, headers=None, examples=None):
"""
todo create headers object (http://swagger.io/specification/#headersObject) and
examples object (http://swagger.io/specification/#exampleObject)
:type status: int or str
:type description: str
:type schema: coreschema.schemas.Schema
"""
self.status = status
self.description = description
self.schema = schema
self.headers = headers
self.examples = examples

btw, can we have an empty file type for now just so I can generate the proper field type for swagger:

class File(Schema):
    pass
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant