Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[configuration] Specify YAML schema that configuration files should follow #3973

Merged
merged 11 commits into from
May 7, 2024

Conversation

mx-psi
Copy link
Member

@mx-psi mx-psi commented Apr 2, 2024

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 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 and goccy/go-yaml). This may make it a bit difficult to strictly follow this requirement in some languages.

For non-trivial changes, follow the change proposal process.

@mx-psi mx-psi requested review from a team April 2, 2024 15:50
@mx-psi
Copy link
Member Author

mx-psi commented Apr 2, 2024

cc @open-telemetry/configuration-maintainers

Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Apr 17, 2024
@mx-psi mx-psi requested a review from jack-berg April 24, 2024 15:28
@jack-berg jack-berg removed the Stale label Apr 25, 2024
Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for following up on this @mx-psi!

@jack-berg
Copy link
Member

@MrAlias and maybe @carlosalberto take a look when you can. I think this should be ready with an additional approval.

@jack-berg jack-berg merged commit 7627644 into open-telemetry:main May 7, 2024
6 of 7 checks passed
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
…ollow (open-telemetry#3973)

Fixes open-telemetry#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 open-telemetry#3962, part of open-telemetry#3963

---------

Co-authored-by: Robert Pająk <[email protected]>
Co-authored-by: jack-berg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define or recommend YAML schema supported
7 participants