{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codefmt-dev/json-schema/codefmt-dev-format-request-schema.json",
  "title": "FormatRequest",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codefmt-dev-openapi.yml#/components/schemas/FormatRequest",
  "type": "object",
  "required": [
    "code",
    "platform",
    "formatOptions",
    "lintOptions"
  ],
  "properties": {
    "code": {
      "type": "string",
      "minLength": 1,
      "maxLength": 51200,
      "description": "Source to format (≤50KB)."
    },
    "platform": {
      "$ref": "#/$defs/Platform"
    },
    "formatOptions": {
      "$ref": "#/$defs/JsFormatOptions"
    },
    "lintOptions": {
      "$ref": "#/$defs/JsLintOptions"
    },
    "hublFormatOptions": {
      "$ref": "#/$defs/HublFormatOptions"
    },
    "pythonFormatOptions": {
      "$ref": "#/$defs/PythonFormatOptions"
    },
    "pythonLintOptions": {
      "$ref": "#/$defs/PythonLintOptions"
    },
    "platformVariants": {
      "$ref": "#/$defs/PlatformVariants"
    },
    "lintOnly": {
      "type": "boolean",
      "description": "Skip formatting, return diagnostics only."
    },
    "contentHint": {
      "type": "string",
      "enum": [
        "css",
        "html",
        "js"
      ],
      "description": "HubL path only: what a buffer with no HubL in it is. Any {{ }} or {% %} still routes it to the HubL engine."
    },
    "language": {
      "type": "string",
      "description": "Shorthand for platformVariants.language, the field MCP format_code takes: \"javascript\" or \"python\" (js and py are read the same way; typescript, ts and tsx read as javascript and turn on TypeScript parsing on pipedream). Used only when platformVariants is absent, which wins when both are sent; any other value is ignored, and python is ignored on hubl, which has no python runtime. Whenever it is not applied, the warnings member of the response says so."
    },
    "applyFixes": {
      "type": "string",
      "enum": [
        "safe",
        "unsafe"
      ],
      "description": "Apply lint fixes, not only formatting: Biome's fixes on JavaScript/TypeScript ('unsafe' adds behaviour-changing ones), HubL's fixes on HubL. Python ignores it."
    }
  },
  "$defs": {
    "HublFormatOptions": {
      "type": "object",
      "required": [
        "tabWidth",
        "printWidth",
        "quoteStyle",
        "htmlIndentation",
        "blankLineBetweenBlocks",
        "singleLineBlocks",
        "preserveWhitespaceControl"
      ],
      "properties": {
        "tabWidth": {
          "type": "integer",
          "enum": [
            2,
            4,
            6,
            8
          ]
        },
        "printWidth": {
          "type": "integer",
          "minimum": 40,
          "maximum": 200
        },
        "quoteStyle": {
          "type": "string",
          "enum": [
            "double",
            "single"
          ]
        },
        "htmlIndentation": {
          "type": "boolean"
        },
        "blankLineBetweenBlocks": {
          "type": "boolean"
        },
        "singleLineBlocks": {
          "type": "boolean"
        },
        "preserveWhitespaceControl": {
          "type": "boolean"
        },
        "lintEnabled": {
          "type": "boolean"
        },
        "disabledRuleCategories": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "correctness",
              "semantic",
              "inheritance",
              "deprecation",
              "module-shape",
              "hint"
            ]
          }
        },
        "unknownFilterSeverity": {
          "type": "string",
          "enum": [
            "off",
            "info",
            "warning",
            "error"
          ]
        },
        "unknownGlobalSeverity": {
          "type": "string",
          "enum": [
            "off",
            "info",
            "warning",
            "error"
          ]
        },
        "unknownFunctionSeverity": {
          "type": "string",
          "enum": [
            "off",
            "info",
            "warning",
            "error"
          ]
        }
      }
    },
    "JsFormatOptions": {
      "type": "object",
      "required": [
        "printWidth",
        "tabWidth",
        "useTabs",
        "endOfLine",
        "semicolons",
        "quoteStyle",
        "trailingCommas",
        "bracketSpacing",
        "arrowParens",
        "singleAttributePerLine",
        "objectWrap"
      ],
      "properties": {
        "printWidth": {
          "type": "integer",
          "minimum": 40,
          "maximum": 200
        },
        "tabWidth": {
          "type": "integer",
          "enum": [
            2,
            4
          ]
        },
        "useTabs": {
          "type": "boolean"
        },
        "endOfLine": {
          "type": "string",
          "enum": [
            "lf",
            "crlf",
            "auto"
          ]
        },
        "semicolons": {
          "type": "boolean"
        },
        "quoteStyle": {
          "type": "string",
          "enum": [
            "double",
            "single"
          ]
        },
        "trailingCommas": {
          "type": "string",
          "enum": [
            "all",
            "es5",
            "none"
          ]
        },
        "bracketSpacing": {
          "type": "boolean"
        },
        "arrowParens": {
          "type": "string",
          "enum": [
            "always",
            "avoid"
          ]
        },
        "singleAttributePerLine": {
          "type": "boolean"
        },
        "objectWrap": {
          "type": "string",
          "enum": [
            "preserve",
            "collapse",
            "always"
          ]
        },
        "quoteProperties": {
          "type": "string",
          "enum": [
            "as-needed",
            "preserve"
          ],
          "default": "as-needed"
        },
        "jsxQuoteStyle": {
          "type": "string",
          "enum": [
            "double",
            "single"
          ],
          "default": "double"
        },
        "bracketSameLine": {
          "type": "boolean",
          "default": false
        },
        "organizeImports": {
          "type": "boolean",
          "default": false
        }
      }
    },
    "JsLintOptions": {
      "type": "object",
      "required": [
        "enabled",
        "severity",
        "typescriptPlugin",
        "reactPlugin",
        "unicornPlugin",
        "promisePlugin",
        "nodePlugin",
        "securityPlugin",
        "perfCategory",
        "noConsole"
      ],
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "severity": {
          "type": "string",
          "enum": [
            "default",
            "warn",
            "error"
          ]
        },
        "typescriptPlugin": {
          "type": "boolean"
        },
        "reactPlugin": {
          "type": "boolean"
        },
        "unicornPlugin": {
          "type": "boolean"
        },
        "promisePlugin": {
          "type": "boolean"
        },
        "nodePlugin": {
          "type": "boolean"
        },
        "securityPlugin": {
          "type": "boolean"
        },
        "perfCategory": {
          "type": "boolean"
        },
        "noConsole": {
          "type": "boolean"
        }
      }
    },
    "Language": {
      "type": "string",
      "enum": [
        "javascript",
        "python"
      ]
    },
    "Platform": {
      "type": "string",
      "enum": [
        "zapier",
        "n8n",
        "pipedream",
        "make",
        "hubspot",
        "hubl"
      ]
    },
    "PlatformVariants": {
      "type": "object",
      "required": [
        "n8nMode",
        "pipedreamType",
        "hubspotStyle",
        "language"
      ],
      "properties": {
        "n8nMode": {
          "type": "string",
          "enum": [
            "allItems",
            "eachItem"
          ]
        },
        "pipedreamType": {
          "type": "string",
          "enum": [
            "action",
            "source",
            "codeStep"
          ],
          "description": "`codeStep` is a deprecated alias for `action` (legacy extension clients); it is coerced to `action` server-side."
        },
        "makeModuleType": {
          "type": "string",
          "enum": [
            "action",
            "search",
            "trigger",
            "aggregator"
          ],
          "description": "Legacy field: accepted for back-compat but ignored server-side."
        },
        "hubspotStyle": {
          "type": "string",
          "enum": [
            "callback",
            "return"
          ]
        },
        "language": {
          "$ref": "#/$defs/Language"
        }
      }
    },
    "PythonFormatOptions": {
      "type": "object",
      "required": [
        "lineLength",
        "indentWidth",
        "quoteStyle",
        "lineEnding",
        "magicTrailingComma"
      ],
      "properties": {
        "lineLength": {
          "type": "integer",
          "minimum": 40,
          "maximum": 200
        },
        "indentWidth": {
          "type": "integer",
          "enum": [
            2,
            4
          ]
        },
        "quoteStyle": {
          "type": "string",
          "enum": [
            "double",
            "single"
          ]
        },
        "lineEnding": {
          "type": "string",
          "enum": [
            "lf",
            "crlf",
            "auto"
          ]
        },
        "magicTrailingComma": {
          "type": "boolean"
        },
        "pythonTarget": {
          "type": "string",
          "enum": [
            "py37",
            "py38",
            "py39",
            "py310",
            "py311",
            "py312",
            "py313"
          ],
          "description": "Target Python version. Clamped to the platform's real runtime when it is newer."
        }
      }
    },
    "PythonLintOptions": {
      "type": "object",
      "required": [
        "enabled",
        "pyflakes",
        "pycodestyle",
        "pycodestyleWarnings",
        "isort",
        "naming",
        "pyupgrade",
        "bugbear",
        "security",
        "comprehensions",
        "simplify",
        "ruff"
      ],
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "pyflakes": {
          "type": "boolean"
        },
        "pycodestyle": {
          "type": "boolean"
        },
        "pycodestyleWarnings": {
          "type": "boolean"
        },
        "isort": {
          "type": "boolean"
        },
        "naming": {
          "type": "boolean"
        },
        "pyupgrade": {
          "type": "boolean"
        },
        "bugbear": {
          "type": "boolean"
        },
        "security": {
          "type": "boolean"
        },
        "comprehensions": {
          "type": "boolean"
        },
        "simplify": {
          "type": "boolean"
        },
        "ruff": {
          "type": "boolean"
        }
      }
    }
  }
}