Skip to content

Add support for exporting with indentation#9

Open
fm2003 wants to merge 1 commit into
mlochbaum:masterfrom
fm2003:master
Open

Add support for exporting with indentation#9
fm2003 wants to merge 1 commit into
mlochbaum:masterfrom
fm2003:master

Conversation

@fm2003

@fm2003 fm2003 commented Jun 12, 2026

Copy link
Copy Markdown

The current version of json.bqn only supports exporting in a "compact" format:

{"k1":{"sub":10},"k2":20,"k3":[30,40,50]}

This PR adds support for "pretty-printing" the JSON export (i.e. adding line breaks, indentation, and spaces after ':'):

{
    "k1": {
        "sub": 10
    },
    "k2": 20,
    "k3": [
        30,
        40,
        50
    ]
}

The functionality is inspired by dumps from Python's json module (including its limitations, such as not being able change formatting behaviour between objects and lists).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant