-
Notifications
You must be signed in to change notification settings - Fork 17
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
base: main
Are you sure you want to change the base?
Conversation
@@ -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", |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
I analyzed JSON schema's
required
andtype: ["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)