totalknowledge / angular-launchpad

MIT License
2 stars 2 forks source link

Flesh out API to cover edge cases and error states for PUT #27

Open totalknowledge opened 8 years ago

totalknowledge commented 8 years ago

Put

URI Payload Expected Action Return Payload Return Headers Meta Data
/api/v0/collections none returns error {"error":{"title":"Bad Request"}} HTTP/1.1 400 Bad Request N/A
/api/v0/collections/{id} none returns error {"error":{"title":"Bad Request"}} HTTP/1.1 400 Bad Request N/A
/api/v0/collections collection updates all records sent returns updated collection HTTP/1.1 200 OK Link: /api/v0/:collection/ Content-Type: application/vnd.api+json "links": {"self": "http://example.com/api/:collection/"}
/api/v0/collections/{id} collection returns error {"error":{"title":"Bad Request"}} HTTP/1.1 400 Bad Request N/A
/api/v0/collections record creates record returns record HTTP/1.1 200 OK Link: /api/v0/:collection/:id Content-Type: application/vnd.api+json "links": {"self": "http://example.com/api/:collection/:id"}
/api/v0/collections/{id} record updates record updated record HTTP/1.1 200 OK Link: /api/v0/:collection/:id Content-Type: application/vnd.api+json "links": {"self": "http://example.com/api/:collection/:id"}
totalknowledge commented 8 years ago

check json api compliance http://jsonapi.org/

totalknowledge commented 8 years ago

Relationships tbd.