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

Provide guidance on required and null properties #141

Merged
merged 3 commits into from
Dec 3, 2024

Conversation

jack-berg
Copy link
Member

I analyzed JSON schema's required and type: ["null"] concepts and have provided guidance on when and how to use them in schema modeling. Also, I've carefully applied this guidance to existing types.

I've been thinking we've needed this for a while, but this conversation was the impetus: #140 (comment)

@jack-berg jack-berg requested a review from a team as a code owner November 25, 2024 23:33
@@ -2,7 +2,7 @@
"$id": "https://opentelemetry.io/otelconfig/meter_provider.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "MeterProvider",
"type": ["object", "null"],
"type": "object",
Copy link
Member Author

@jack-berg jack-berg Nov 25, 2024

Choose a reason for hiding this comment

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

Setting meter_provider: is not a sensible thing to do. If you want a noop meter_provider, omit meter_provider altogether.

This same logic applies to all the other places which changed from "type": ["object", "null"] to "type":"object".

@@ -26,9 +26,12 @@
]
}
},
"required": [
"readers"
Copy link
Member Author

Choose a reason for hiding this comment

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

A meter_provider without readers isn't sensible.

@@ -211,9 +214,6 @@
"minimum": 0
}
},
"required": [
"endpoint"
Copy link
Member Author

Choose a reason for hiding this comment

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

Endpoint is not actually required for zipkin since there's a well defined default value.

Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix.

@jack-berg jack-berg merged commit 60a2d91 into open-telemetry:main Dec 3, 2024
11 checks passed
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.

2 participants