{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://raw.githubusercontent.com/ogen-go/ogen/main/schemas/ogen.jsonschema.json", "$comment": "This file is generated, edits should be made in https://github.com/ogen-go/ogen/blob/main/schemas/ogen.jsonschema.yml.", "title": "Ogen Configuration Schema", "description": "JSON Schema for ogen code generator configuration. See https://ogen.dev/docs/config.", "type": "object", "additionalProperties": false, "properties": { "parser": { "type": "object", "additionalProperties": false, "description": "Parser configuration options.", "properties": { "infer_types": { "type": "boolean", "description": "Enables type inference for schemas. Schema parser will try to detect schema type by its properties.\n", "default": false }, "allow_remote": { "type": "boolean", "description": "Enables remote references resolving. See https://github.com/ogen-go/ogen/issues/385.\n", "default": false }, "depth_limit": { "type": "integer", "description": "Maximum depth of schema generation.", "minimum": 1, "default": 1000 }, "authentication_schemes": { "type": "array", "description": "Allowed HTTP Authorization schemes in a Security Scheme Object. If empty, the ones registered in https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml are used.\n", "items": { "type": "string", "enum": [ "basic", "bearer", "concealed", "digest", "dpop", "gnap", "hoba", "mutual", "negotiate", "oauth", "privatetoken", "scram-sha-1", "scram-sha-256", "vapid" ] }, "default": [ "basic", "bearer", "concealed", "digest", "dpop", "gnap", "hoba", "mutual", "negotiate", "oauth", "privatetoken", "scram-sha-1", "scram-sha-256", "vapid" ] }, "allow_cross_type_constraints": { "type": "boolean", "description": "Enables interpretation of cross-type schema constraints. When enabled, constraints like pattern on numbers or maximum on strings are allowed and interpreted during code generation.\n", "default": true }, "disallow_duplicate_method_paths": { "type": "boolean", "description": "Enables strict duplicate normalized path checks. When enabled, duplicate normalized paths are always rejected per strict OpenAPI interpretation. Otherwise, paths with different parameter names and different HTTP methods are allowed, and operations are disambiguated by path + params + method.\n", "default": false } } }, "generator": { "type": "object", "additionalProperties": false, "description": "Generator configuration options.", "properties": { "features": { "type": "object", "additionalProperties": false, "description": "Generator features configuration.", "properties": { "enable": { "type": "array", "description": "Features to enable. Applied after disable list, so entries here take priority.\n", "items": { "type": "string", "enum": [ "paths/client", "paths/server", "webhooks/client", "webhooks/server", "client/security/reentrant", "client/request/options", "client/request/validation", "client/editors", "server/response/validation", "ogen/otel", "ogen/unimplemented", "debug/example_tests", "naming/camel_initialisms" ], "enumDescriptions": [ "Generate client code for API paths.", "Generate server code for API paths.", "Generate client code for webhooks.", "Generate server code for webhooks.", "Allow security source implementations to receive and use the generated client.", "Generate per-request option functions for client requests.", "Enable client request validation before sending.", "Generate client request editor option functions.", "Enable server response validation.", "Enable OpenTelemetry integration.", "Generate stub handlers for unimplemented operations.", "Generate debug example tests.", "Apply initialism rules (ID, URL, HTTP, ...) to camelCase identifiers, e.g. userId -> UserID." ] }, "default": [ "paths/client", "paths/server", "webhooks/client", "webhooks/server", "ogen/otel", "ogen/unimplemented" ] }, "disable": { "type": "array", "description": "Features to disable. Applied before enable list, so entries in enable list take priority.\n", "items": { "type": "string", "enum": [ "paths/client", "paths/server", "webhooks/client", "webhooks/server", "client/security/reentrant", "client/request/options", "client/request/validation", "client/editors", "server/response/validation", "ogen/otel", "ogen/unimplemented", "debug/example_tests", "naming/camel_initialisms" ], "enumDescriptions": [ "Disable client code generation for API paths.", "Disable server code generation for API paths.", "Disable client code generation for webhooks.", "Disable server code generation for webhooks.", "Disable passing the generated client to security source callbacks.", "Disable per-request option functions for client requests.", "Disable client request validation before sending.", "Disable client request editor option functions.", "Disable server response validation.", "Disable OpenTelemetry integration.", "Disable stub handlers for unimplemented operations.", "Disable debug example tests.", "Disable applying initialism rules to camelCase identifiers." ] }, "default": [] }, "disable_all": { "type": "boolean", "description": "Start from an empty feature set instead of default features before applying disable and enable lists.\n", "default": false } } }, "filters": { "type": "object", "additionalProperties": false, "description": "Operation filtering configuration options.", "properties": { "path_regex": { "type": "string", "description": "Regular expression to filter paths. If empty, all paths are accepted.\n", "default": "" }, "methods": { "type": "array", "description": "HTTP methods to keep. If empty, all methods are accepted.\n", "items": { "type": "string", "enum": [ "GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "TRACE" ] }, "default": [] } } }, "ignore_not_implemented": { "type": "array", "description": "Functions that are not yet implemented and should be skipped during generation. \"all\" is a special list value that skips all not-implemented functions.\n", "items": { "type": "string" }, "default": [] }, "convenient_errors": { "type": "string", "description": "Controls convenient error helper generation. See https://ogen.dev/docs/concepts/convenient_errors.\n", "enum": [ "on", "off", "auto" ], "enumDescriptions": [ "Force convenient error helper generation, it will fail if no common error pattern can be found.", "Disable convenient error helper generation.", "Generate convenient error helpers automatically when a common error pattern can be found." ], "default": "auto" }, "content_type_aliases": { "type": "object", "description": "Maps exact content types to known encodings.", "additionalProperties": { "type": "string" }, "default": {} }, "wildcard_content_type_default": { "type": "string", "description": "Default encoding to use for wildcard content types (e.g. */* or application/*) when the schema is not binary. If empty, wildcard content types are treated as unsupported.\n", "default": "" }, "initialisms": { "type": "array", "description": "Customizes the initialism rules applied when generating Go identifiers (e.g. id -> ID, url -> URL). Mirrors staticcheck's \"initialisms\" option: omit to use the built-in set; include the special value \"inherit\" to splice in the built-in set and add more on top; list without \"inherit\" to replace the built-in set entirely; an explicit empty list disables all initialisms.\n", "items": { "type": "string" } } } }, "expand": { "type": "string", "description": "Path to write the expanded OpenAPI spec file. If empty, the expanded spec is not written.\n", "default": "" } } }