Code Monkey home page Code Monkey logo

Comments (7)

luolingchun avatar luolingchun commented on May 17, 2024

APIBlueprint inherited from Blueprint, so i think you can use the route() method directly .

but it doesn't work for swagger...

from flask-openapi3.

DerManoMann avatar DerManoMann commented on May 17, 2024

Yes, that is the point. I am not quite sure what the difference is between route() and individual methods like get(), but I suppose it should be possible to override it in APIBlueprint?
That would also avoid having to refactor in cases where an endpoint supports more than one HTTP methods...

from flask-openapi3.

luolingchun avatar luolingchun commented on May 17, 2024

This library focuses more on RESTful APIs and OpenAPI docs.

from flask-openapi3.

DerManoMann avatar DerManoMann commented on May 17, 2024

I am sorry, this answer doesn't make sense to me. Why is that different for OpenAPI docs whether a route is registered my route() vs. get()? (As mentioned, I am not clear about the difference between the two, but both can server JSON, XML or whatever and can support different auth schemes...?)

from flask-openapi3.

DerManoMann avatar DerManoMann commented on May 17, 2024

I did some more digging. The API docs state that get() is a shortcut for route() with methods=["GET"]
From: https://flask.palletsprojects.com/en/2.0.x/api/#flask.Blueprint.get

However, the library does not support using route(), so that is why I am asking.

from flask-openapi3.

luolingchun avatar luolingchun commented on May 17, 2024

We can make it for swagger. But if you specify two HTTP methods in route()(e.g. GET, POST), you'll get two API with same parameters in swagger,it feels weird.

I think get for query resources and post for created . Why don't we use get and post separately to make things easier?

from flask-openapi3.

 avatar commented on May 17, 2024

Fair enough.

from flask-openapi3.

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.