con2 / emrichen

A Template engine for YAML & JSON
MIT License
107 stars 11 forks source link

Implement conditionals #9

Closed japsu closed 6 years ago

japsu commented 6 years ago

Use cases:

Simple conditions (Python truthiness of a value) are easy to implement. How about complex predicates (==, <, <=, >, >= etc.)?

Switching to a JSONPath implementation that supports ? is one option. Then we could just use !Lookup in the condition.

We do not want to execute Python to resolve the condition.

akx commented 6 years ago

I think we should support most of the operators exposed by the operator module, because it's easy to do.

In addition, AND and OR need to be available somehow. Trees thereof maybe not, so maybe allOf and anyOf for conditions.

japsu commented 6 years ago

Original CoA met, closing. Create new issues of missing functionality if any.