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

fix: remove unnecessary fields in PATCH #238

Merged
merged 1 commit into from
Oct 23, 2024
Merged

Conversation

tensor5
Copy link
Contributor

@tensor5 tensor5 commented Oct 22, 2024

Elements in the codeHosting array contain fields such as createdAt and updatedAt.

Elements in the codeHosting array contain fields such as `createdAt`
and `updatedAt`.
@tensor5
Copy link
Contributor Author

tensor5 commented Oct 22, 2024

@tensor5 tensor5 requested a review from bfabio October 22, 2024 14:37
@tensor5 tensor5 merged commit 48dfce9 into master Oct 23, 2024
3 checks passed
@tensor5 tensor5 deleted the clean-codehosting branch October 23, 2024 13:00
@bfabio
Copy link
Member

bfabio commented Oct 23, 2024

This will turn all codeHostings to group = true when issuing a PATCH request, as it's the default value if group is missing, even if it was previously false (PATCH /publishers documentation).

JSON Merge Patch doesn't deep merge arrays, so the correct way to do it is to resend group as well. I would set group = true for the codeHosting being onboarded as well, for good measure and to be explicit. I can't remember if there are tests in the API checking that a PATCHed Publisher with no group in a codeHosting sets it to true, but it's a good time to make sure.

Using JSON Patch would be nicer and less error prone, but unfortunately it's not yet implemented in the API for Publishers (italia/developers-italia-api#213).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants