silkapp/rest

Support for PATCH

Philonous opened this issue · 6 comments

As far as I can see, rest-core does not support PATCH-ing resources. Is this intentional? Could it be implemented in the future?

This is just because we haven't needed it yet. Do you have good use case, and/or an implementation in mind?

Had a discussion with @hesselink and we could use this. for a User resource you could then PUT { name :: Text, email :: Text, [..] }, or PATCH with { name :: Maybe Text, email :: Maybe Text, [...] }.

I'm guessing this can be implemented exactly as update.

Any updates on this?

I would like to add a rest implementation of the todobackend to my todobackend-haskell project. Unfortunately this requires PATCH methods.

That sounds like a good use case! How should the PATCH method work in this case? We haven't done anything about this since we haven't needed it ourselves, but given a good description of how it should work (or even a pull request) I think it would fit in pretty well.

It has been a while since I used rest the last time. So I'll need check it out again and come back with my thoughts then :)

I'm not sure if I would be able to implement it, though. Maybe with a bit of guidance it could work... We'll see.

I'd be happy to help implement it or even implement it myself. I just meant to say I'd need some use case or design to drive it, I guess. So if you're at a point where you can say: "I have this, and now I'd want PATCH because without it I can't ..." that would be very useful.