flasgger/flasgger

How does flasgger handle multiple URLs with flask-restful?

Open

#174 opened on 2017年12月28日

GitHub で見る
 (10 comments) (0 reactions) (0 assignees)Python (3,435 stars) (500 forks)batch import
bughacktoberfesthelp wanted

説明

I'm using flask-restful and have a resource with two URLs, like this:

    api.add_resource(Job, '/job/<int:job_id>', '/job')

where job_id is used only by the GET method.

In the resources code I have:

class Job(Resources):
    def get(self, job_id):
        """
        Retrieve a job from its ID
        ---
        tags:
          - Jobs
        parameters:
        - name: job_id
          in: path
          description: ID of the job
          required: true
        responses:
          200:
            description: Job found
          404:
            description: Job not found
        """

the expected result is a swagger spec with only one URL path for the GET operation, but flasgger generates a swwager spec with two URL paths for the GET one for /job/{job_id} and another one for /job.

Is it possible to separate specifications by path or method in this case?

コントリビューターガイド