google / json5format

JSON5 (a.k.a., "JSON for Humans") formatter that preserves contextual comments

Home Page:https://crates.io/crates/json5format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement a JSON5 with Comments representation in JSON

richkadel opened this issue · comments

I have a design document that describes how one might generate a pure JSON document that includes a loss-less representation of the JSON5 data and it's comments, including all metadata currently implemented in the json5format API to reconstitute the comments with intended relationships and formatting constraints.

This could be used to feed a JSON5 document to a JSON tool, manipulate the content, and reconstitute the JSON5 without losing any context, associations, or dependencies.

Ideally, JSON5-specific extensions for primitive value formats would be handled by converting the JSON5 string representation of the value to a JSON-native representation, and adding metadata to save the original format.