cedar-policy / cedar-docs

Documentation for Cedar policy language
https://docs.cedarpolicy.com
Apache License 2.0
22 stars 19 forks source link

[Cedar Doc Issue] Documentation missing for if-then-else operator #51

Closed D-McAdams closed 11 months ago

D-McAdams commented 11 months ago

What were you trying to do? I was trying to remember the grammar for if-then-else

What is wrong and why? This isn't documented in https://docs.cedarpolicy.com/policies/syntax-operators.html

What do we need to do to fix this? Add documenation

mwhicks1 commented 11 months ago

The grammar for if expressions is here: https://docs.cedarpolicy.com/policies/syntax-grammar.html. if is not an operator, which is why it wasn't given on the page you reference.

D-McAdams commented 11 months ago

Technically true, but in the spirit of documentation, it's effectively undocumented because mortals (like myself) don't read the grammar and memorize the subparts of the EXPR token to learn an if-then-else capability exists and how to use it ; )

Recommend adding to the list of operators, and if not literally an operator, perhaps adjust the chapter heading to reflect a broader scope instead of omitting the capability. As an end-user, I am seeking a plain-English reference for "all the different types of conditions that can be written".

mwhicks1 commented 11 months ago

Good call. There's no description of the semantics of if right now, in any case, even though the grammar is elsewhere. So: See https://github.com/cedar-policy/cedar-docs/pull/53