@@ -670,7 +670,7 @@ paths:
670
670
conditions :
671
671
type : array
672
672
items :
673
- $ref : " #/components/schemas/ProjectRuleCondition "
673
+ $ref : " #/components/schemas/ProjectRuleConditionToApi "
674
674
filters :
675
675
type : array
676
676
items :
@@ -767,7 +767,7 @@ paths:
767
767
conditions :
768
768
type : array
769
769
items :
770
- $ref : " #/components/schemas/ProjectRuleCondition "
770
+ $ref : " #/components/schemas/ProjectRuleConditionToApi "
771
771
filters :
772
772
type : array
773
773
items :
@@ -1327,6 +1327,14 @@ components:
1327
1327
type : array
1328
1328
items :
1329
1329
$ref : " #/components/schemas/ProjectRuleAction"
1330
+
1331
+ # There is arguably a bug in the Sentry API where integer values of 0 will
1332
+ # be stripped from submitted payload objects because of Python's implicit
1333
+ # bool conversions. These values can successfully be submitted as strings.
1334
+ # When these objects are retrieved from the API, the values are integers.
1335
+ # To model this, we have two different schemas for rule conditions based
1336
+ # based on whether we're sending them to the API or retriving them from
1337
+ # the API: ProjectRuleCondition and ProjectRuleConditionToApi.
1330
1338
ProjectRuleCondition :
1331
1339
oneOf :
1332
1340
- $ref : " #/components/schemas/ProjectRuleConditionFirstSeenEvent"
@@ -1348,6 +1356,28 @@ components:
1348
1356
" sentry.rules.conditions.event_frequency.EventFrequencyCondition " : " #/components/schemas/ProjectRuleConditionEventFrequency"
1349
1357
" sentry.rules.conditions.event_frequency.EventUniqueUserFrequencyCondition " : " #/components/schemas/ProjectRuleConditionEventUniqueUserFrequency"
1350
1358
" sentry.rules.conditions.event_frequency.EventFrequencyPercentCondition " : " #/components/schemas/ProjectRuleConditionEventFrequencyPercent"
1359
+
1360
+ ProjectRuleConditionToApi :
1361
+ oneOf :
1362
+ - $ref : " #/components/schemas/ProjectRuleConditionFirstSeenEvent"
1363
+ - $ref : " #/components/schemas/ProjectRuleConditionRegressionEvent"
1364
+ - $ref : " #/components/schemas/ProjectRuleConditionReappearedEvent"
1365
+ - $ref : " #/components/schemas/ProjectRuleConditionNewHighPriorityIssue"
1366
+ - $ref : " #/components/schemas/ProjectRuleConditionExistingHighPriorityIssue"
1367
+ - $ref : " #/components/schemas/ProjectRuleConditionEventFrequencyToApi"
1368
+ - $ref : " #/components/schemas/ProjectRuleConditionEventUniqueUserFrequencyToApi"
1369
+ - $ref : " #/components/schemas/ProjectRuleConditionEventFrequencyPercentToApi"
1370
+ discriminator :
1371
+ propertyName : id
1372
+ mapping :
1373
+ " sentry.rules.conditions.first_seen_event.FirstSeenEventCondition " : " #/components/schemas/ProjectRuleConditionFirstSeenEvent"
1374
+ " sentry.rules.conditions.regression_event.RegressionEventCondition " : " #/components/schemas/ProjectRuleConditionRegressionEvent"
1375
+ " sentry.rules.conditions.reappeared_event.ReappearedEventCondition " : " #/components/schemas/ProjectRuleConditionReappearedEvent"
1376
+ " sentry.rules.conditions.high_priority_issue.NewHighPriorityIssueCondition " : " #/components/schemas/ProjectRuleConditionNewHighPriorityIssue"
1377
+ " sentry.rules.conditions.high_priority_issue.ExistingHighPriorityIssueCondition " : " #/components/schemas/ProjectRuleConditionExistingHighPriorityIssue"
1378
+ " sentry.rules.conditions.event_frequency.EventFrequencyCondition " : " #/components/schemas/ProjectRuleConditionEventFrequencyToApi"
1379
+ " sentry.rules.conditions.event_frequency.EventUniqueUserFrequencyCondition " : " #/components/schemas/ProjectRuleConditionEventUniqueUserFrequencyToApi"
1380
+ " sentry.rules.conditions.event_frequency.EventFrequencyPercentCondition " : " #/components/schemas/ProjectRuleConditionEventFrequencyPercentToApi"
1351
1381
ProjectRuleConditionFirstSeenEvent :
1352
1382
type : object
1353
1383
required :
@@ -1426,6 +1456,28 @@ components:
1426
1456
format : int64
1427
1457
interval :
1428
1458
type : string
1459
+ ProjectRuleConditionEventFrequencyToApi :
1460
+ type : object
1461
+ required :
1462
+ - id
1463
+ - comparisonType
1464
+ - value
1465
+ - interval
1466
+ properties :
1467
+ id :
1468
+ type : string
1469
+ enum :
1470
+ - " sentry.rules.conditions.event_frequency.EventFrequencyCondition"
1471
+ name :
1472
+ type : string
1473
+ comparisonType :
1474
+ type : string
1475
+ comparisonInterval :
1476
+ type : string
1477
+ value :
1478
+ type : string
1479
+ interval :
1480
+ type : string
1429
1481
ProjectRuleConditionEventUniqueUserFrequency :
1430
1482
type : object
1431
1483
required :
@@ -1449,6 +1501,28 @@ components:
1449
1501
format : int64
1450
1502
interval :
1451
1503
type : string
1504
+ ProjectRuleConditionEventUniqueUserFrequencyToApi :
1505
+ type : object
1506
+ required :
1507
+ - id
1508
+ - comparisonType
1509
+ - value
1510
+ - interval
1511
+ properties :
1512
+ id :
1513
+ type : string
1514
+ enum :
1515
+ - " sentry.rules.conditions.event_frequency.EventUniqueUserFrequencyCondition"
1516
+ name :
1517
+ type : string
1518
+ comparisonType :
1519
+ type : string
1520
+ comparisonInterval :
1521
+ type : string
1522
+ value :
1523
+ type : string
1524
+ interval :
1525
+ type : string
1452
1526
ProjectRuleConditionEventFrequencyPercent :
1453
1527
type : object
1454
1528
required :
@@ -1472,6 +1546,28 @@ components:
1472
1546
format : double
1473
1547
interval :
1474
1548
type : string
1549
+ ProjectRuleConditionEventFrequencyPercentToApi :
1550
+ type : object
1551
+ required :
1552
+ - id
1553
+ - comparisonType
1554
+ - value
1555
+ - interval
1556
+ properties :
1557
+ id :
1558
+ type : string
1559
+ enum :
1560
+ - " sentry.rules.conditions.event_frequency.EventFrequencyPercentCondition"
1561
+ name :
1562
+ type : string
1563
+ comparisonType :
1564
+ type : string
1565
+ comparisonInterval :
1566
+ type : string
1567
+ value :
1568
+ type : string
1569
+ interval :
1570
+ type : string
1475
1571
ProjectRuleFilter :
1476
1572
oneOf :
1477
1573
- $ref : " #/components/schemas/ProjectRuleFilterAgeComparison"
0 commit comments