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

How to hide TJsonOptions #12

Open
megatkurniawan opened this issue Feb 14, 2025 · 2 comments
Open

How to hide TJsonOptions #12

megatkurniawan opened this issue Feb 14, 2025 · 2 comments

Comments

@megatkurniawan
Copy link

if i request AsJson from class, then i will get json response with TJsonOption. how to remove it?

{ "id": "6", "data": "Test" "options": [ "joDateIsUTC", "joDateFormatISO8601" ] }

@jasonjac2
Copy link

+1 on this. Novice with the classes, used once, got this tagged on the end, hand built other results due to this.

@megatkurniawan
Copy link
Author

megatkurniawan commented Feb 14, 2025

need send json to client server which should not have any fields other than those specified.
so currently I am using this method.

var JSONObject: TJSONObject;
begin
JSONObject := TJSONObject.ParseJSONValue(JSonString) as TJSONObject;
try
JSONObject.RemovePair('options');
Result := JSONObject.ToString;
finally
JSONObject.Free;
end;
end;

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

No branches or pull requests

2 participants