You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whilst working on #241, #232 (f2c8ee0 specifically) and investigating #170 it became clear that we need some more effective way to express that an attribute takes multiple types and/or scopes.
We should explore some more elegant ways of expressing such a constraint.
One possible solution would be to just introduce plural version OfType and OfScopeId, where validation ensures that either singular or plural is used (not both).
The text was updated successfully, but these errors were encountered:
radeksimko
changed the title
schema/decoder: Replace Reference's OfType/OfScopeId with plural slices
schema/decoder: Support multiple OfType/OfScopeId in ReferenceApr 14, 2023
Context
Whilst working on #241, #232 (f2c8ee0 specifically) and investigating #170 it became clear that we need some more effective way to express that an attribute takes multiple types and/or scopes.
This function also expresses the problem:
hcl-lang/decoder/expr_one_of_ref_origins.go
Lines 28 to 59 in d2c7ba3
There are currently some known use cases in Terraform schema:
for_each
- map or setdepends_on
- multiple scopes (data, module, resource)hcl-lang/decoder/extension_schemas.go
Lines 23 to 33 in d2c7ba3
See also https://github.com/search?q=repo%3Ahashicorp%2Fterraform-schema+OfScopeId&type=code
Proposal
We should explore some more elegant ways of expressing such a constraint.
One possible solution would be to just introduce plural version
OfType
andOfScopeId
, where validation ensures that either singular or plural is used (not both).The text was updated successfully, but these errors were encountered: