Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make patched Flask-RESTplus standalone #36

Closed
rth opened this issue Oct 2, 2016 · 11 comments
Closed

Make patched Flask-RESTplus standalone #36

rth opened this issue Oct 2, 2016 · 11 comments
Labels

Comments

@rth
Copy link

rth commented Oct 2, 2016

Hi @frol,

I was wondering if there were any plans about merging this patched version of Flask-RESTplus into the Flask-RESTplus repository some day (or making it a stand-alone package) ? So that it can be used independently from the rest of this example. 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? Thank you!

@frol
Copy link
Owner

frol commented Oct 2, 2016

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.

@rth
Copy link
Author

rth commented Oct 3, 2016

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.

@rth rth closed this as completed Oct 3, 2016
@rth
Copy link
Author

rth commented Oct 3, 2016

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 ) )!

@frol
Copy link
Owner

frol commented Oct 3, 2016

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

@autoferrit
Copy link

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

@frol
Copy link
Owner

frol commented Nov 21, 2016

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

@autoferrit
Copy link

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.

@Jaza
Copy link
Contributor

Jaza commented Oct 15, 2017

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.

@rth
Copy link
Author

rth commented Oct 15, 2017

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

@Jaza
Copy link
Contributor

Jaza commented Oct 15, 2017

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

@frol
Copy link
Owner

frol commented Oct 16, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants