Azure / Azure/template-analyzer

Support recursive wildcard in Evaluation path for JSON rules

Open
#86 2 comments 0 reactions 0 assignees View on GitHub
enhancement revisit
Dominant language
C#
Stars
143
Forks
47
PR merge metrics
No merged PRs in 30d

Description

Allow `path` to specify a wildcard that should add all matching property children recursively in the template path. One suggestion is to use "**" to represent a recursive wildcard.

## Examples
### Template JSON to evaluate
``` js
{
"prop1": {
"child1": {
"value1": 1,
"value2": 2
}
},
"prop2": {
"child2": {
"value1": 1,
"value3": 3
},
"child3": {
"value1": 1,
"value4": 4
}
}
}
```
### Rule Evaluation 1
``` js
{
"path": "prop1.**"
// ...
}
```
**Paths evaluated**
`prop1.child1.value1`
`prop1.child1.value2`

### Rule Evaluation 2
``` js
{
"path": "**.value1"
// ...
}
```
**Paths evaluated**
`prop1.child1.value1`
`prop2.child2.value1`
`prop2.child3.value1`

### Rule Evaluation 2
``` js
{
"path": "**"
// ...
}
```
**Paths evaluated**
`prop1.child1.value1`
`prop1.child1.value2`
`prop2.child2.value1`
`prop2.child2.value3`
`prop2.child3.value1`
`prop2.child3.value4`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.