Skip to content
New issue

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

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

Already on GitHub? # to your account

[GH-6629] config: Handle null attributes as invalid #6645

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mikeblum
Copy link

No description provided.

@mikeblum
Copy link
Author

mikeblum commented Jan 18, 2025

As written the omitempty is allowing the YAML to parse without an error. Added a validate_config test to factor out the yaml:omitempty issue. Should we remove the omitempty annotations to catch these sorts of issues and check for null / empty after yaml.parse or is there another way?

I could see the matrix of property checks growing quite a bit as new properties get added over time - we'd need a check for each attribute or go down the reflect route which has it's own set of issues.

https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/config/v0.3.0/generated_config.go#L427

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant