Skip to content

Commit 44c1597

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add required examples rule (#2121)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 691ab4d commit 44c1597

File tree

3 files changed

+68
-12
lines changed

3 files changed

+68
-12
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-08-20 17:44:52.936638",
8-
"spec_repo_commit": "2d74b3a8"
7+
"regenerated": "2024-08-21 13:16:23.612246",
8+
"spec_repo_commit": "be697120"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-08-20 17:44:52.954012",
13-
"spec_repo_commit": "2d74b3a8"
12+
"regenerated": "2024-08-21 13:16:23.628996",
13+
"spec_repo_commit": "be697120"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ components:
3939
properties:
4040
errors:
4141
description: Array of errors returned by the API.
42+
example:
43+
- Bad Request
4244
items:
4345
description: Error description.
4446
example: Bad Request
@@ -1683,6 +1685,10 @@ components:
16831685
description: Points relating to the distribution point metric. All points
16841686
must be tuples with timestamp and a list of values (cannot be a string).
16851687
Timestamps should be in POSIX time in seconds.
1688+
example:
1689+
- - 1575317847.0
1690+
- - 0.5
1691+
- 1.0
16861692
items:
16871693
$ref: '#/components/schemas/DistributionPoint'
16881694
type: array
@@ -9313,13 +9319,17 @@ components:
93139319
properties:
93149320
keys:
93159321
description: Keys to split on.
9322+
example:
9323+
- environment
93169324
items:
93179325
description: A key to split on.
93189326
example: environment
93199327
type: string
93209328
type: array
93219329
tags:
93229330
description: Tags to split on.
9331+
example:
9332+
- environment:staging
93239333
items:
93249334
description: A tag to split on.
93259335
example: environment:staging
@@ -10532,6 +10542,7 @@ components:
1053210542
description: A formula and function query.
1053310543
example:
1053410544
data_source: metrics
10545+
name: query1
1053510546
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
1053610547
oneOf:
1053710548
- $ref: '#/components/schemas/FormulaAndFunctionMetricQueryDefinition'
@@ -11596,13 +11607,19 @@ components:
1159611607
formulas:
1159711608
description: A list that contains exactly one formula, as only a single
1159811609
formula may be used in a time-slice SLO.
11610+
example:
11611+
- formula: query1 - default_zero(query2)
1159911612
items:
1160011613
$ref: '#/components/schemas/SLOFormula'
1160111614
maxItems: 1
1160211615
minItems: 1
1160311616
type: array
1160411617
queries:
1160511618
description: A list of queries that are used to calculate the SLI value.
11619+
example:
11620+
- data_source: metrics
11621+
name: query1
11622+
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
1160611623
items:
1160711624
$ref: '#/components/schemas/SLODataSourceQueryDefinition'
1160811625
type: array
@@ -12317,6 +12334,9 @@ components:
1231712334
timestamp and a scalar value (cannot be a string). Timestamps should be
1231812335
in POSIX time in seconds, and cannot be more than ten minutes in the future
1231912336
or more than one hour in the past.
12337+
example:
12338+
- - 1575317847.0
12339+
- 0.5
1232012340
items:
1232112341
$ref: '#/components/schemas/Point'
1232212342
type: array
@@ -13164,6 +13184,8 @@ components:
1316413184
$ref: '#/components/schemas/SplitSort'
1316513185
split_dimensions:
1316613186
description: The dimension(s) on which to split the graph
13187+
example:
13188+
- one_graph_per: service
1316713189
items:
1316813190
$ref: '#/components/schemas/SplitDimension'
1316913191
maxItems: 1

.generator/schemas/v2/openapi.yaml

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,8 @@ components:
662662
properties:
663663
errors:
664664
description: A list of errors.
665+
example:
666+
- Bad Request
665667
items:
666668
description: A list of items.
667669
example: Bad Request
@@ -9402,6 +9404,19 @@ components:
94029404
were created or updated by the request are
94039405

94049406
returned.'
9407+
example:
9408+
- attributes:
9409+
attachment:
9410+
documentUrl: ''
9411+
title: Postmortem IR-123
9412+
attachment_type: postmortem
9413+
id: 00000000-abcd-0002-0000-000000000000
9414+
relationships:
9415+
last_modified_by_user:
9416+
data:
9417+
id: 00000000-0000-0000-cccc-000000000000
9418+
type: users
9419+
type: incident_attachments
94059420
items:
94069421
$ref: '#/components/schemas/IncidentAttachmentData'
94079422
type: array
@@ -9433,6 +9448,19 @@ components:
94339448
properties:
94349449
data:
94359450
description: An array of incident attachments.
9451+
example:
9452+
- attributes:
9453+
attachment:
9454+
documentUrl: ''
9455+
title: Postmortem IR-123
9456+
attachment_type: postmortem
9457+
id: 00000000-abcd-0002-0000-000000000000
9458+
relationships:
9459+
last_modified_by_user:
9460+
data:
9461+
id: 00000000-0000-0000-cccc-000000000000
9462+
type: users
9463+
type: incident_attachments
94369464
items:
94379465
$ref: '#/components/schemas/IncidentAttachmentData'
94389466
type: array
@@ -9526,8 +9554,6 @@ components:
95269554
oneOf:
95279555
- $ref: '#/components/schemas/IncidentFieldAttributesSingleValue'
95289556
- $ref: '#/components/schemas/IncidentFieldAttributesMultipleValue'
9529-
required:
9530-
- type
95319557
IncidentFieldAttributesMultipleValue:
95329558
description: A field with potentially multiple values selected.
95339559
properties:
@@ -10644,6 +10670,8 @@ components:
1064410670
- $ref: '#/components/schemas/IncidentTodoAnonymousAssignee'
1064510671
IncidentTodoAssigneeArray:
1064610672
description: Array of todo assignees.
10673+
example:
10674+
1064710675
items:
1064810676
$ref: '#/components/schemas/IncidentTodoAssignee'
1064910677
type: array
@@ -11800,9 +11828,6 @@ components:
1180011828
- $ref: '#/components/schemas/LogsArchiveDestinationAzure'
1180111829
- $ref: '#/components/schemas/LogsArchiveDestinationGCS'
1180211830
- $ref: '#/components/schemas/LogsArchiveDestinationS3'
11803-
required:
11804-
- type
11805-
- integration
1180611831
LogsArchiveDefinition:
1180711832
description: The definition of an archive.
1180811833
properties:
@@ -11829,9 +11854,6 @@ components:
1182911854
- $ref: '#/components/schemas/LogsArchiveDestinationAzure'
1183011855
- $ref: '#/components/schemas/LogsArchiveDestinationGCS'
1183111856
- $ref: '#/components/schemas/LogsArchiveDestinationS3'
11832-
required:
11833-
- type
11834-
- integration
1183511857
type: object
1183611858
LogsArchiveDestinationAzure:
1183711859
description: The Azure archive destination.
@@ -13349,6 +13371,9 @@ components:
1334913371
timestamp and a scalar value (cannot be a string). Timestamps should be
1335013372
in POSIX time in seconds, and cannot be more than ten minutes in the future
1335113373
or more than one hour in the past.
13374+
example:
13375+
- timestamp: 1575317847
13376+
value: 0.5
1335213377
items:
1335313378
$ref: '#/components/schemas/MetricPoint'
1335413379
type: array
@@ -17700,6 +17725,10 @@ components:
1770017725
type: object
1770117726
ScalarFormulaRequestQueries:
1770217727
description: List of queries to be run and used as inputs to the formulas.
17728+
example:
17729+
- aggregator: avg
17730+
data_source: metrics
17731+
query: avg:system.cpu.user{*} by {env}
1770317732
items:
1770417733
$ref: '#/components/schemas/ScalarQuery'
1770517734
type: array
@@ -18658,6 +18687,8 @@ components:
1865818687
type: object
1865918688
SecurityMonitoringSignalIncidentIds:
1866018689
description: Array of incidents that are associated with this signal.
18690+
example:
18691+
- 2066
1866118692
items:
1866218693
description: Public ID attribute of the incident that is associated with the
1866318694
signal.
@@ -23176,6 +23207,9 @@ components:
2317623207
type: object
2317723208
TimeseriesFormulaRequestQueries:
2317823209
description: List of queries to be run and used as inputs to the formulas.
23210+
example:
23211+
- data_source: metrics
23212+
query: avg:system.cpu.user{*} by {env}
2317923213
items:
2318023214
$ref: '#/components/schemas/TimeseriesQuery'
2318123215
type: array

0 commit comments

Comments
 (0)