How does flasgger handle multiple URLs with flask-restful?
See original GitHub issueI’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?
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
How does flasgger handle multiple URLs with flask-restful?
I'm using flask-restful and have a resource with two URLs, like this: api.add_resource(Job, '/job/ ', '/job') where job_id is used only by ...
Read more >Two urls with difference of one optional parameter to map to ...
According the the docs and source code for flask-restful, you can pass multiple urls to match to addResource. like:
Read more >How does flasgger handle multiple URLs with flask-restful?
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 ...
Read more >Working with APIs using Flask, Flask-RESTPlus and Swagger UI
The article discusses about how to use Flask and Flask-RESTPlus to create APIs and then use them to send and retrieve information.
Read more >README.md · Flasgger/flasgger - Gitee.com
Easy OpenAPI specs and Swagger UI for your Flask API. ... YAML docs and MethodViews; Handling multiple http methods and routes for a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Specify
endpoint
on each line, defining each as a separate target (as @xiaomaflying said):I also have this problem.