Skip to content

Commit 7627644

Browse files
mx-psipellaredjack-berg
authored
[configuration] Specify YAML schema that configuration files should follow (#3973)
Fixes #3962 ## Changes Specifies the YAML schema to follow. A schema is a set of YAML tags (i.e. types) and a way to assign types. YAML 1.2 recommends the 'Core schema': the types are those of JSON. Scalars are resolved as one would expect, see [here](https://yaml.org/spec/1.2.2/#103-core-schema) for the details. One important difference with the way that YAML 1.1 used to work is that integer scalars starting with a `0` are interpreted as being written in decimal notation; e.g. `0123` parses to the integer 123 instead of the integer 83 (you can still use octal notation in YAML 1.2 by using `0o123`). Some YAML parsers deviate from the core schema in how this works, for example, both of the more commonly used YAML parsing libraries in Golang parse `0123` as 83 ([go-yaml/yaml](https://github.com/go-yaml/yaml?tab=readme-ov-file#compatibility) and [goccy/go-yaml](https://github.com/goccy/go-yaml/blob/4653a1bb5c0047bb37280ac341e2f091cb44352f/ast/ast.go#L326)). **This may make it a bit difficult to strictly follow this requirement in some languages**. For non-trivial changes, follow the [change proposal process](https://github.com/open-telemetry/opentelemetry-specification/blob/main/CONTRIBUTING.md#proposing-a-change). * [x] Related issues #3962, part of #3963 --------- Co-authored-by: Robert Pająk <[email protected]> Co-authored-by: jack-berg <[email protected]>
1 parent 8218145 commit 7627644

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ release.
4646
([#4002](https://github.com/open-telemetry/opentelemetry-specification/pull/4002))
4747
- Add end to end examples for file configuration
4848
([#4018](https://github.com/open-telemetry/opentelemetry-specification/pull/4018))
49+
- Clarify the schema for YAML configuration files
50+
([#3973](https://github.com/open-telemetry/opentelemetry-specification/pull/3973))
4951

5052
### Common
5153

specification/configuration/file-configuration.md

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ Configuration files SHOULD use one the following serialization formats:
6565
[YAML](https://yaml.org/spec/1.2.2/) configuration files SHOULD follow YAML spec
6666
revision >= 1.2.
6767

68+
YAML configuration files SHOULD be parsed using [v1.2 YAML core schema](https://yaml.org/spec/1.2.2/#103-core-schema).
69+
6870
YAML configuration files MUST use file extensions `.yaml` or `.yml`.
6971

7072
### Environment variable substitution

0 commit comments

Comments
 (0)