Add minItems recommendation for array properties by jack-berg · Pull Request #386 · open-telemetry/opentelemetry-configuration (original) (raw)

Don't feel super strongly about this one, but I do think this guidance slightly improves schema by disallowing array configurations which don't do anything:

Because properties of type array are not candidates for [env var substitution], it typically does not make sense to allow the array to be empty. In some cases, an empty array likely corresponds to an accidental misconfiguration which should be detected and reported as an error. In other cases, an empty array is simply meaningless and the user is better off omitting the property altogether.
For these reasons, minItems is typically set to 1.
NOTE: there are some valid cases where an empty array is semantically meaningful, such as when setting ExplicitBucketHistogram.boundaries.