SkipLabs / skip

Skip is a framework for building reactive services
https://skiplabs.io
MIT License
155 stars 10 forks source link

Restrict `Resource` output to string-keyed collections #539

Open bennostein opened 13 hours ago

bennostein commented 13 hours ago

The default REST server implementation passes HTTP path parameters straight through to Skip, which caused me a bit of confusion when resources have non-string keys.

We may avoid putting key parameters straight into the path in the future, but for now this prevents the confusion I ran into (i.e. requesting a path like /users/1 and getting nothing because the user is keyed on the number 1 and not the string "1")

jberdine commented 10 hours ago

Question: would changing from GET to POST a la https://github.com/SkipLabs/skip/issues/535, which would put the resources and params into the request body as json instead of being encoded in the URL, have avoided the original confusion?