Skip to content

Commit 118f657

Browse files
committed
fix step validator issue
1 parent 7c39ae5 commit 118f657

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/schemas/monitoring_metrics.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ class MetricsSchema(Schema):
55
start = fields.Float()
66
end = fields.Float()
77
step = fields.String(validate=[
8-
validate.OneOf(["year", "month"],
9-
error='set_by should be year or month'
10-
)
8+
validate.Regexp(
9+
regex=r'^(?!\s*$)', error='step value should be a valid string'
10+
)
1111
])
1212
project_id = fields.String()
1313
project_name = fields.String()

0 commit comments

Comments
 (0)