JSONH (JSON for Humans) screenshot 1
J

Publisher

joyless

JSONH (JSON for Humans)

Tools
JSON Syntax Parsing GDExtension Comments Multiline Human-readable Compatibility

JSON for Humans in GDExtension for Godot. JSON is great. Until you miss that trailing comma... or want to use comments. What about multiline strings? JSONH provides a much more elegant way to write JSON that's designed for humans rather than machines. Since JSONH is compatible with JSON, any JSONH syntax can be represented with equivalent JSON. JsonhGdextension is an implementation of JSONH v1 for GDExtension using JsonhCpp. Also see the JSONH highlighter for VSCode: https://github.com/jsonh-...

Godot Asset Library

JSON for Humans.

JSON is great. Until you miss that trailing comma... or want to use comments. What about multiline strings? JSONH provides a much more elegant way to write JSON that's designed for humans rather than machines.

Since JSONH is compatible with JSON, any JSONH syntax can be represented with equivalent JSON.

JsonhGdextension

JsonhGdextension is a parser implementation of JSONH v1 for GDExtension using JsonhCpp.

Example

{
    // use #, // or /**/ comments
    
    // quotes are optional
    keys: without quotes,

    // commas are optional
    isn\'t: {
        that: cool? # yes
    }

    // use multiline strings
    haiku: '''
        Let me die in spring
          beneath the cherry blossoms
            while the moon is full.
        '''
    
    // compatible with JSON5
    key: 0xDEADCAFE

    // or use JSON
    "old school": 1337
}

Usage

Everything you need is contained within Jsonh:

var jsonh:String = "[hello, world]"
var value:Variant = Jsonh.parse_element(jsonh).value
print(value) # ["hello", "world"]

Dependencies

Limitations

Limited API

Due to the limitations of GDExtension and GDScript, only one static method (Jsonh.parse_element) is exposed.