-
Notifications
You must be signed in to change notification settings - Fork 624
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
JSON5 support #797
Comments
Side note: trailing commas and unquoted literals are now somewhat supported by |
Side note: IntelliJ has native support (e.g. syntax highlighting) for Json5 (link), which would make this a cool feature for Android developers especially |
now How is it going ? |
I'm also interested in this. For now, I've converted an existing JSON5 Java library to Kotlin and added some Kotlinx Serialization interop, so it can convert to/from JSON5/JSON. Please let me know if it's useful, and you're able to help make it more stable (I haven't tested it significantly) |
Hi, any news about that ? {
/*
* The day when players will be able to do damage to themselves. default -> 2
*/
"dayOfAuthorizationOfThePvP": 2,
/*
* The day when players can get into the nether. default -> 4
*/
"dayOfAuthorizationOfTheEntryInTheNether": 4,
/*
* If players can use enderpearl to assault bases or not
*/
"allowEnderPearlAssault": false
} error
|
I don't think we'll embed JSON5 standard into our implementation. Current policy for format requests is 'write your own 3rd party lib with dependency on the core' |
I was faced with the need to deserialize JSON5 combined with a few additional requirements (such as full support for polymorphic types and error messages that can be exposed to the end user). To meet these requirements, I created the json5k library. Feel free to take a look at it if you are in a similar situation. Due to the fact that JSON5 is a superset of JSON, the library might also be suitable if you need to deserialize JSON files with trailing commas (#1812). In this case, however, you might be unable to reject inputs that violate other portions of the original JSON specification. |
Thank you very much, I think that's what I need |
For me trailing commas are throwing an error. What exactly does "somewhat" mean and is there a way to disable that check? I tried out the json5k library and it seems to be great, but unfortunately it doesn't support iOS multiplatform targets. |
@ubuntudroid I've rechecked now — no, there's no way to disable trailing comma check even in lenient mode |
Alright, thanks for checking so quickly anyway! 🙏 |
I can't parse API of this site cuz this library doesn't support trailing comma: https://developers.home-assistant.io/docs/intent_conversation_api/#response_types |
This parser still doesn't support single-quoted strings in JSON5 maybe it can be reopend |
Yes, we decided not to support single/double quotes for now, this is something for future improvement if there is a demand for it. |
What is your use-case and why do you need this feature?
It would be nice to have JSON5 support to serialize/deserialize configs and other data files that may be written/read by humans. It has quite useful features:
Describe the solution you'd like
Well, pretty much the same as for JSON but form JSON5. I don't know what else to say here. All details on the format are on json5.org
The text was updated successfully, but these errors were encountered: