Skip to content

Much ado about nothing, aka nil #7

Open
@alerque

Description

@alerque

All the reference fixtures in JSON format show some properties as having null values. Lua of course handles nil a bit differently than some languages. For the purposes of comparing fixtures when I load the JSON into a Lua table everything works out fine because the nulls load as nils and the comparison works okay. However trying to get JSON output that matches is a bit more difficult. For external comparison I'm currently stripping the null's usig jq:

walk( if type == "object" then with_entries(select(.value != null)) else . end)

...but that's a hack.

Should we be using a custom null value in our AST internally so we can match what other implementations have? Or is Lua's nil handling going to suffice?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions