Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 21 19:27
    marius-nicolae commented #372
  • Sep 21 19:07
    marius-nicolae commented #372
  • Sep 20 13:41
    AbdoDabbas commented #716
  • Sep 20 13:32
    AbdoDabbas edited #716
  • Sep 20 13:32
    AbdoDabbas opened #716
  • Sep 20 12:47
    whatnick commented #362
  • Sep 20 08:07
    tincumagic opened #715
  • Sep 19 20:10
    marius-nicolae commented #372
  • Sep 19 20:08
    marius-nicolae commented #372
  • Sep 19 20:04
    marius-nicolae commented #372
  • Sep 19 12:03
    marius-nicolae commented #372
  • Sep 19 11:15
    marius-nicolae commented #372
  • Sep 19 00:24
    coveralls commented #714
  • Sep 19 00:24
    coveralls commented #714
  • Sep 19 00:24
    coveralls commented #714
  • Sep 19 00:24
    Coveralls noirbizarre/flask-restplus (master) -0.03%
  • Sep 19 00:19
    danielhoherd opened #714
  • Sep 18 19:54
    woel0007 opened #713
John Chittum
@j5awry
Most of the changes are to Swagger things, though #691 is a bit of a ocre change
*core change
Shirish Kadam
@5hirish
Hi, is it possible to change the schema of the model validator error response?
Right now it is as follows:
{'errors': {'': "None is not of type 'object'"}, 'message': 'Input payload validation failed'}
John Chittum
@j5awry
@5hirish I'm not sure off the top of my head. You can make custom exceptions generally, but I haven't thought about it regarding validator responses

@noirbizarre , one thing we haven't discussed is merge strategies. I realized that after saying "i'm going to merge 706."

Is there a merge strategy preferred for this repo? Merge, Squash and Merge, or Rebase (to base, hopefully master) and Merge.

Guess the real question is squash or not?

Matt Flaherty
@flayman
Hi @j5awry. I have a couple of PRs in the mix, one of which you already approved. Any chance of getting those in? Thanks.
John Chittum
@j5awry
merged 706 (with merge commit)
John Chittum
@j5awry

@flayman I reviewed #661, looks good. I'll give it a "bake" day to see if anyone else has comments or issues

If any other maintainers have comments, please hit them up soon

I'm trying not to just take over reviewing and merging, and forcing changes through :)
Matt Flaherty
@flayman
Thanks. That's fine. As long as someone gets to it at some point soon.
John Chittum
@j5awry
I'm merging #661
err, #663 which fixes #661
John Chittum
@j5awry
for #553 @SteadyBytes had some comments on it. I think things have been addressed in recent pushes. I'll check on that, and comment letting them know it'll need a rebase and conflict fixed before we can merge (the changelog, obviously)
reptillicus
@reptillicus
Howdy
I can't get flask-restplus to enforce the request body to be an array
something like this:
resource_fields = api.model('myModel', {
'system_d': fields.String(required=True),
'path': fields.String(required=True)
})
@api.expect(body=[resource_fields], validate=True)
Even if I pass in just a JSON object it is allowing it
also tried with
parser = api.parser()
parser.add_argument('system_id', type=str, required=True)
parser.add_argument('path', type=str, required=True)
@api.expect(body=[parser], validate=True)
AJ Pryor, Ph.D.
@apryor6
There is a fields.List type that you can use to create arrays
within your model
reptillicus
@reptillicus
Can't just have a bare array?
It would have to be something like
{"things": [] }
John Chittum
@j5awry

you should be able to, though I haven't tried. You can set minItems=0

https://flask-restplus.readthedocs.io/en/stable/_modules/flask_restplus/fields.html#List

and you can have no required things inside of it

so, like

fields.List(
    fields.String(required=False),
    minItems=0
)

Or something like that (shooting from the hip)

John Chittum
@j5awry
#712 is odd to me. Ignoring the slightly poor example provided, I was able to reproduce easily in more appropriate flask-restplus code. Is there something about / not being usable, even after moving the documentation endpoint? Was there something about that before our collective memory might rememebr?
ziirish
@ziirish
@j5awry nothing about this on the top of my head
also, I' have several running example of "/" api routes that don't seem to trigger the bug
so maybe it's just a thing with the empty namespace
John Chittum
@j5awry

@ziirish , if you could toss in a simple example of root working, that'd be awesome. I'll look around in the code and try some other things, starting with what happens with empty namespace.

It's funny, I've never used just \ as anything other than swagger docs with flaskrestplus. I always build out a versioned API namespace v1\ on top of a base that's usually \api\.

and why i did \ and / just now, i have no idea. Not even on a Windows machines...
i should finish this coffee before engaging on chat...
ziirish
@ziirish
@j5awry, in your reproducer, just change line 7 with: ns = api.namespace('test', description="base")
you can then curl /test
John Chittum
@j5awry
that's not the case though?
the case is /
and just /
ziirish
@ziirish
so to me the issue is with the namespace named ''
I haven't dug in the code yet, but I assume the issue lies within the RESTPlus router with splits out the request URL into something like: namespace, route = url.split('/', 1)
ziirish
@ziirish
maybe this is a good start:
ziirish
@ziirish
okay, with your reproducer FLASK_APP=app.py flask routes says: _hello_world GET / so the route is well registered
BUT there is a second route attached to /: root GET /
that might be the origin of the problem