Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Different documentation for each method of a endpoint #30

Open
alejoar opened this issue Mar 29, 2016 · 2 comments
Open

Different documentation for each method of a endpoint #30

alejoar opened this issue Mar 29, 2016 · 2 comments

Comments

@alejoar
Copy link
Contributor

alejoar commented Mar 29, 2016

How would one go about adding different documentation for each method of the same endpoint?

For example, this code:

@app.route('/some/endpoint', methods=['PUT', 'GET'])
def some_path():
    """
    Some Endpoint
    ---
    tags:
        - some endpoint
    responses:
        200:
            description: success
    """
    (...)

will generate the same documentation for both PUT and GET methods.

How can I specify a particular definition for each method?

@atlithorn
Copy link
Contributor

Currently you cannot.

@alejoar
Copy link
Contributor Author

alejoar commented Mar 29, 2016

@atlithorn ok, thanks.

I was thinking something like this might be easily implementable:

@app.route('/some/endpoint', methods=['PUT', 'GET'])
def some_path():
    """
    Some Endpoint
    ---
    tags:
        - some endpoint
    get:
        responses:
            200:
                description: item obtained
    put:
        parameters:
              - name: someParam
                in: formData
                type: integer
                required: true
        responses:
            202:
                description: item updated
    """
    (...)

When I get some free time, I'll look into flask-swagger's code and try to implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants