Skip to content

Support JSON and JSONC catalog files. #2409

@wfouche

Description

@wfouche

JSONC is JSON extended for use as a configuration data file format. Comments are useful in configuration files, and also allow for sections of the config to be commented out to temporarily or permanently disable parts of the configuration.

JSONC is supported by IntelliJ and VSCode.

Example JSONC file.

{
  // This is a comment
  "name": "Project",
  "version": "1.0.0"   // Another comment
  "settings": {
    "enabled": true
  }
}

Comments can be added to jbang-catalog.json files because the gson parser silently ignores comments by default. Howver, the only remaining issue is that VSCode and IntelliJ displays formatting errors if comments are included in a JSON file.

Image

Renaming the file to jbang-catalog.jsonc resolves this issue.

Image

Only one of the catalog files should exist: either jbang-catalog.json or jbang-catalog.jsonc, but not both.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions