Skip to content

Serialization of primitive properties #38

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

Closed
ftomassetti opened this issue Feb 6, 2023 · 5 comments
Closed

Serialization of primitive properties #38

ftomassetti opened this issue Feb 6, 2023 · 5 comments
Labels
question Further information is requested

Comments

@ftomassetti
Copy link
Contributor

While working on serialization I noticed that some property values (in particular boolean properties) are serialized as JSON booleans (e.g., true or false). My understanding is that all property values should be serialized as strings (e.g., "true" or "false"), so when copying https://github.com/LIonWeb-org/lioncore-typescript/blob/main/models/library.json into the lioncore-java repository I have changed those values.

I am opening the issue to discuss how to converge on this point.

@dslmeinte
Copy link
Contributor

Let's discuss on Wednesday.

@dslmeinte dslmeinte added the question Further information is requested label Feb 7, 2023
@dslmeinte
Copy link
Contributor

Result: yes, all primitive values should be serialized as strings (including JSON).

dslmeinte added a commit that referenced this issue Feb 9, 2023
@dslmeinte
Copy link
Contributor

fixed by commit 45c8912

@enikao
Copy link
Contributor

enikao commented Feb 9, 2023

Is there anything from your discussion to add to LionWeb-io/specification#34, especially regarding rationale?

@dslmeinte
Copy link
Contributor

It seems not. Maybe the biggest thing is that JSON is to be JSON.stringify-d at serialization and then JSON.parse-d at deserialization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants