callum-oakley / json5-rs

A Rust JSON5 serializer and deserializer which speaks Serde.
ISC License
184 stars 23 forks source link

A value type to hold arbitrary JSON5 #3

Closed callum-oakley closed 5 years ago

callum-oakley commented 5 years ago

We should provide a value type in the style of serde_json's.

Prerequisite for #2.

zonyitoo commented 5 years ago

What's the status of this issue?

callum-oakley commented 5 years ago

Not started, but will try and find the time to take a look at it in the next few days. Thanks for the reminder!

callum-oakley commented 5 years ago

@vdonich alerted me to the fact that serde_json::Value works perfectly well with json5, what with serde being interoperable and all.

For example, something like this seems to work absolutely fine:

let value = json5::from_str::<serde_json::Value>(&buffer);

I would still like to address #2 so we can write json5 in a macro, but assuming nobody finds any issues with deserialising in to serde_json::Value I think this issue can probably be closed. (@zonyitoo pinging you in case this is still relevant, I realise it was a while ago!)