python-restx / flask-restx

Fork of Flask-RESTPlus: Fully featured framework for fast, easy and documented API development with Flask
https://flask-restx.readthedocs.io/en/latest/
Other
2.14k stars 333 forks source link

Get arguments from query string in future versions ? #597

Open Sladerix opened 5 months ago

Sladerix commented 5 months ago

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

peter-doggart commented 5 months ago

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

WilliamChen-luckbob commented 5 months ago

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?