Skip to content

Support 409 for PATCH requests. #312

Open
@elenacanovi

Description

@elenacanovi

As per the RFC specification (https://tools.ietf.org/html/rfc5789#section-2.2), PATCH requests should be able to return 409 in the cases of conflicting state or concurrent modification (my use case btw). However, if I understand correctly the decision graph, this possibility is currently not supported by Liberator if method-patch? is true.

As a possible solution, I tried to add a new decision called patch-to-existing? to replace method-patch? in the false branch of method-delete? and moved method-patch? to the false branch of conflict?. If method-patch? is true then the path leads to patch!, otherwise it leads to method-post? from where the old behaviour is recovered.

I committed this variant to my fork here: elenacanovi@87dc3e5.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions