how could the service do what crud does when using the PATCH, update only the json fields?
I guess:
- Load the current object state using the object ID
- Manualy or with RTTI update the object Fields/Properties that match the Json fields you have at hand
- Flush the changes
Maybe someone may came up with an RTTI code ilustrating how to 'automate' the update of the proper object Fields from JSON.
Regards,
1 Like
how do i read the json that is in the body?
You can define your input parameter as TJSONObject
:
procedure TMyService.DoSomething(Json: TJSONObject);
begin
// your implementation reading Json
end;
1 Like
This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.