Giter Site home page Giter Site logo

Comments (7)

atlithorn avatar atlithorn commented on July 30, 2024

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 superfluity

E.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.

JasonWWalton avatar JasonWWalton commented on July 30, 2024

Thanks for responding. Hope your vacation is a nice One.

from flask-swagger.

ibratoev avatar ibratoev commented on July 30, 2024

@JasonWWalton, can you test if #11 is a fix for this issue?

from flask-swagger.

atlithorn avatar atlithorn commented on July 30, 2024

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.

ibratoev avatar ibratoev commented on July 30, 2024

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.

atlithorn avatar atlithorn commented on July 30, 2024

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.

JasonWWalton avatar JasonWWalton commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.