Comments (7)
Thanks for the bug report Jason. I'm currently on vacation with limited
internet access. I'll have a look as soon as I can.
Atli
On Monday, June 15, 2015, Jason Walton [email protected] wrote:
Permutations of routes and verbs appear as documented operations in the
swagger output that aren't present in the code. Other applications rely on
the JSON output of swagger, and the superfluityE.g. The code defines a route at "/edges/" with "GET" and "POST" methods.
The code also defines a route at "/edges/int:annotation_id/" with "GET",
"PUT", "PATCH", and "DELETE" methods. [This is a total of 2 routes and 5
method verbs.] The swagger output shows a list of 10 operations, which
includes combinations of verbs and routes that don't exist in code (e.g.
"POST" for the "/edges/int:annotation_id/" route).—
Reply to this email directly or view it on GitHub
#10.
from flask-swagger.
Thanks for responding. Hope your vacation is a nice One.
from flask-swagger.
@JasonWWalton, can you test if #11 is a fix for this issue?
from flask-swagger.
Jason, could you provide a little test script (similar to example.py in the repo) so I can reproduce this and figure out what's going on?
I have seen @ibratoev's solution and it looks good but I want to reproduce this for myself before merging the code and I have been unable to do so via the description in your bug report.
from flask-swagger.
To reproduce that you can change this from the current example:
app.add_url_rule('/users/<int:team_id>', view_func=UserAPI.as_view('users'))
to
app.add_url_rule('/users/<int:team_id>', view_func=view, methods=["GET"])
app.add_url_rule('/testing/<int:team_id>', view_func=view)
I expect only the GET to be described for the /users/* url but both GET and PUT are.
I can suggest adding a few testing tests to cover the existing functionality. I can help with that if you wish when I get some free time.
from flask-swagger.
Yes that's a good idea @ibratoev and would be highly appreciated.
I see how your PR will fix this problem and I'm going to merge it now, I would however be interested to hear from @JasonWWalton as well, hopefully this solves his problem
from flask-swagger.
Gentlemen, this does appear to solve my problem! Thanks for taking a look. My apologies if the description I provided did not clarify the issue. But I'm glad you were able to get to the bottom of it. And glad the fix helps others as well. Thanks again. In the meantime I had resorted to creating another class for the endpoints that take an argument in the path. But this could be cleaner.
from flask-swagger.
Related Issues (20)
- Doc example showing root level definitions? HOT 1
- Are Blueprint supported ? HOT 9
- Pip source code is different from github master branch HOT 2
- Multiple path parameters and multiple endpoints HOT 3
- Add partial substitution of docstrings -- expansion of .yml file support HOT 5
- Spec throws exception on bad yaml HOT 1
- Swagger UI v3 HOT 2
- Support resuableParameters
- yaml file location HOT 2
- Support flask blueprint
- Passing Absolute YAML Path In Windows HOT 1
- pip install missing packages
- Supported methods to authenticate and cache web token
- Support for "securityDefinitions" HOT 3
- AttributeError: type object 'Create' has no attribute 'lower' HOT 1
- TypeError: swagger() got an unexpected keyword argument 'base_path'
- Type annotations / type hints / stub files for mypy HOT 4
- [Question] Can I check flask-swagger comments for correctnes?
- 'base_path' argument error HOT 3
- Invalid path parameter HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flask-swagger.