CacheControl / CacheControl/json-rules-engine
Support for optional object properties
- 主要語言
- JavaScript
- 星號
- 3.1k
- 分支
- 507
- PR 合併指標
- 30 天內沒有已合併 PR
描述
Let's say we have the following Fact:
```
{
"firstName": "John",
"lastName" : "doe",
"age" : 26,
"address" : {
"streetAddress": "naist street",
"city" : "Nara",
"postalCode" : "630-0192"
},
"phoneNumbers": [
{
"type" : "iPhone",
"number": "0123-4567-8888"
},
{
"type" : "home",
"number": "0123-4567-8910"
}
]
}
```
The following rule snippet should return true in my understanding:
```
{
fact: 'a',
path: `$..phoneNumbers..title`,
operator: 'doesNotContain',
value: 'SOMETITLE'
},
```
However this will evaluate to false, as "title" is not present in the object.
The actual use case I have is that the dynamic fact ist an array of objects which can be an empty array sometimes (due to input params for the fact).
Supporting this use case would be very valuable, otherwise additional custom operators are necessary.
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
沒有指定檔案、測試或進入點。使用缺少的標題和空物件陣列重現所提供的事實和規則,然後追蹤 JSON 路徑和 doesNotContain 評估;當所要求的選用屬性案例在不需要自訂運算子的情況下傳回預期結果時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- javascript
- 領域
- backend
- Issue 類型
- 功能
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100