Skip to content

Commit c18b7a9

Browse files
authored
fix: Random snuba crashes found by hypothesis-jsonschema (#132)
1 parent b77a2d5 commit c18b7a9

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

schemas/snuba-generic-metrics.v1.schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"type": "string"
2525
},
2626
"timestamp": {
27-
"type": "integer"
27+
"type": "integer",
28+
"minimum": 0
2829
},
2930
"sentry_received_timestamp": {
3031
"type": "number"

schemas/snuba-metrics.v1.schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"type": "string"
2525
},
2626
"timestamp": {
27-
"type": "integer"
27+
"type": "integer",
28+
"minimum": 0
2829
},
2930
"sentry_received_timestamp": {
3031
"type": "number"

schemas/snuba-queries.v1.schema.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"type": "object",
99
"properties": {
1010
"id": {
11-
"type": "string"
11+
"type": "string",
12+
"pattern": "[0-9a-fA-F]{32}"
1213
},
1314
"body": {
1415
"type": "object"
@@ -25,7 +26,8 @@
2526
"feature": {
2627
"type": ["string", "null"]
2728
}
28-
}
29+
},
30+
"required": ["id"]
2931
},
3032
"dataset": {
3133
"type": "string"

schemas/transactions.v1.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"type": "null"
7777
}
7878
},
79-
"required": []
79+
"required": ["data"]
8080
},
8181
"AppContext": {
8282
"description": " Application information.\n\n App context describes the application. As opposed to the runtime, this is the actual\n application that was running and carries metadata about the current session.",

0 commit comments

Comments
 (0)