Skip to content

Commit c0f8cbb

Browse files
authored
Override duration fields for AlertRuleGroupExport and AlertRuleExport (#102)
- Duration fields are mapped to integer in OpenAPI spec - Add override to string to fix the client
1 parent 134a3bf commit c0f8cbb

File tree

3 files changed

+9
-132
lines changed

3 files changed

+9
-132
lines changed

models/alert_rule_export.go

Lines changed: 2 additions & 88 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/alert_rule_group_export.go

Lines changed: 1 addition & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/pull-schema.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ modify '.definitions.ReportSchedule.properties.endDate["x-nullable"] = true'
3232
modify '.definitions.TimeInterval.properties.time_intervals.items["$ref"] = "#/definitions/TimeIntervalItem"'
3333
modify '.definitions.MuteTimeInterval.properties.time_intervals.items["$ref"] = "#/definitions/TimeIntervalItem"'
3434

35+
# TODO: Upstream fix (https://github.com/grafana/grafana/issues/94936)
36+
modify '.definitions.AlertRuleGroupExport.properties.interval = { "type" : "string"} '
37+
modify '.definitions.AlertRuleExport.properties.for = { "type" : "string"} '
38+
modify '.definitions.AlertRuleExport.properties.keepFiringFor = { "type" : "string"} '
39+
40+
3541
# "Unstructured" should truly be unstructured. Not an object with an "Object" property that allows anything.
3642
modify '.definitions.Unstructured.properties = {}'
3743

0 commit comments

Comments
 (0)