Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • Aug 05 20:09
    amotl commented #463
  • Aug 05 12:51
    thedumbterminal commented #462
  • Aug 05 11:31
    app-generator commented #462
  • Aug 05 10:45
    jpiwek commented #460
  • Aug 05 10:18
    peter-doggart commented #462
  • Aug 05 10:15
    ziirish commented #462
  • Aug 05 10:05
    takshch commented #460
  • Aug 04 15:57
    silasary commented #462
  • Aug 04 12:56
    carlosvega commented #462
  • Aug 04 12:56
    carlosvega commented #460
  • Aug 04 12:52
    carlosvega commented #463
  • Aug 04 12:51
    carlosvega commented #463
  • Aug 04 12:42
    carlosvega commented #460
  • Aug 03 21:24
    paulogil2010 commented #462
  • Aug 03 16:40
    systemime commented #448
  • Aug 02 22:26
    plowman commented #463
  • Aug 02 21:45
    plowman synchronize #463
  • Aug 02 20:28
    ptmcg commented #463
  • Aug 02 20:25
    davidism commented #463
  • Aug 02 20:23
    davidism commented #463
Harshal Chaudhari
@brockpalen glad that helped and worked out for you. Yeah my experience has been the same and daunting with restx. Many times I find myself overriding many functions from the library.
Brock Palen
NP, I really like the library, just wish it had more community behind it, it front ends out 14,000 CPU HPC cluster, and will soon front end our 20PB research archive, our univeristy really appreciates such an easy to understand library is available,
Brock Palen
Maybe I'm not grocking it, but how do I input validation when for POST requests @api.route("/<string:subaccount>/user/<string:uniquename>") How do I do stricter validation of uniquename much like parsing payloads? Do I do it all manually in my routine? Or is there something more strict than <string:varname> ?
Harshal Chaudhari
Ah what you are looking for is more of base flask functionality here. Flask provides a set of converters types to validate/typecast the route params. You can create your own converter types as mentioned here. https://uniwebsidad.com/libros/explore-flask/chapter-6/url-converters
If you don't want to define your own stuff and prefer a library doing it for you heres one https://github.com/Ge0rg3/flask-parameter-validation seems to support whitelists and regex validation
Brock Palen
Thanks i'll check that out
Brock Palen
BTW do POST requests have to have a payload if all the values in the model are optional? I found my unit tests fail unless I send an empty payload.
Harshal Chaudhari
Short answer is yes :) You could get away with using content-length header set to 0 also
Brock Palen
Weird, then why do I get a 500 rc if I don't pass data=json.dumps({})
Ryan Truran
OAS3 allows for one response to have multiple schemas, through the use of oneOf, anyOf, allOf, not.
Does restx currently support this?
Matthew Jacobsen
Can anyone offer some live support right now? I am having trouble with my routing. Keep getting 404 when routing to my API Blueprint, but the regular flask routes are getting reached just fine
Jamin Collins
I'm having a bit of trouble with RequestParser and how to specify that an argument is a list of strings. From what I can find, action="append" should do it, but adding this appears to drop the element from the generated Swagger documentation.
Brock Palen
Is there a flask library to generally protect against URL injection through routes? The flask security page didn't have anything that stuck out,
@j5awry @ziirish Any ETA for the next bugfix release?
Giacomo Gritzan

I currently have problems with marshalling my Responses.

I am trying to do the following:

test_model = Model(
        "_id": fields.String,
        "name": fields.String,
        "location": fields.String,
        "ip": fields.String,

success_model = Model(
    {"data": fields.List(

Without throwing any exception the data in the response is null

[{"status": "success", "data": null}']
Can somebody give me an advice?

Patrick Ray. Huang
hello all, I am new to restx, wondering when creating a model that has a one to many relationship, (e.g, order and order_items), how do i specify the field in the order model?
Tiago Tavares
Could enable the creation of models without automatically documenting, please?
It would be great to use @api.marshal_with(model) with multiple models, but not letting all of them be documented in swagger
John Chittum
FYI: i'm no longer a maintainer of python-restx. @ziirish is the final member left. I've removed my privs from Github. unfortunately, I have no time. and, honestly, i've started receiving personal emails asking about merges, etc. I don't have the capacity to deal with those.
1 reply
Honestly, at this point, flask-restx is so far behind so many projects in capabilities, even if we merged in a few things, it'd be worth users finding new frameworks
Benjamin "Ziirish" SANS
Thanks j5awry for your time and efforts so far!
And I agree with you about the new frameworks that have more traction
Piotr Borowy
I too thank for work with this framework. Do you have some proposal in some framework to use instead of RestX?
Is there any tutorials for RestX with jinja as I am not able to find any documentaion on google for some frontend with RESTX.
Tiago Tavares
Which ones should I use
I agree. Restx is quite limited
Hello, can someone helpme with a Wildcard setting?
What i'm trying to do is to specify the structure of my Wildcard, i want it to be input* instead of just *
This message was deleted
from flask import Flask
from flask_restx import Resource, Api, fields

api = Api()
app = Flask(__name__)

input_model = api.model('Input', {
    'type': fields.String,
    'topic': fields.String,

output_model = api.model('Output', {
    'type': fields.String,
    'topic': fields.String,

class Input(Resource):
    @api.marshal_with(input_model, envelope='resource')
    def get(self):
        return {'hello': 'world'}

class Output(Resource):
    @api.marshal_with(output_model, envelope='resource')
    def get(self):
        return {'hello': 'world'}

control_model = api.model('Control', {
    'name': fields.String,
    'address': fields.String,
    'inputs': fields.Wildcard(fields.Nested(input_model)),
    'outputs': fields.Wildcard(fields.Nested(output_model)),

class Control(Resource):
    @api.marshal_with(control_model, envelope='resource')
    def get(self):
        return {'hello': 'world'}

if __name__ == '__main__':
This is the structure on swagger
I want instead of * have input* and output*, to accept a object like
control = {
 'name': 'Main Control',
 'address': '',