buf.policy.yaml
buf.policy.yaml defines a policy containing lint, breaking change detection, and plugin configuration that can be shared across BSR modules
buf.policy.yaml
Validate
Check your file against this schema
Opens the validator with this schema already loaded. Paste your
buf.policy.yaml and it validates in your browser — nothing is uploaded.
Reference
Fields
Generated directly from the schema, following local
$refs, to two levels of nesting.
| Field | Type | Description |
|---|---|---|
versionrequired | string | Required. The version key defines the current configuration version. The only accepted value is v2. |
name | string | Optional. A BSR path that uniquely identifies this policy. Must be a valid policy name in the format buf.build/ORGANIZATION/POLICY_NAME. |
lint | object | Optional. The lint settings for this policy. |
lint.use | array | Optional. Lists the categories and/or specific rules to use. The STANDARD category is used if lint is unset. default: ["STANDARD"] |
lint.except | array | Optional. Removes rules or categories from the use list. |
lint.enum_zero_value_suffix | string | Optional. Controls the behavior of the ENUM_ZERO_VALUE_SUFFIX lint rule. By default, this rule verifies that the zero value of all enums ends in _UNSPECIFIED. default: "_UNSPECIFIED" |
lint.rpc_allow_same_request_response | boolean | Optional. Allows the same message type to be used for a single RPC's request and response type. We don't recommend using this option. |
lint.rpc_allow_google_protobuf_empty_requests | boolean | Optional. Allows RPC requests to be google.protobuf.Empty messages. We don't recommend using this option. |
lint.rpc_allow_google_protobuf_empty_responses | boolean | Optional. Allows RPC responses to be google.protobuf.Empty messages. We don't recommend using this option. |
lint.service_suffix | string | Optional. Controls the behavior of the SERVICE_SUFFIX lint rule. By default, this rule verifies that all service names are suffixed with Service. default: "Service" |
lint.disable_builtin | boolean | Optional. Disables Buf's built-in lint rules when set to true. Defaults to false. default: false |
breaking | object | Optional. The breaking change detection settings for this policy. |
breaking.use | array | Optional. Lists the rules or categories to use for breaking change detection. The FILE category is used if breaking is unset. default: ["FILE"] |
breaking.except | array | Optional. Removes rules or categories from the use list. We don't recommend using this option. |
breaking.ignore_unstable_packages | boolean | Optional. Ignores packages with a last component that's one of the unstable forms recognized by the Buf linter's PACKAGE_VERSION_SUFFIX rule. |
breaking.disable_builtin | boolean | Optional. Disables Buf's built-in breaking change detection rules when set to true. Defaults to false. default: false |
plugins | array<object> | Optional. Custom Buf plugins that provide additional lint or breaking change rules. |
Audit
What we found in this schema
- Declared draft: draft-07
- Validates cleanly against its own meta-schema.
- 19 properties, 100% carrying a description, max nesting depth 6.
Standards
Specification sections for the keywords in this schema
| Keyword | Document | Section |
|---|---|---|
$comment | JSON Schema Core, draft 2020-12 | §8.3 — Comments With "$comment" |
$defs | JSON Schema Core, draft 2020-12 | §8.2.4 — Schema Re-Use With "$defs" |
$id | JSON Schema Core, draft 2020-12 | §8.2.1 — The "$id" Keyword |
$ref | JSON Schema Core, draft 2020-12 | §8.2.3.1 — Direct References with "$ref" |
$schema | JSON Schema Core, draft 2020-12 | §8.1.1 — "$schema" |
additionalProperties | JSON Schema Core, draft 2020-12 | §10.3.2.3 — "additionalProperties" |
const | JSON Schema Validation, draft 2020-12 | §6.1.3 — "const" |
default | JSON Schema Validation, draft 2020-12 | §9.2 — "default" |
description | JSON Schema Validation, draft 2020-12 | §9.1 — "title" and "description" |
examples | JSON Schema Validation, draft 2020-12 | §9.5 — "examples" |
items | JSON Schema Core, draft 2020-12 | §10.3.1.2 — "items" |
properties | JSON Schema Core, draft 2020-12 | §10.3.2.1 — "properties" |
required | JSON Schema Validation, draft 2020-12 | §6.5.3 — "required" |
type | JSON Schema Validation, draft 2020-12 | §6.1.1 — "type" |
Documents
- JSON Schema Core, draft 2020-12 — JSON Schema: A Media Type for Describing JSON Documents, A. Wright, H. Andrews, B. Hutton, G. Dennis, Eds., 2022. draft-bhutton-json-schema-01. An expired Internet-Draft with no formal standing in the IETF standards process; it is nonetheless the specification of record for JSON Schema 2020-12, published by json-schema.org.
- JSON Schema Validation, draft 2020-12 — JSON Schema Validation: A Vocabulary for Structural Validation of JSON, A. Wright, H. Andrews, B. Hutton, Eds., 2022.
- RFC 8259 (STD 90) — The JavaScript Object Notation (JSON) Data Interchange Format, T. Bray, Ed., 2017. The format a schema describes.
- RFC 6901 — JavaScript Object Notation (JSON) Pointer. Defines the pointer syntax used by $ref fragments and the ~0 / ~1 escapes.
Source
Attribution
This schema comes from SchemaStore, distributed under the Apache License 2.0. Copyright 2015–present Mads Kristensen and contributors. View the original file. The field table and audit on this page are generated by JSONTools.tools; the schema itself is unmodified.