{
  "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml",
  "$id": "https://json.schemastore.org/buf.gen.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "buf.gen.yaml",
  "description": "buf.gen.yaml is a configuration file used by the buf generate command to generate integration code for the languages of your choice.",
  "type": "object",
  "properties": {
    "version": {
      "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#version",
      "description": "Required. Defines the current configuration version. Accepted values are v1beta1 and v1.",
      "type": "string",
      "enum": ["v1beta1", "v1"]
    },
    "plugins": {
      "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#plugins",
      "description": "Required. Each entry in the plugins key is a protoc plugin configuration. Plugins are invoked in parallel and their outputs are written in the order you specify here.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "plugin": {
            "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#plugin",
            "type": "string",
            "description": "Required. The name of the plugin to use—can be local or remote. See https://buf.build/docs/configuration/v1/buf-gen-yaml#plugin."
          },
          "name": {
            "type": "string"
          },
          "remote": {
            "type": "string",
            "deprecated": true
          },
          "out": {
            "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#out",
            "type": "string",
            "description": "Required. Controls where the generated files are deposited for a given plugin. Although absolute paths are supported, this configuration is typically a relative output directory to where buf generate is run."
          },
          "opt": {
            "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#opt",
            "description": "Optional. Specifies one or more plugin options for each plugin independently. You can provide options as either a single string or a list of strings.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "path": {
            "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#path",
            "description": "Optional. Only works with local plugins. Overrides the default location and explicitly specifies where to locate the plugin.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "revision": {
            "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#revision",
            "description": "Optional. May be used along with the plugin field to pin an exact version of a remote plugin. In most cases, we recommend omitting revision, in which case the latest revision of that version of the plugin will be used (automatically pulling in the latest bug fixes).",
            "type": "integer",
            "minimum": 0
          },
          "strategy": {
            "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#strategy",
            "description": "Optional. Specifies the invocation strategy to use. See https://buf.build/docs/configuration/v1/buf-gen-yaml#strategy.",
            "type": "string",
            "enum": ["directory", "all"]
          },
          "protoc_path": {
            "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#protoc_path",
            "description": "Optional. Only applies to the code generators that are built in to protoc. Normally, a plugin is a separate executable with a binary name like protoc-gen-<name>. But for a handful of plugins, the executable used is protoc itself. See https://buf.build/docs/configuration/v1/buf-gen-yaml#protoc_path.",
            "type": "string"
          }
        },
        "required": ["out"],
        "additionalProperties": false
      }
    },
    "managed": {
      "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#managed",
      "description": "The managed key is used to configure managed mode, an advanced feature for Protobuf options. See https://buf.build/docs/generate/managed-mode.",
      "type": "object",
      "properties": {
        "enabled": {
          "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#enabled",
          "description": "Required if any other managed keys are set. Setting enabled equal to true with no other keys set enables managed mode according to default behavior. See https://buf.build/docs/generate/managed-mode#default-behavior.",
          "type": "boolean"
        },
        "cc_enable_arenas": {
          "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#cc_enable_arenas",
          "description": "Optional. If unset, this option is left as specified in your .proto files. As of Protocol Buffers release v3.14.0, changing this value no longer has any effect.",
          "type": "boolean"
        },
        "csharp_namespace": {
          "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#csharp_namespace",
          "description": "Optional. Controls the default C# namespace for classes generated from all of the .proto files contained within the input. Managed mode generates C# files with a top-level namespace based on each .proto file’s package, with each part transformed to PascalCase.",
          "type": "object",
          "properties": {
            "except": {
              "description": "Optional. Removes the specified modules from the default csharp_namespace option behavior. The except keys must be valid module names.",
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "override": {
              "description": "Optional. Overrides the csharp_namespace value used for specific modules. The override keys must be valid module names.",
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          "additionalProperties": false
        },
        "go_package_prefix": {
          "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#go_package_prefix",
          "description": "Optional. Controls what the go_package value is set to for all of the .proto files contained within the input. If unset, this option is left as specified in your .proto files.",
          "type": "object",
          "properties": {
            "default": {
              "description": "Required if the go_package_prefix key is set. The default value is used as a prefix for the go_package value set in each of the files. It must be a relative file path that must not jump context from the current directory—that is, it must be subdirectories relative to the current working directory.",
              "type": "string"
            },
            "except": {
              "description": "Optional. Removes certain modules from the go_package option behavior. The except values must be valid module names. There are situations where you may want to enable managed mode for the go_package option in most of your Protobuf files, but not necessarily for all of your Protobuf files. This is particularly relevant for the buf.build/googleapis/googleapis module, which points its go_package value to an external repository. Popular libraries such as grpc-go depend on these go_package values, so it's important that managed mode does not overwrite them.",
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "override": {
              "description": "Optional. Overrides the go_package file option value used for specific modules. The override keys must be valid module names. Additionally, the corresponding override values must be a valid Go import path and must not jump context from the current directory. As an example, ../external is invalid. This setting is used for workspace environments, where you have a module that imports from another module in the same workspace, and you need to generate the Go code for each module in different directories. This is particularly relevant for repositories that decouple their private API definitions from their public API definitions.",
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          "required": ["default"],
          "additionalProperties": false
        },
        "java_multiple_files": {
          "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#java_multiple_files",
          "description": "Optional. Controls what the java_multiple_files value is set to for all of the .proto files contained within the input. The only accepted values are false and true. Managed mode defaults to true (Protobuf's default is false). See https://buf.build/docs/configuration/v1/buf-gen-yaml#java_multiple_files.",
          "type": "boolean"
        },
        "java_package_prefix": {
          "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#java_package_prefix",
          "description": "Optional. Controls what is prepended to the java_package value is set to for all of the .proto files contained within the input. If this is unset, managed mode's default value is `com`.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "object",
              "properties": {
                "default": {
                  "description": "Required if the java_package_prefix key is set. The default value is used as a prefix for the java_package value set in each of the files.",
                  "type": "string"
                },
                "except": {
                  "description": "Optional. Removes the specified modules from the java_package option behavior. The except keys must be valid module names.",
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "override": {
                  "description": "Optional. Overrides the java_package option value used for specific modules. The override keys must be valid module names.",
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              },
              "required": ["default"],
              "additionalProperties": false
            }
          ]
        },
        "java_string_check_utf8": {
          "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#java_string_check_utf8",
          "description": "Optional. Controls what the java_string_check_utf8 value is set to for all of the .proto files contained within the input. The only accepted values are false and true. If unset, this option is left as specified in your .proto files. Protobuf's default is false.",
          "type": "boolean"
        },
        "objc_class_prefix": {
          "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#objc_class_prefix",
          "description": "Optional. When managed mode is enabled, this defaults to an abbreviation of the package name as described in the default behavior section. The value is prepended to all generated classes. See https://buf.build/docs/generate/managed-mode#default-behavior.",
          "type": "object",
          "properties": {
            "default": {
              "description": "Optional. Overrides managed mode's default value for the class prefix.",
              "type": "string"
            },
            "except": {
              "description": "Optional. Removes the specified modules from the objc_class_prefix option behavior. The except keys must be valid module names.",
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "override": {
              "description": "Optional. Overrides any default objc_class_prefix option value for specific modules. The override keys must be valid module names.",
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          "required": ["default"],
          "additionalProperties": false
        },
        "optimize_for": {
          "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#optimize_for",
          "description": "Optional. Controls what the optimize_for value is set to for all of the .proto files contained within the input. The only accepted values are SPEED, CODE_SIZE and LITE_RUNTIME. Managed mode will not modify this option if unset.",
          "type": "string",
          "enum": ["SPEED", "CODE_SIZE", "LITE_RUNTIME"]
        },
        "ruby_package": {
          "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#ruby_package",
          "description": "Optional. Controls what the ruby_package value is set to for all of the .proto files contained within the input. Managed mode's default value is the package name with each package sub-name capitalized, with :: substituted for .",
          "type": "object",
          "properties": {
            "except": {
              "description": "Optional. Removes the specified modules from the ruby_package file option override behavior. The except keys must be valid module names.",
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "override": {
              "description": "Optional. Overrides the ruby_package file option value used for specific modules. The override keys must be valid module names.",
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          "additionalProperties": false
        },
        "override": {
          "$comment": "https://buf.build/docs/configuration/v1/buf-gen-yaml#per-file-override",
          "description": "Optional. This is a list of per-file overrides for each modifier. See https://buf.build/docs/configuration/v1/buf-gen-yaml#per-file-override.",
          "type": "object",
          "properties": {
            "CSHARP_NAMESPACE": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "GO_PACKAGE": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "JAVA_MULTIPLE_FILES": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "JAVA_OUTER_CLASSNAME": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "JAVA_PACKAGE": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "JAVA_STRING_CHECK_UTF8": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "OBJC_CLASS_PREFIX": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "OPTIMIZE_FOR": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "PHP_METADATA_NAMESPACE": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "PHP_NAMESPACE": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "RUBY_PACKAGE": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  },
  "required": ["version", "plugins"]
}
