Giter Club home page Giter Club logo

Comments (11)

Jaza avatar Jaza commented on May 26, 2024 1

For your information, @frol, I have copied your flask_restplus_patched code from this project into a stand-alone project at https://github.com/Jaza/flask-restplus-patched , with corresponding PyPI at https://pypi.python.org/pypi/flask-restplus-patched (for nice pip install'ing).

I'm trying out using this code, but didn't want to commit it all directly into the repo for my own project. By having it stand-alone, I can just list flask-restplus-patched as one more dependency in my requirements.txt file.

Thanks for your work putting this together. I tried to get started with Flask-RESTPlus by itself, and with flask-apispec, but wasn't comfortable with either of them. Your boilerplate code for oauth2 in the API is also handy.

from flask-restplus-server-example.

frol avatar frol commented on May 26, 2024

I am not sure that I will merge the patched version back soon because it will require quite an amount of extra work to ensure that other Flask-RESTplus parameters/schemas play nice with Marshmallow-enabled parameters/schemas. I considered making it standalone, but I worry that just like Flask-RESTplus forked Flask-RESTful, I will create just another fork, which I will need to maintain completely myself. In fact, I want to try Flask-apispec since it has Marshmallow/Webargs support out of the box, and even though it is abandoned, it might be a better choice for me to improve it than patching Flask-RESTplus.

I am still polishing my example and auth module doesn't take enough love, and now it is my first priority.

Also would there be a very simple example somewhere (similar to the flask-restplus quickstart example) on how to use this patched version with marshmallow and webargs?

I haven't had this in my plans as I think that if you learn Flask-RESTplus and Marshmallow separately, you are fine to play with my "real-life" demo.

from flask-restplus-server-example.

rth avatar rth commented on May 26, 2024

I am not sure that I will merge the patched version back soon because it will require quite an amount of extra work to ensure that other Flask-RESTplus parameters/schemas play nice with Marshmallow-enabled parameters/schemas. I considered making it standalone, but I worry that just like Flask-RESTplus forked Flask-RESTful, I will create just another fork, which I will need to maintain completely myself.

Yes, the package fragmentation in the flask REST API community looks already pretty bad, particularly with respect to generating an OpenAPI specification: flask-restful (which now advises to use marshmallow without giving much more explanations), flask-restless, flask-restfulplus, flask-restful-swagger (which does not use marshmallow though), flask-restler, flask-resty , this example (with a "slightly" patched version of flask-restfullplus ) ), apispec_restful, flask-marshmallow, flask-apispec...

Maybe it's partly due to the fact that a number of those were started by a single developer and never reached a point of getting moved to an organization, though the The Pallets Projects (which currently hosts flask) might be trying to address it.

In fact, I want to try Flask-apispec since it has Marshmallow/Webargs support out of the box, and even though it is abandoned, it might be a better choice for me to improve it than patching Flask-RESTplus.

I have also reached the conclusion that flask-apispec would be the best/easiest solution in my case (to generate an OpenAPI spec from marshmallow/webargs definitions), the code is very nicely written too. In fact I have tried to adapt my (arguably fairly simple) flask-restful based project to it and it's working great so far. I'm just a bit concerned about future maintenance (cf. issue jmcarp/flask-apispec#26 ). If that project is indeed abandoned, I won't be able to do much long term maintenance, however, if necessary, I would be happy to give some help initially (there seem to be some development happening in the forks) and contact/annoy people on github until somebody willing to take over the maintenance can be found.

There is also an issue by @sloria on merging flask-apispec into flask-marshmallow, though I'm not sure if it's still relevant.

Also would there be a very simple example somewhere (similar to the flask-restplus quickstart example) on how to use this patched version with marshmallow and webargs?

haven't had this in my plans as I think that if you learn Flask-RESTplus and Marshmallow separately, you are fine to play with my "real-life" demo.

Fair enough, people would probably figure it out.

from flask-restplus-server-example.

rth avatar rth commented on May 26, 2024

Looks like flask-apispec is maintained again, so I would rather use it I think. Closing this issue. Thanks for your feedback though, it was good to have your confirmation on those points (and I'll use this "real-life" demo for inspiration on other topics ) )!

from flask-restplus-server-example.

frol avatar frol commented on May 26, 2024

@rth Super! Thank you for your feedback also. You are also welcome to PR Flask-apispec support instead of the patched Flask-RESTplus ;)

from flask-restplus-server-example.

autoferrit avatar autoferrit commented on May 26, 2024

@frol So this begs the question for me, if flask-apispec has the things you want, will you continue to support this patchwork of restplus? or will you not make a PR for it? I like what you are doing here and it fits me needs. But if you move to the way of apispec I would like to know earlier if possibly as I would rather get started with a non patched version of restplus vs using this patched version (even though I like what it does).

Just wanted to get an idea where its going.

from flask-restplus-server-example.

frol avatar frol commented on May 26, 2024

@autoferrit First of all, I am using this patched version in my commercial projects (I just made forks from this project), so I don't think I will move away from Flask-RESTplus that fast. Second of all, I feel like the patchset is quite stable, so I don't think it will ever need updates, I only add new features there. However, I don't think I will be able to merge the patches into Flask-RESTplus completely myself as it will require quite some testing and extra code for backward compatibility, from this point of view, I think it is much worthwhile to invest this time into flask-apispec. I feel that Flask-RESTplus is a bit bloated with the stuff inherited from Flask-RESTful, so if you want Marshmallow and Webargs, I really recommend you look into flask-apispec.

from flask-restplus-server-example.

autoferrit avatar autoferrit commented on May 26, 2024

Ok, i will look into flask-apispec more. Are you planning on trying to contribute back to that as well and/or use it? Im just weary since it was unmaintained for a bit even though there was some actual activity recently.

But thanks for the input. Ill check out apispec.

from flask-restplus-server-example.

rth avatar rth commented on May 26, 2024

@Jaza You could have forked this repo or at least preserved git history while doing that, FYI. That would have been a better acknowledgment for this project than a simple mention in the README.

Thanks for your work putting this together. I tried to get started with Flask-RESTPlus by itself, and with flask-apispec, but wasn't comfortable with either of them. Your boilerplate code for oauth2 in the API is also handy.

I can understand the feeling of creating another project.
Still, I wish there were one good Python package supported by the community for developing REST API in Flask, not 5 separate ones...

from flask-restplus-server-example.

Jaza avatar Jaza commented on May 26, 2024

@rth I couldn't have easily forked this repo, because it has flask_restplus_patched as just one component in a big monolithic set of example code. I put the mention in the README, and I've commented here, in an effort to properly communicate and to make transparent what I've done. I think that what I've done provides the proper acknowledgement, and is the most practical solution.

Yes, I also wish there were one good package for building a (Swagger-enabled) REST API in Flask. This is my first time playing around with it, and I must say I'm disappointed with the current state of the ecosystem. But, in my opinion, what @frol has put together here is the best solution available at the moment.

from flask-restplus-server-example.

frol avatar frol commented on May 26, 2024

Thank you for the info!

I am working on backporting all the patches back to Flask-RESTplus. There is no ETA, and it is going slowly since I don't have enough time now.

from flask-restplus-server-example.

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.