helper/schema: implement validation for TypeList/TypeSet. #6508
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was previously supported only on primitive schema types. It allows providers to validate properties of the entire collection in addition to the properties of individual elements.
This is similar to the functionality in #4348 but applied only to the elements of a particular
TypeList
orTypeSet
schema rather than the resource as a whole.My specific use case for this collection-level validation is an addition to the Fastly provider (WIP here) that adds support for a new
vcl
block in thefastly_service_v1
resource. The way the Fastly API is set up, you have multiple VCL blocks but exactly one of them can be marked as a "main" block (the rest are treated as includable libraries). This functionality lets me validate this property and issue a nice warning/error before doing anything else.