-
-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide PATCH API call for scaffolded (users) API #112
Comments
Yeah, so I had a patch at one point but it was adding a lot of overhead and complexity. It was partially due to the implementation using Patchdoc which has a few gaps still. I might add something in as an alternative but would need to figure out a good convention for it apart from patchdoc. If you have any thoughts on a good common structure feel free to toss it up for consideration. |
Fwiw on users though, there wouldn't be the password use case like this since we're not working with an IDP in the boundary or managing passwords here. With the scaffolded setup that is. But point stands on coming up with a potential patch option |
Yes, I understand 🙂 . It's a lot like
Indeed, out of the box there are no passwords anyway, so it doesn't apply. Might still be useful to generate a |
FWIW for the time being I followed something like https://overflow.adminforge.de/questions/72910769/placeholder to differentiate between fields not being present and null in DTOs. It's kind of weird now, though, since it not only applies to the DTO, but also to the Another idea was to have a wrapper type using generics such as It's probably possible to let the Other ideas I had might involve auto-generating one DTO based on the other, but removing |
When scaffolding users, you get a bunch of common API calls, but
PATCH
seems to be missing:For my use case specifically, I'm extending users to support local user management in a first phase of a project, so fields such as the (new) plain text password cannot be repeated every time, only when it needs to be updated, at which point it is hashed and permanently discarded.
Ideally a
PATCH API call would exist similar to the
PUTone that allows omitting fields if they don't need to be changed, and fields that are explicitly set (
null` or otherwise) will only be written to.This might also apply to scaffolded API calls for entities in general, but I noticed it specifically for users.
(I haven't tested yet if
PUT
supports this behaviour, but even if it does, typically both are separate actions in RESTful APIs which shouldn't be conflated.)Not a biggy, as it is straightforward to add, but just wanted to mention it.
The text was updated successfully, but these errors were encountered: