-
Notifications
You must be signed in to change notification settings - Fork 577
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
Invalid JSON created when setting a field to a string value like '000296'. #736
Comments
So this is tied to this issue: #719 So i'm not sure how to fix this besides moving the "vehicle name" property to under the "properties" object. But i'm not sure if i can do that as that object is currently inserted as a POINT and performance is critical. Thoughts? |
I'm just going to prepend the field value with |
This commit fixes an issue where fields with floating points that have zero prefixes and underscores are being parsed as numbers. Now those are treated as string values. See #736
I just pushed an update that will ensure that a numeric field value conforms to JSON. |
Describe the bug
When the OUTPUT is set to JSON and a field was set to a string value like
'000296'
. The tile38 serializer will automatically convert the field into a number and try and output000296
. This is invalid json though because you cannot have leading 0's in numbers according to the JSON spec. This creates errors with many of the client libraries that utilizeJSON.parse()
(i'm using tile38-ts).To Reproduce
'000296'
Expected behavior
Strip leading zeros when converting it to a number?
Logs
Tile38Error: Unexpected number in JSON at position 14454
Operating System (please complete the following information):
Additional context
I can fix in insertion handler, but invalid JSON should not be created either way...
The text was updated successfully, but these errors were encountered: