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

Add utility to support json serialization/deserialization with JSONBigInt #57

Open
bhufmann opened this issue Mar 30, 2022 · 3 comments · May be fixed by #56
Open

Add utility to support json serialization/deserialization with JSONBigInt #57

bhufmann opened this issue Mar 30, 2022 · 3 comments · May be fixed by #56

Comments

@bhufmann
Copy link
Collaborator

The deserialization of TSP JSON strings to class objects that contains bigint fields are done using searialization and a so called Normalizer. This make sure that for example, timestamps are deserialized as bitint and not Number if they are small values.

It would be good to provide a utility that supports this for non-TSP classes.

bhufmann added a commit to bhufmann/tsp-typescript-client that referenced this issue Mar 30, 2022
@marco-miller
Copy link
Contributor

@bhufmann, may we close this issue, told as having been fixed by this commit?

@bhufmann
Copy link
Collaborator Author

@bhufmann, may we close this issue, told as having been fixed by this commit?

That commit is still in my fork of the repository and hasn't been mainlined. Re-opening this Issue.

@bhufmann bhufmann reopened this Jun 16, 2022
@marco-miller
Copy link
Contributor

@bhufmann, may we close this issue, told as having been fixed by this commit?

That commit is still in my fork of the repository and hasn't been mainlined. Re-opening this Issue.

Thanks, didn't notice the fork branch; sorry for the hassle. Noted.

@marco-miller marco-miller changed the title Add utility to support json serializtion/deserialization with JSONBigInt Add utility to support json serialization/deserialization with JSONBigInt Aug 17, 2022
bhufmann added a commit to bhufmann/tsp-typescript-client that referenced this issue Jan 13, 2023
bhufmann added a commit to bhufmann/tsp-typescript-client that referenced this issue Jun 20, 2023
bhufmann added a commit to bhufmann/tsp-typescript-client that referenced this issue Jun 20, 2023
bhufmann added a commit to bhufmann/tsp-typescript-client that referenced this issue Aug 21, 2023
bhufmann added a commit to bhufmann/tsp-typescript-client that referenced this issue Feb 13, 2025
@bhufmann bhufmann linked a pull request Feb 13, 2025 that will close this issue
1 task
bhufmann added a commit to bhufmann/tsp-typescript-client that referenced this issue Feb 13, 2025
bhufmann added a commit to bhufmann/tsp-typescript-client that referenced this issue Feb 13, 2025
bhufmann added a commit to bhufmann/tsp-typescript-client that referenced this issue Feb 19, 2025
fixes eclipse-cdt-cloud#57

Example Usages:

// Usage with normalizer
import { Experiment } from
'tsp-typescript-client/lib/models/experiment';
let input = JSONBigUtils.stringify(experiment);
let output: Experiment = JSONBigUtils.parse(input, Experiment);

// Usage no normalizer
input = JSONBigUtils.stringify(inputObj);
output = JSONBigUtils.parse<string>(input);
input = JSONBigUtils.stringify(BigInt("1234567890123456789"));
output = JSONBigUtils.parse<bigint>(bigIntInput);

Signed-off-by: Bernd Hufmann <[email protected]>
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

Successfully merging a pull request may close this issue.

2 participants