jfinkels / flask-restless

NO LONGER MAINTAINED - A Flask extension for creating simple ReSTful JSON APIs from SQLAlchemy models.
https://flask-restless.readthedocs.io
GNU Affero General Public License v3.0
1.02k stars 301 forks source link

Too opinionated about trailing slash on resources? #649

Open Datamance opened 7 years ago

Datamance commented 7 years ago

Hi, please see this issue on the jsonapi_requests library.

IMO, GET requests to http://localhost:5000/api/v1/products and http://localhost:5000/api/v1/products/ (note the ending slash) should yield a 200 response given appropriate resources in the database.

I think you and @socialwifi should work together a bit on this - having jsonapi_requests as a testing mechanism for flask_restless would be really nice, especially if I want to do load testing.

jfinkels commented 7 years ago

Hi @Datamance thanks for the report. I assume the problem comes from the behavior of trailing slashes in Flask: http://flask.pocoo.org/docs/0.12/quickstart/#variable-rules Your suggestion makes sense I suppose, let me think about it.