Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
John Chittum
@j5awry

Couple quick things -- remove Akamai from the copyright. I don't work there anymore (well, won't, as of Jan 17th), and I never made a code commit that's copyrightable.

Kill py2

I'm not quite understanding how the 2 packages things will work since we can only publish 1

I'm a fan of slack because I'm on it all the time. Gitter is fine, but since i don't live on it, i don't check as often as I should. I...hate zulip.

Andrey Kurilin
@andreykurilin
@j5awry project name on pypi != packages that it provides. For example, both https://pypi.org/project/jwt/ and https://pypi.org/project/PyJWT/ provides package with jwt name. https://github.com/python-restx/flask-restx/blob/master/setup.py#L78 this section can include whatever you want number of packages. usually, it inbcludes only one package that equals to project name on pypi, but there are a lot of cases that it is not true. ANother example is here, when setuptools.find_packages method is executed but without providing exclude=['tests', 'tests.*']... there are a lot of projects on pypi that delivers tests package alone with their projects
Ben Steadman
@SteadBytes
@andreykurilin Just to check, would this mean having two directories within the codebase flask-restplus and flask-restx?
Ben Steadman
@SteadBytes
i.e. flask-restplus remains as it it currently and flask-restx has all the renames
Andrey Kurilin
@andreykurilin
@SteamBytes: hm... as far as I remember, 'packages' section of setup.py accepts a dict where key is name of package and value is path(or something like this?!). This means that several keys can map to one path. The hardest part is to distinguish whether it was import of 'flask_restx' or 'flask_restplus' to print deprecation message. Here we have to options. First one is adding parsing of call traceback to flask_restx.init to identify this. Another option is adding almost empty files into flask_restplus dir that duplicates names of public modules of flask_restx and include imports of flask_restx, so the code part will not be duplicated
Ben Steadman
@SteadBytes
Yeah, the setup.py bit isn't so much the problem - it's how to manage the code between both packages. If there's no absolute imports within the package itself i.e. from flask_restplus.models import ... then in theory pointing both packages to the same flast_restx directory should work (not that I've verified this).
If possible, option 1 or something similar would be best IMO
As long as parsing that call traceback does not have a significant impact at runtime
Andrey Kurilin
@andreykurilin
I can help with this task after your initial PR will be merged
Ben Steadman
@SteadBytes
Much appreciated @andreykurilin
I've put up a WIP PR for the renaming python-restx/flask-restx#2 @ziirish, @j5awry please take a look at the questions in the PR description regarding author name :smile:
Ben Steadman
@SteadBytes
Gitter should be up and running too https://gitter.im/python-restx
I've got to sign off for tonight now, hopefully we'll have some answers to the questions I mentioned on python-restx/flask-restx#2 and I can get the great renaming of 2020 complete tomorrow :wink:
John Chittum
@j5awry
Awesome! Thanks for all the setup work folks!
John Chittum
@j5awry
for consistency, dead or not, i've put in a PR to restplus remove akamai (since i don't work there and made no code changes). It also specifies what Akamai folks should do in the future
Ben Steadman
@SteadBytes
Awesome, thanks @j5awry
Ibrahima Gaye
@ibstelix
Amazing job, thank you all.
martireg
@martireg
Hello guys, is flask-restx ready for production usage?
Benjamin "Ziirish" SANS
@ziirish
hello @martireg
not yet
martireg
@martireg
Thank you, there is some aprox date┬┐?
Benjamin "Ziirish" SANS
@ziirish
I'll soon release some "usable" packages, but the intent is just to test our CI/automation
soon == by the end of the week
after that, we will work on a proper release as discussed here: noirbizarre/flask-restplus#743
martireg
@martireg
nice
Bhathiya Perera
@JaDogg
That is good to know. Thanks for all your hard work.
lewcianci
@lewcianci
hey everyone, this is probably a dumb question, but i've read the docs and i can't work out how to add an api operation that takes body parameters and produecs a response
i'm also using swagger and swagger ui
so the intent would be to make an operation that takes body parameters of a certain model, does something with those values, and then returns a serialised response to the client
Adam Hughes
@adam.hughes_gitlab
Does anyone know if it's possible to pass a parameter to the constructor of a Resource? I need my Resource to access a GCP client for example
Matt Flaherty
@flayman
Hi all. You're probably not going to get much of a response here to questions. This project has been superseded by flask-restx. Chat is here: https://gitter.im/python-restx
Adam Hughes
@adam.hughes_gitlab
thanks
so we should not use flask-restplus anymore?
or is it jsut the chat that's moved?
Matt Flaherty
@flayman
Flask-restplus will not have any further releases. It is no longer supported. Flask-restx was forked off it a few weeks ago.
Adam Hughes
@adam.hughes_gitlab
ty
Adam Hughes
@adam.hughes_gitlab
sorry - and unreleated question - everytime I make a request to the endpoint associated with my Resource, the resource gets recreated (eg. init()) is called on each request. Is this expected?
oops wrong chat sry
Ankur Shah
@ankurpshah
getting mixcontent error for swagger.json. It is using http instead of https. Tried app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1, x_host=1), still no luck
Franck Kambiwa
@thynquest
hello there
I just learned that flask-restplus is no longer maintained ?
Callam
@cal97g
@thynquest check python-restx/flask-restx
it's a drop in replacement
Harsh Thakur
@harshthakur9030
Hey guys, I want to write a serverless function but write it using flask-restplus. Can someone help me figure out how to do it? I've tried Zappa but that didn't yield the results I was hoping for :/
@SteadBytes @ziirish any idea
Callam
@cal97g
@harshthakur9030 this project is unmaintained.
Sergey Vilgelm
@SVilgelm
@harshthakur9030 How do you see this? The flask-restplus|restx is a Flask's extension that adds support for quickly building REST APIs and Flask is a WSGI web application framework. The both libraries are used to build a web server. I'm not sure how can you use them to implement a server less function.
John Chittum
@j5awry

@harshthakur9030 1) use python-restx not restplus. 2) never done serverless, as I've always done much larger things. Reading this guide made sense: https://medium.com/@Twistacz/flask-serverless-api-in-aws-lambda-the-easy-way-a445a8805028

however I'd have serious doubts about the self-documenting OpenAPI part working properly on serverless. I haven't run across anyone doing it yet

Anthony Torres
@am17torres
Hi all. I'm having some issues configuring flask-restplus to expect a polymorphic input payload on a post route. Does anyone have reference material on how to get this to work?
The two problems I'm facing:
  • api.inherit() doesn't include the model in the schema spec unless I add the model to an ns.expect
  • ns.expect(child1, child2, validate=True) is trying to validate the input payload against both children instead of either or.
ns=api.namespace('todo')
parent = api.model('Parent', {
    'name': fields.String,
    'type': fields.String(discriminator=True)
})

child1 = api.inherit('Child1', parent, {
    'extra': fields.String(required=True)
})

child2 = api.inherit('Child2', parent, {
    'extra2': fields.String(required=True)
})

@ns.route('/')
class TodoList(Resource):
    @ns.doc('create_todo')
    @ns.expect(child1, child2, validate=True)
    def post(self):
        return api.payload
Harsh Thakur
@harshthakur9030
@j5awry I have noticed the OpenAPI thing too and I'm pretty new to serverless. Why don't people document their API in serverless? How would another developer know the functionality the orignal developer created?