{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/speakeasy-generation-config-file/latest.json",
  "title": "Gen YAML Configuration Schema",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/speakeasy-api/sdk-gen-config/main/schemas/gen.config.schema.json",
    "sourceSha256": "40da1a4b41c22f6bc74da2ca348ae38ea7f3436472bac882ac06960a74a3abba",
    "fileMatch": [
      "**/.speakeasy/gen.yaml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "configVersion": {
      "description": "The version of the configuration file",
      "minLength": 1,
      "type": "string"
    },
    "csharp": {
      "$ref": "https://catalog.lintel.tools/schemas/schemastore/speakeasy-generation-config-file/_shared/latest--csharp.schema.json"
    },
    "generation": {
      "$ref": "#/$defs/SdkGenConfigGeneration"
    },
    "go": {
      "$ref": "https://catalog.lintel.tools/schemas/schemastore/speakeasy-generation-config-file/_shared/latest--go.schema.json"
    },
    "java": {
      "$ref": "https://catalog.lintel.tools/schemas/schemastore/speakeasy-generation-config-file/_shared/latest--java.schema.json"
    },
    "php": {
      "$ref": "https://catalog.lintel.tools/schemas/schemastore/speakeasy-generation-config-file/_shared/latest--php.schema.json"
    },
    "postman": {
      "$ref": "https://catalog.lintel.tools/schemas/schemastore/speakeasy-generation-config-file/_shared/latest--postman.schema.json"
    },
    "python": {
      "$ref": "https://catalog.lintel.tools/schemas/schemastore/speakeasy-generation-config-file/_shared/latest--python.schema.json"
    },
    "ruby": {
      "$ref": "https://catalog.lintel.tools/schemas/schemastore/speakeasy-generation-config-file/_shared/latest--ruby.schema.json"
    },
    "terraform": {
      "$ref": "https://catalog.lintel.tools/schemas/schemastore/speakeasy-generation-config-file/_shared/latest--terraform.schema.json"
    },
    "typescript": {
      "$ref": "https://catalog.lintel.tools/schemas/schemastore/speakeasy-generation-config-file/_shared/latest--typescript.schema.json"
    },
    "unity": {
      "$ref": "https://catalog.lintel.tools/schemas/schemastore/speakeasy-generation-config-file/_shared/latest--unity.schema.json"
    }
  },
  "$defs": {
    "SdkGenConfigAuth": {
      "type": "object",
      "description": "Authentication configuration",
      "properties": {
        "hoistGlobalSecurity": {
          "description": "Enables hoisting of operation-level security schemes to global level when no global security is defined",
          "type": "boolean"
        },
        "oAuth2ClientCredentialsEnabled": {
          "description": "Enables support for OAuth2 client credentials grant type",
          "type": "boolean"
        },
        "oAuth2PasswordEnabled": {
          "description": "Enables support for OAuth2 resource owner password credentials grant type",
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SdkGenConfigDevContainers": {
      "type": "object",
      "description": "Dev container configuration",
      "properties": {
        "enabled": {
          "description": "Whether dev containers are enabled",
          "type": "boolean"
        },
        "schemaPath": {
          "description": "Path to the schema file for the dev container",
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "SdkGenConfigFixes": {
      "type": "object",
      "description": "Fixes applied to the SDK generation",
      "properties": {
        "nameOverrideFeb2026": {
          "description": "Prevents component-level x-speakeasy-name-override from affecting parent names when referencing schema via $ref or hoisting allOf extensions",
          "type": "boolean"
        },
        "nameResolutionDec2023": {
          "description": "Enables name resolution fixes from December 2023",
          "type": "boolean"
        },
        "nameResolutionFeb2025": {
          "description": "Enables name resolution fixes from February 2025",
          "type": "boolean"
        },
        "parameterOrderingFeb2024": {
          "description": "Enables parameter ordering fixes from February 2024",
          "type": "boolean"
        },
        "requestResponseComponentNamesFeb2024": {
          "description": "Enables request and response component naming fixes from February 2024",
          "type": "boolean"
        },
        "securityFeb2025": {
          "description": "Enables fixes and refactoring for security that were introduced in February 2025",
          "type": "boolean"
        },
        "sharedErrorComponentsApr2025": {
          "description": "Enables fixes that mean that when a component is used in both 2XX and 4XX responses, only the top level component will be duplicated to the errors scope as opposed to the entire component tree",
          "type": "boolean"
        },
        "sharedNestedComponentsJan2026": {
          "description": "Fixes component naming when the same schema is referenced in multiple places within nested structures, ensuring consistent naming based on the original component definition",
          "type": "boolean"
        }
      },
      "additionalProperties": true
    },
    "SdkGenConfigGeneration": {
      "type": "object",
      "description": "Generation configuration",
      "properties": {
        "auth": {
          "$ref": "#/$defs/SdkGenConfigAuth"
        },
        "baseServerUrl": {
          "description": "The base URL of the server. This value will be used if global servers are not defined in the spec.",
          "type": "string"
        },
        "deduplicateErrors": {
          "description": "Deduplicates errors that have the same schema",
          "type": "boolean"
        },
        "devContainers": {
          "$ref": "#/$defs/SdkGenConfigDevContainers"
        },
        "fixes": {
          "$ref": "#/$defs/SdkGenConfigFixes"
        },
        "inferSSEOverload": {
          "description": "Generates an overload if generator detects that the request body field 'stream: true' is used for client intent to request 'text/event-stream' response",
          "type": "boolean"
        },
        "maintainOpenAPIOrder": {
          "description": "Maintains the order of parameters and fields in the OpenAPI specification",
          "type": "boolean"
        },
        "mockServer": {
          "$ref": "#/$defs/SdkGenConfigMockServer"
        },
        "persistentEdits": {
          "$ref": "#/$defs/SdkGenConfigPersistentEdits"
        },
        "requestBodyFieldName": {
          "description": "The name of the field to use for the request body in generated SDKs",
          "type": "string"
        },
        "schemas": {
          "$ref": "#/$defs/SdkGenConfigSchemas"
        },
        "sdkClassName": {
          "description": "Generated name of the root SDK class",
          "type": "string"
        },
        "sdkHooksConfigAccess": {
          "description": "Enables access to the SDK configuration from hooks",
          "type": "boolean"
        },
        "skipErrorSuffix": {
          "description": "Skips the automatic addition of an error suffix to error types",
          "type": "boolean"
        },
        "tests": {
          "$ref": "#/$defs/SdkGenConfigTests"
        },
        "usageSnippets": {
          "$ref": "#/$defs/SdkGenConfigUsageSnippets"
        },
        "useClassNamesForArrayFields": {
          "description": "Use class names for array fields instead of the child's schema type",
          "type": "boolean"
        },
        "versioningStrategy": {
          "description": "Controls how SDK versions are determined. 'automatic' (default) bumps versions based on changes, 'manual' uses the version in gen.yaml as-is.",
          "enum": [
            "automatic",
            "manual"
          ],
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "SdkGenConfigLanguageConfig": {
      "type": "object",
      "description": "Language-specific SDK configuration",
      "properties": {
        "Cfg": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": {}
        },
        "version": {
          "description": "SDK version",
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "SdkGenConfigMockServer": {
      "type": "object",
      "description": "Mock server generation configuration",
      "properties": {
        "disabled": {
          "description": "Disables the code generation of the mock server target",
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SdkGenConfigPersistentEdits": {
      "type": "object",
      "description": "Configures whether user edits to generated SDKs persist across regenerations",
      "properties": {
        "compilePristine": {
          "description": "When true (default), runs an initial compile pass to normalize pristine content. Set to false when generated SDK doesn't compile but you still want persistent edits.",
          "type": [
            "null",
            "boolean"
          ]
        },
        "enabled": {
          "description": "Enables preservation of user edits across SDK regenerations. Set to 'never' to disable prompts.",
          "enum": [
            "true",
            "never"
          ],
          "type": [
            "null",
            "string"
          ]
        }
      },
      "additionalProperties": true
    },
    "SdkGenConfigSchemas": {
      "type": "object",
      "description": "Schema processing configuration",
      "properties": {
        "allOfMergeStrategy": {
          "description": "Controls how allOf schemas are merged",
          "enum": [
            "deepMerge",
            "shallowMerge"
          ],
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SdkGenConfigServerIndex": {
      "description": "Controls which server is shown in usage snippets. If unset, no server will be shown. If an integer, it will be used as the server index. Otherwise, it will look for a matching server ID.",
      "type": [
        "string",
        "integer"
      ]
    },
    "SdkGenConfigTests": {
      "type": "object",
      "description": "Test generation configuration",
      "properties": {
        "generateNewTests": {
          "description": "Enables generation of new tests for any new operations in the OpenAPI specification",
          "type": "boolean"
        },
        "generateTests": {
          "description": "Enables generation of tests",
          "type": "boolean"
        },
        "skipResponseBodyAssertions": {
          "description": "Skip asserting that the client got the same response bodies returned by the mock server",
          "type": "boolean"
        }
      },
      "additionalProperties": true
    },
    "SdkGenConfigUsageSnippets": {
      "type": "object",
      "description": "Configuration for usage snippets",
      "properties": {
        "optionalPropertyRendering": {
          "description": "Controls how optional properties are rendered in usage snippets",
          "enum": [
            "always",
            "never",
            "withExample"
          ],
          "type": "string"
        },
        "sdkInitStyle": {
          "description": "Controls how the SDK initialization is depicted in usage snippets",
          "enum": [
            "constructor",
            "builder"
          ],
          "type": "string"
        },
        "serverToShowInSnippets": {
          "$ref": "#/$defs/SdkGenConfigServerIndex"
        }
      },
      "additionalProperties": true
    }
  },
  "required": [
    "configVersion",
    "generation"
  ],
  "additionalProperties": false
}
