Using PUT in a CRUD Endpoint, does not work because of failing validations.
for Example:
PUT .../dummy(someGUID)
Body:
{
"id": "someGUID",
"type": "someEnum"
};
Enum1 = (someEnum0, someEnum1);
Enum2 = (anotherEnum2, anotherEnum3);
TDummy = class
private
FID: TGUID;
FType: Enum1;
FType2: Enum2;
...
end;
OnValidate(args...)
if (FType = someEnum) and (FType2 = anotherEnum2) then
Result.Errors.Add...
Would fail, if there is an OnValidate implemented, checking if type fits type2.
In this example FType2 is anotherEnum3, but because of not providing this, it will stay first value (anotherEnum2) and validation will fail
If I provide FType2, as is from previous get everything works fine, but I think Put should be used only providing properties that should be changed...
(at least it feels a little bit strange, providing same ids within URL and Body...)...
But this would be necessary, if you'd like to update corresponding ManyValuedAssocs...
Is there any way to manage, that validations would work for partially fetched (or provided) Entities?