Skip to content
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

Implement application/merge-patch+json elegantly #173

Closed
bfabio opened this issue Oct 12, 2022 · 0 comments · Fixed by #210
Closed

Implement application/merge-patch+json elegantly #173

bfabio opened this issue Oct 12, 2022 · 0 comments · Fixed by #210
Labels
enhancement New feature or request

Comments

@bfabio
Copy link
Member

bfabio commented Oct 12, 2022

The handling of application/merge-patch+json is quite manual, in part because of limitation in the ORM, and probably doesn't implement correctly all the cases, but we can improve it.

Instead of doing what we do now, we should:

  1. Get the application/merge-patch+json payload and validate it
  2. Apply the merge patch to the current JSON representation of the patched resource (and its relationships), (fe. with https://github.com/evanphx/json-patch)
  3. Unserialize the result
  4. Have the ORM do the required operation to the database based on the unserialized result
@bfabio bfabio added the enhancement New feature or request label Oct 12, 2022
bfabio added a commit to bfabio/developers-italia-api that referenced this issue Aug 24, 2023
bfabio added a commit to bfabio/developers-italia-api that referenced this issue Sep 5, 2023
@bfabio bfabio mentioned this issue Sep 5, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant