Open septianw opened 4 years ago
409 "indicates that the request could not be completed due to a conflict with the current state of the resource." as per https://tools.ietf.org/html/rfc7231#section-6.5.8
You are conflating "state of the resource" with state in general, i believe. In this case of the diagram, the request is meant to create a new resource, thus it cannot logically hit a 409 because there is no resource state to conflict with.
It may conflict with the general state e.g. POST /mygarage/cars -> 409 "garage is already full" but that can (should, by some API patterns) be a two-requests step: 1. Create the car (POST /cars -> 201 /cars/id123; will work no matter how full the garage is) 2. Add it to the garage (POST /mygarage add car id123 to my garage), and this time the request goes via the process section of the diagram and may return 409 "garage is already full". Did i lose you or do you understand the difference?
I must note though that all the 500 blocks in the diagram mean "anything goes, i cannot come up with a generic logical flow so you know better from here on", not "you must return 500". I think i mentioned that somewhere, if not - i should.
On 15 Jan 2020, at 22:15, Septian Wibisono notifications@github.com wrote:
How if i create with method POST and endpoint create (create_path) but has conflict or duplicate. isn't it should be M2 to M3 instead of to M2 to N3?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Understood. According to this diagram, how to prevent conflict when posting same content of field? e.g:
I don't know whats inside, so i can't afford PUT.
How if i create with method POST and endpoint create (create_path) but has conflict or duplicate. isn't it should be M2 to M3 instead of to M2 to N3?