{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/programmes-net/json-schema/programmes-net-jsonc-format-schema.json",
  "title": "jsonc.format",
  "description": "Re-print JSON / JSON5 / JSONC tidily as JSONC or JSON5, keeping comments.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/programmes-net-converters-api-openapi.yml#/components/schemas/jsonc.format",
  "type": "object",
  "properties": {
    "operation": {
      "const": "format"
    },
    "input": {
      "type": "string",
      "description": "JSON5, JSONC or JSON text.",
      "maxLength": 32768
    },
    "options": {
      "type": "object",
      "properties": {
        "style": {
          "type": "string",
          "description": "jsonc = double quotes; json5 = unquoted keys and single quotes.",
          "enum": [
            "jsonc",
            "json5"
          ],
          "default": "jsonc"
        },
        "trailingCommas": {
          "type": "boolean",
          "description": "Add trailing commas.",
          "default": false
        },
        "keepComments": {
          "type": "boolean",
          "description": "Keep comments.",
          "default": true
        },
        "indent": {
          "type": "integer",
          "description": "Spaces per level.",
          "minimum": 0,
          "maximum": 8,
          "default": 2
        }
      }
    }
  },
  "required": [
    "operation"
  ]
}