Request for isEmpty()
Set operator
#1356
Labels
feature-request
This issue requets a substantial new feature
pending-review
A Cedar maintainer has looked at this, but believes it needs review by more of the core team
Category
Cedar language or syntax features/changes
Describe the feature you'd like to request
The request is to add an
isEmpty()
operator that when applied toSet
s, returns a boolean describing whether the set is empty or not. This should be a valid operator usage even when validation is enabled. The following would be a sample usage:Today, if validation is not enabled, we can check for set emptiness with
context.mySet == []
. However, according to the docs,[]
is not considered a valid Set. So, this syntax as is will not work when validation is enabled.There exists a workaround today (credit to Craig Disselkoen) for when validation is enabled.
It would be great if users did not need to add workaround attributes to their contexts to mimic this state -- hence, an
isEmpty()
operator.Describe alternatives you've considered
There exists a workaround today in the event that validation is enabled, but it can be inconvenient to define a separate attribute per type of Set. The workaround is copied above.
Additional context
No response
Is this something that you'd be interested in working on?
The text was updated successfully, but these errors were encountered: