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

use " to surround value.tostring #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

childe
Copy link

@childe childe commented Dec 15, 2015

if value is a datetime object, JSONValue.toJSONString({"now": datetimeinstance}) will get invalid json string.

@jredfox
Copy link

jredfox commented Mar 5, 2019

json maps are for primitive values only. the are for serialization not storing date objects to and from the disk directly getting stored into the json that simply doesn't happen.

this issue should get closed as invalid. inputting an object that isn't primitive into a json should result in object.toString() when storing it in memory and nothing more. You found an issue that I also ran into but, it's not the one you think it was

@childe
Copy link
Author

childe commented Mar 5, 2019

@jredfox I think I do the right thing. If the object is not int/float/bool/null/map/array/... , it should call toString() and be surrounded by double quote.

@jredfox
Copy link

jredfox commented Mar 5, 2019

no because then everything is a string and if everything is a string then it's not a parser it's a string. Suggestion close issue. Your format is invalid json and still wouldn't support what you wanted. That would be something like gjson which isn't this library it's json only and by the way it's not double quotes either it needs to parse the entire object to and from json

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 this pull request may close these issues.

2 participants