Skip to content

Commit 754efce

Browse files
authored
fix(specs): allow one sided rule validity (#5060)
1 parent d7c5cd8 commit 754efce

File tree

4 files changed

+332
-177
lines changed

4 files changed

+332
-177
lines changed

specs/common/schemas/Rule.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,3 @@ timeRange:
1919
type: integer
2020
format: int64
2121
description: When the rule should stop to be active, in Unix epoch time.
22-
required:
23-
- from
24-
- until

templates/go/guides/search/useConditionlessRule.mustache

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ func useConditionlessRule() {
1818
*search.NewConsequence(/* Set relevant consequence */),
1919
). // Set validity (optional)
2020
SetValidity(
21-
[]search.TimeRange{
22-
*search.NewTimeRange(1_688_774_400, 1_738_972_800),
23-
},
24-
)
21+
[]search.TimeRange{ {
22+
From: utils.ToPtr(int64(1_688_774_400)),
23+
Until: utils.ToPtr(int64(1_738_972_800)),
24+
}},
25+
)
2526

2627
_, err = {{#dynamicSnippet}}saveRule{{/dynamicSnippet}}
2728
if err != nil {

templates/scala/guides/search/useConditionlessRule.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def useConditionlessRule(): Future[Unit] = {
1717
// Set validity (optional)
1818
validity = Some(Seq(
1919
TimeRange(
20-
from = 1_688_774_400,
21-
until = 1_738_972_800
20+
from = Some(1_688_774_400),
21+
until = Some(1_738_972_800)
2222
)
2323
))
2424
)

0 commit comments

Comments
 (0)