{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/speakeasy-workflow-file/latest.json",
  "title": "Speakeasy Workflow Schema",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/speakeasy-api/sdk-gen-config/main/schemas/workflow.schema.json",
    "sourceSha256": "7a63f43c12453fb6df11cbdda73d65876f8d4aadb0b56b18d11ec21b934dc559",
    "fileMatch": [
      "**/.speakeasy/workflow.yaml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "dependents": {
      "type": "object",
      "description": "A map of dependent names to dependent configurations, used to define external repositories and their locations",
      "additionalProperties": {
        "$ref": "#/$defs/WorkflowDependent"
      }
    },
    "sources": {
      "type": [
        "object",
        "null"
      ],
      "description": "A map of source names to source configurations, where the output is an OpenAPI document",
      "additionalProperties": {
        "$ref": "#/$defs/WorkflowSource"
      }
    },
    "speakeasyVersion": {
      "$ref": "#/$defs/WorkflowVersion",
      "description": "The version of the speakeasy CLI"
    },
    "targets": {
      "type": [
        "object",
        "null"
      ],
      "description": "A map of target names to target configurations, where the output is a speakeasy generation target",
      "additionalProperties": {
        "$ref": "#/$defs/WorkflowTarget"
      }
    },
    "workflowVersion": {
      "const": "1.0.0",
      "description": "The version of the workflow schema",
      "type": "string"
    }
  },
  "$defs": {
    "WorkflowAuth": {
      "type": "object",
      "description": "Authentication information for the document (optional)",
      "properties": {
        "authHeader": {
          "description": "A HTTP Header Name",
          "type": "string"
        },
        "authSecret": {
          "description": "A HTTP Header Value",
          "type": "string"
        }
      },
      "required": [
        "authHeader",
        "authSecret"
      ],
      "additionalProperties": false
    },
    "WorkflowCLI": {
      "properties": {
        "gpgPassPhrase": {
          "type": "string"
        },
        "gpgPrivateKey": {
          "type": "string"
        }
      },
      "required": [
        "gpgPrivateKey",
        "gpgPassPhrase"
      ],
      "type": "object"
    },
    "WorkflowCodeSamples": {
      "type": "object",
      "description": "Code samples configuration. See <https://www.speakeasy.com/guides/openapi/x-codesamples>",
      "properties": {
        "blocking": {
          "description": "Defaults to true. If false, code samples failures will not consider the workflow as failed",
          "type": [
            "null",
            "boolean"
          ]
        },
        "disabled": {
          "description": "Optional flag to disable code samples.",
          "type": [
            "null",
            "boolean"
          ]
        },
        "labelOverride": {
          "$ref": "#/$defs/WorkflowCodeSamplesLabelOverride",
          "description": "Optional label override for the code sample. Default is to use the operationId."
        },
        "langOverride": {
          "description": "Optional language override for the code sample. Default behavior is to auto-detect.",
          "type": [
            "null",
            "string"
          ]
        },
        "output": {
          "description": "The output file name",
          "type": "string"
        },
        "registry": {
          "$ref": "#/$defs/WorkflowSourceRegistry",
          "description": "The output registry location."
        },
        "style": {
          "description": "Optional style for the code sample, one of 'standard' or 'readme'. Default is 'standard'.",
          "type": [
            "null",
            "string"
          ]
        }
      },
      "additionalProperties": false
    },
    "WorkflowCodeSamplesLabelOverride": {
      "properties": {
        "fixedValue": {
          "description": "Optional fixed value for the label.",
          "type": [
            "null",
            "string"
          ]
        },
        "omit": {
          "description": "Optional flag to omit the label.",
          "type": [
            "null",
            "boolean"
          ]
        }
      },
      "type": "object"
    },
    "WorkflowDependent": {
      "type": "object",
      "description": "A dependent configuration for external repositories",
      "properties": {
        "cloneCommand": {
          "description": "Optional command to clone the repository",
          "type": "string"
        },
        "location": {
          "description": "The local path to the repository",
          "type": "string"
        }
      },
      "required": [
        "location"
      ],
      "additionalProperties": false
    },
    "WorkflowDeployment": {
      "type": "object",
      "description": "Gram deployment configuration for MCP servers. Presence of this block enables deployment.",
      "properties": {
        "project": {
          "description": "Gram project name. Defaults to Gram's authenticated org context.",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "WorkflowDocument": {
      "type": "object",
      "description": "A local or remote document.",
      "properties": {
        "authHeader": {
          "description": "A HTTP Header Name",
          "type": "string"
        },
        "authSecret": {
          "description": "A HTTP Header Value",
          "type": "string"
        },
        "location": {
          "description": "The location to resolve the document at. E.g. a file name, relative location, or a HTTP URL",
          "minLength": 1,
          "type": "string"
        },
        "modelNamespace": {
          "description": "The model namespace/group for component schemas (used when merging multiple documents)",
          "type": "string"
        }
      },
      "required": [
        "location"
      ],
      "additionalProperties": false
    },
    "WorkflowFallbackCodeSamples": {
      "properties": {
        "fallbackCodeSamplesLanguage": {
          "type": "string"
        }
      },
      "required": [
        "fallbackCodeSamplesLanguage"
      ],
      "type": "object"
    },
    "WorkflowFilterOperationsOptions": {
      "properties": {
        "exclude": {
          "description": "Exclude the specified operations (mutually exclusive with include)",
          "type": [
            "null",
            "boolean"
          ]
        },
        "include": {
          "description": "Include the specified operations (mutually exclusive with exclude)",
          "type": [
            "null",
            "boolean"
          ]
        },
        "operations": {
          "description": "Comma-separated list of operations to filter",
          "type": "string"
        }
      },
      "required": [
        "operations"
      ],
      "type": "object"
    },
    "WorkflowJava": {
      "type": "object",
      "properties": {
        "gpgPassPhrase": {
          "type": "string"
        },
        "gpgSecretKey": {
          "type": "string"
        },
        "ossrhPassword": {
          "type": "string"
        },
        "ossrhUsername": {
          "type": "string"
        },
        "useSonatypeLegacy": {
          "type": "boolean"
        }
      },
      "required": [
        "ossrhUsername",
        "ossrhPassword",
        "gpgSecretKey",
        "gpgPassPhrase",
        "useSonatypeLegacy"
      ],
      "additionalProperties": false
    },
    "WorkflowMCPRegistry": {
      "type": "object",
      "properties": {
        "auth": {
          "description": "Authentication method for the MCP Registry. Use 'github-oidc' (recommended, no token needed) for io.github.* namespaces in GitHub Actions, 'github' with a PAT, or 'dns' for custom domain namespaces.",
          "enum": [
            "github-oidc",
            "github",
            "dns"
          ],
          "type": "string"
        },
        "token": {
          "description": "Authentication token. Not needed for github-oidc. For github auth, a GitHub PAT with read:org and read:user scopes. For dns auth, the Ed25519 private key.",
          "type": "string"
        }
      },
      "required": [
        "auth"
      ],
      "additionalProperties": false
    },
    "WorkflowMockServer": {
      "type": "object",
      "properties": {
        "enabled": {
          "description": "Defaults to true. If false, the mock API server will not be started.",
          "type": [
            "null",
            "boolean"
          ]
        }
      },
      "additionalProperties": false
    },
    "WorkflowNPM": {
      "type": "object",
      "properties": {
        "token": {
          "type": "string"
        }
      },
      "required": [
        "token"
      ],
      "additionalProperties": false
    },
    "WorkflowNormalizeOptions": {
      "properties": {
        "prefixItems": {
          "type": [
            "null",
            "boolean"
          ]
        }
      },
      "type": "object"
    },
    "WorkflowNuget": {
      "type": "object",
      "properties": {
        "apiKey": {
          "type": "string"
        }
      },
      "required": [
        "apiKey"
      ],
      "additionalProperties": false
    },
    "WorkflowOverlay": {
      "oneOf": [
        {
          "$ref": "#/$defs/WorkflowDocument"
        },
        {
          "properties": {
            "fallbackCodeSamplesLanguage": {
              "type": "string"
            }
          },
          "required": [
            "fallbackCodeSamplesLanguage"
          ],
          "type": "object"
        }
      ]
    },
    "WorkflowPackagist": {
      "type": "object",
      "properties": {
        "token": {
          "type": "string"
        },
        "username": {
          "type": "string"
        }
      },
      "required": [
        "username",
        "token"
      ],
      "additionalProperties": false
    },
    "WorkflowPublishing": {
      "type": "object",
      "description": "The publishing configuration. See <https://www.speakeasy.com/docs/workflow-reference/publishing-reference>",
      "properties": {
        "cli": {
          "$ref": "#/$defs/WorkflowCLI",
          "description": "CLI publishing configuration."
        },
        "java": {
          "$ref": "#/$defs/WorkflowJava",
          "description": "Maven (Java) publishing configuration."
        },
        "mcpRegistry": {
          "$ref": "#/$defs/WorkflowMCPRegistry",
          "description": "MCP Registry publishing configuration. Publishes server metadata to the official MCP Registry (registry.modelcontextprotocol.io)."
        },
        "npm": {
          "$ref": "#/$defs/WorkflowNPM",
          "description": "NPM (Typescript) publishing configuration."
        },
        "nuget": {
          "$ref": "#/$defs/WorkflowNuget",
          "description": "NuGet (C#) publishing configuration."
        },
        "packagist": {
          "$ref": "#/$defs/WorkflowPackagist",
          "description": "Packagist (PHP) publishing configuration."
        },
        "pypi": {
          "$ref": "#/$defs/WorkflowPyPi",
          "description": "PyPI (Python)publishing configuration."
        },
        "rubygems": {
          "$ref": "#/$defs/WorkflowRubyGems",
          "description": "Rubygems (Ruby) publishing configuration."
        },
        "terraform": {
          "$ref": "#/$defs/WorkflowTerraform"
        }
      },
      "additionalProperties": false
    },
    "WorkflowPyPi": {
      "type": "object",
      "properties": {
        "token": {
          "description": "PyPI API token for token-based authentication. Not required if using trusted publishing.",
          "type": "string"
        },
        "useTrustedPublishing": {
          "description": "Use OIDC trusted publishing instead of token-based authentication. See <https://docs.pypi.org/trusted-publishers/>",
          "type": [
            "null",
            "boolean"
          ]
        }
      },
      "additionalProperties": false
    },
    "WorkflowRubyGems": {
      "type": "object",
      "properties": {
        "token": {
          "type": "string"
        }
      },
      "required": [
        "token"
      ],
      "additionalProperties": false
    },
    "WorkflowSource": {
      "description": "A source configuration",
      "properties": {
        "inputs": {
          "description": "A list of input documents (OpenAPI Specifications). These will be merged together",
          "items": {
            "$ref": "#/$defs/WorkflowDocument"
          },
          "minItems": 1,
          "type": [
            "array",
            "null"
          ]
        },
        "output": {
          "description": "The output file name (optional)",
          "type": [
            "null",
            "string"
          ]
        },
        "overlays": {
          "description": "A list of overlay files (OpenAPI Overlay Specification)",
          "items": {
            "$ref": "#/$defs/WorkflowOverlay"
          },
          "type": "array"
        },
        "registry": {
          "$ref": "#/$defs/WorkflowSourceRegistry",
          "description": "The openapi registry configuration"
        },
        "ruleset": {
          "description": "The linting ruleset to use (optional)",
          "type": [
            "null",
            "string"
          ]
        },
        "transformations": {
          "description": "A list of transformations to apply to the OpenAPI document",
          "items": {
            "$ref": "#/$defs/WorkflowTransformation"
          },
          "type": "array"
        }
      },
      "required": [
        "inputs"
      ],
      "type": "object"
    },
    "WorkflowSourceRegistry": {
      "description": "The openapi registry configuration",
      "properties": {
        "location": {
          "description": "The registry location to use (for snapshotting/change tracking)",
          "type": "string"
        },
        "tags": {
          "description": "The list of tags to use for the registry",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "location"
      ],
      "type": "object"
    },
    "WorkflowTarget": {
      "type": "object",
      "properties": {
        "codeSamples": {
          "$ref": "#/$defs/WorkflowCodeSamples"
        },
        "deployment": {
          "$ref": "#/$defs/WorkflowDeployment"
        },
        "output": {
          "type": [
            "null",
            "string"
          ]
        },
        "publish": {
          "$ref": "#/$defs/WorkflowPublishing"
        },
        "source": {
          "type": "string"
        },
        "target": {
          "enum": [
            "cli",
            "csharp",
            "go",
            "java",
            "mcp-typescript",
            "php",
            "python",
            "ruby",
            "swift",
            "terraform",
            "typescript",
            "unity",
            "postman"
          ],
          "type": "string"
        },
        "testing": {
          "$ref": "#/$defs/WorkflowTesting"
        }
      },
      "required": [
        "target",
        "source"
      ],
      "additionalProperties": false
    },
    "WorkflowTerraform": {
      "properties": {
        "gpgPassPhrase": {
          "type": "string"
        },
        "gpgPrivateKey": {
          "type": "string"
        }
      },
      "required": [
        "gpgPrivateKey",
        "gpgPassPhrase"
      ],
      "type": "object"
    },
    "WorkflowTesting": {
      "type": "object",
      "description": "Target testing configuration. By default, targets are not tested as part of the workflow.",
      "properties": {
        "enabled": {
          "description": "Defaults to false. If true, the target will be tested as part of the workflow.",
          "type": [
            "null",
            "boolean"
          ]
        },
        "mockServer": {
          "$ref": "#/$defs/WorkflowMockServer",
          "description": "Mock API server configuration for testing. By default and if generated, the mock API server is started before testing and used."
        }
      },
      "additionalProperties": false
    },
    "WorkflowTransformation": {
      "type": "object",
      "maxProperties": 1,
      "minProperties": 1,
      "properties": {
        "cleanup": {
          "description": "Clean up the OpenAPI document",
          "type": [
            "null",
            "boolean"
          ]
        },
        "filterOperations": {
          "$ref": "#/$defs/WorkflowFilterOperationsOptions",
          "description": "Filter operations from the OpenAPI document"
        },
        "format": {
          "type": [
            "null",
            "boolean"
          ]
        },
        "jqSymbolicExecution": {
          "type": [
            "null",
            "boolean"
          ]
        },
        "normalize": {
          "$ref": "#/$defs/WorkflowNormalizeOptions"
        },
        "removeUnused": {
          "description": "Remove unused components from the OpenAPI document",
          "type": [
            "null",
            "boolean"
          ]
        }
      },
      "additionalProperties": false
    },
    "WorkflowVersion": {
      "oneOf": [
        {
          "const": "latest",
          "description": "The latest version of the speakeasy CLI"
        },
        {
          "const": "pinned",
          "description": "The installed version of the speakeasy CLI"
        },
        {
          "description": "A semver version of the speakeasy CLI, corresponding to <https://github.com/speakeasy-api/speakeasy/releases>",
          "pattern": "^\\d+\\.\\d+\\.\\d+$",
          "type": "string"
        }
      ]
    }
  },
  "required": [
    "workflowVersion"
  ],
  "additionalProperties": false
}
