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

js: ColumnType.Json serialization/deserialization, arbitrary object serialization #136

Open
H-Plus-Time opened this issue Jun 24, 2021 · 1 comment

Comments

@H-Plus-Time
Copy link

At the moment, supplying a feature with compound-typed properties (arrays, objects) throws an error on serialize (and deserialize, if coming from an implementation with json support). My workaround has been to use typeof value === "object" in valueToType, and JSON.stringify and JSON.parse in buildFeature, parseProperties respectively.

Is this pretty much the direction the Json column type is heading in, similar to geobuf's handling of any non-primitive types (aside from datetimes)?

@bjornharrtell bjornharrtell self-assigned this Jun 24, 2021
@bjornharrtell
Copy link
Member

@H-Plus-Time yes the intention of the json column type is that it is simply a string but should (de)serialize into/from an object where possible (assuming the object can be represented as json). Looks like we could improve the TS implementation to do this by default.

@bjornharrtell bjornharrtell removed their assignment May 1, 2024
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