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
Currently, there isn't a standard method for cleanly validating the child members of an Object. For example, to require exactly one of a set of attributes we need add an ExactlyOneOf validator on one of the child attributes, as below. Until #118 is resolved, we also have to add path.MatchRelative() as a self-reference.
No attribute specified when one (and only one) of
[rule[0].expiration[0].expired_object_delete_marker,rule[0].expiration[0].expired_object_delete_marker.<.date,rule[0].expiration[0].expired_object_delete_marker.<.days]
which is hard to read, especially the references to the attributes with the AtParent relationship, such as rule[0].expiration[0].expired_object_delete_marker.<.days. I would also recommend adding a space after the , and possibly demarcate the individual attributes with some form of quotation marks.
Using objectvalidator.ExactlyOneOf on the Object includes the object itself in the count, so cannot be used.
Proposal
Add validators such as objectvalidator.ExactlyOneOfChildren which would act like the non-Children version but not count itself. For example, in the case above, the following validator would be set on the Object
Terraform CLI and Framework Versions
All
Use Cases or Problem Statement
Currently, there isn't a standard method for cleanly validating the child members of an Object. For example, to require exactly one of a set of attributes we need add an
ExactlyOneOf
validator on one of the child attributes, as below. Until #118 is resolved, we also have to addpath.MatchRelative()
as a self-reference.However, the error message displayed is
which is hard to read, especially the references to the attributes with the
AtParent
relationship, such asrule[0].expiration[0].expired_object_delete_marker.<.days
. I would also recommend adding a space after the,
and possibly demarcate the individual attributes with some form of quotation marks.Using
objectvalidator.ExactlyOneOf
on the Object includes the object itself in the count, so cannot be used.Proposal
Add validators such as
objectvalidator.ExactlyOneOfChildren
which would act like the non-Children
version but not count itself. For example, in the case above, the following validator would be set on the ObjectAdditional Information
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: