Skip to content

Possible mismatch between ID in URL and Patch body #702

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

Closed
bart-degreed opened this issue Mar 4, 2020 · 1 comment · Fixed by #731
Closed

Possible mismatch between ID in URL and Patch body #702

bart-degreed opened this issue Mar 4, 2020 · 1 comment · Fixed by #731

Comments

@bart-degreed
Copy link
Contributor

JADNC ignores any ID value in a request URL (for example: /api/v2/people/123) when using the PATCH verb. It only uses the value from the request body.

I think we should assert that both are equivalent and fail on mismatch in DefaultResourceService.UpdateAsync().

Also, it looks like the signature of DefaultResourceRepository.UpdateAsync was changed from:

public virtual async Task<TResource> UpdateAsync(TId id, TEntity updatedEntity)

to:

public virtual async Task<TResource> UpdateAsync(TResource updatedEntity)

during development of v4. This makes it impossible to change the ID of a resource, so I think this change should be reverted.

@bart-degreed
Copy link
Contributor Author

I think we should assert that both are equivalent and fail on mismatch in DefaultResourceService.UpdateAsync().

Discussed offline with @maurei. This is best solved at the formatters layer (JsonApiReader)

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

Successfully merging a pull request may close this issue.

1 participant