Closed bglamadrid closed 1 year ago
hi @bglamadrid,
May I know the exact endpoints?
Hello @NyorJa
This involves all endpoints beginning with /data/
that have a PUT
method, e.g.
PUT /data/customers
PUT /data/products
PUT /data/sales
And so on.
I made a related issue on this matter on the repo of the API.
When said API gets an update including the feature, the resolution of this issue should go hand-in-hand with that, too 🦾
@Valid annotation works on my end in the controller but I have challenges in setting up the unit test like an integration test
@Valid annotation works on my end in the controller but I have challenges in setting up the unit test like an integration test
That isn't really related to this issue though? And what do you mean by doing integration tests? How did you come up with the need to do some?
I'm trying to run a @WebMVCTest in the controller class and I am encountering an error.
Build context
Project version
v0.1.0
Latest commits
https://github.com/trebol-ecommerce/trebol-backend-monolith/commit/8474c7264b741d68f434be7167a2718006cf2486
Summary
How to Reproduce
Call any
PUT
endpoint from the REST API exposed by this backend, sending a partial object from the one expected by the API. e.g. if it's aPerson
type of data and you have a registry with anidNumber
set to1
, send it like this:It will only update the
firstName
in the existing registry.Expected behavior
It should reject the object, as it only partially contains the required data. A
PUT
request should only accept entire valid objects and only then should update any matches.Additional context
The current behavior should be kept for later; as the Trébol API will eventually expose both
PUT
andPATCH
methods.Also, when this issue gets fixed, #226 should be resolved and merged too;
PUT
methods will require to annotate the request body for each endpoint with@Valid
.