thisissoon / API-Specification

How we write our API's at SOON_
2 stars 0 forks source link

Trailing vs No Trailing / #7

Open krak3n opened 9 years ago

krak3n commented 9 years ago

Discuss @thisissoon/owners :stuck_out_tongue:

/orders/123 vs /orders/123/

edoparearyee commented 9 years ago

the FE should cope with either so it's a decision for the BE

krak3n commented 9 years ago

Thought this was quite an interesting idea (Taken from the Flask Docs):

POST: /<classname>/ - Create a new post (folder)
GET: /<classname>/ - Get a list of posts (folder)
GET: /<classname>/<id> - Get a specific post, no trailing slash, treat it as a file
PUT/PATCH/DELETE: /<classname>/<id> - Update/patch/delete the post, no trailing slash

Treating conceptually resources which hold collections of objects as "folders" that your getting or adding too and each specific object resource as a "file".

What do you guys think?

jamesjwarren commented 9 years ago

Interesting idea, I like it :smile: