flask-restx icon indicating copy to clipboard operation
flask-restx copied to clipboard

Get arguments from query string in future versions ?

Open Sladerix opened this issue 1 year ago • 2 comments

Hi everybody, I went to the request parser section in the documentation and there is a red banner saying that the module will be deprecated. So what is the current correct way to extract the arguments from the query string?

e.g. http://localhost:5000/api/v1/animals?legs=4

Thanks in advance

Sladerix avatar Mar 29 '24 19:03 Sladerix

The Request parser is unlikely to be removed, so I would continue to use it - I do in my projects. The warning was put in when the library was under active development; however, it's currently in maintenance only. Ultimately, there are much more advanced libraries available if you require detailed validation, like marshmallow or pydantic (neither of which are integrated into flask-restx currently).

peter-doggart avatar Apr 01 '24 09:04 peter-doggart

The Request parser is unlikely to be removed, so I would continue to use it - I do in my projects. The warning was put in when the library was under active development; however, it's currently in maintenance only. Ultimately, there are much more advanced libraries available if you require detailed validation, like marshmallow or pydantic (neither of which are integrated into flask-restx currently).

That means, if I want detailed custom input validation, unless I modify the source code of Flask-RESTx myself, I can only write additional validation code in the business code, and cannot just integrate them using parser or model into @api.doc or @api.expect, right?

Does Flask-RESTx have a superclass similar to the ConstraintValidator interface in Java to implement custom validation?

WilliamChen-luckbob avatar Apr 03 '24 01:04 WilliamChen-luckbob