Skip to content

Make assertion target be int or string #2209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-05-14 15:44:19.067688",
"spec_repo_commit": "64f5e7ee"
"regenerated": "2025-05-14 18:18:46.632078",
"spec_repo_commit": "9d44adf0"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-05-14 15:44:19.084378",
"spec_repo_commit": "64f5e7ee"
"regenerated": "2025-05-14 18:18:46.648216",
"spec_repo_commit": "9d44adf0"
}
}
}
19 changes: 17 additions & 2 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14221,8 +14221,8 @@ components:
operator:
$ref: '#/components/schemas/SyntheticsAssertionBodyHashOperator'
target:
$ref: '#/components/schemas/SyntheticsAssertionTargetValue'
description: Value used by the operator.
example: 123456
type:
$ref: '#/components/schemas/SyntheticsAssertionBodyHashType'
required:
Expand Down Expand Up @@ -14278,6 +14278,7 @@ components:
description: The specific operator to use on the path.
type: string
targetValue:
$ref: '#/components/schemas/SyntheticsAssertionTargetValue'
description: The path target value to compare to.
type: object
SyntheticsAssertionJSONSchemaMetaSchema:
Expand Down Expand Up @@ -14385,8 +14386,8 @@ components:
description: The associated assertion property.
type: string
target:
$ref: '#/components/schemas/SyntheticsAssertionTargetValue'
description: Value used by the operator.
example: 123456
timingsScope:
$ref: '#/components/schemas/SyntheticsAssertionTimingsScope'
type:
Expand All @@ -14396,6 +14397,19 @@ components:
- operator
- target
type: object
SyntheticsAssertionTargetValue:
description: Value used by the operator in assertions. Can be either a number
or string.
oneOf:
- $ref: '#/components/schemas/SyntheticsAssertionTargetValueNumber'
- $ref: '#/components/schemas/SyntheticsAssertionTargetValueString'
SyntheticsAssertionTargetValueNumber:
description: Numeric value used by the operator in assertions.
format: int64
type: integer
SyntheticsAssertionTargetValueString:
description: String value used by the operator in assertions.
type: string
SyntheticsAssertionTimingsScope:
description: Timings scope for response time assertions.
enum:
Expand Down Expand Up @@ -14480,6 +14494,7 @@ components:
description: The specific operator to use on the path.
type: string
targetValue:
$ref: '#/components/schemas/SyntheticsAssertionTargetValue'
description: The path target value to compare to.
xPath:
description: The X path to assert.
Expand Down
1 change: 1 addition & 0 deletions packages/datadog-api-client-v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@ export { SyntheticsAssertionJSONSchemaTarget } from "./models/SyntheticsAssertio
export { SyntheticsAssertionJSONSchemaTargetTarget } from "./models/SyntheticsAssertionJSONSchemaTargetTarget";
export { SyntheticsAssertionOperator } from "./models/SyntheticsAssertionOperator";
export { SyntheticsAssertionTarget } from "./models/SyntheticsAssertionTarget";
export { SyntheticsAssertionTargetValue } from "./models/SyntheticsAssertionTargetValue";
export { SyntheticsAssertionTimingsScope } from "./models/SyntheticsAssertionTimingsScope";
export { SyntheticsAssertionType } from "./models/SyntheticsAssertionType";
export { SyntheticsAssertionXPathOperator } from "./models/SyntheticsAssertionXPathOperator";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2450,6 +2450,7 @@ const oneOfMap: { [index: string]: string[] } = {
"SyntheticsAssertionXPathTarget",
"SyntheticsAssertionJavascript",
],
SyntheticsAssertionTargetValue: ["number", "string"],
SyntheticsBasicAuth: [
"SyntheticsBasicAuthWeb",
"SyntheticsBasicAuthSigv4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
import { SyntheticsAssertionBodyHashOperator } from "./SyntheticsAssertionBodyHashOperator";
import { SyntheticsAssertionBodyHashType } from "./SyntheticsAssertionBodyHashType";
import { SyntheticsAssertionTargetValue } from "./SyntheticsAssertionTargetValue";

import { AttributeTypeMap } from "../../datadog-api-client-common/util";

Expand All @@ -17,9 +18,9 @@ export class SyntheticsAssertionBodyHashTarget {
*/
"operator": SyntheticsAssertionBodyHashOperator;
/**
* Value used by the operator.
* Value used by the operator in assertions. Can be either a number or string.
*/
"target": any;
"target": SyntheticsAssertionTargetValue;
/**
* Type of the assertion.
*/
Expand Down Expand Up @@ -48,7 +49,7 @@ export class SyntheticsAssertionBodyHashTarget {
},
target: {
baseName: "target",
type: "any",
type: "SyntheticsAssertionTargetValue",
required: true,
},
type: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/
import { SyntheticsAssertionTargetValue } from "./SyntheticsAssertionTargetValue";

import { AttributeTypeMap } from "../../datadog-api-client-common/util";

Expand All @@ -23,9 +24,9 @@ export class SyntheticsAssertionJSONPathTargetTarget {
*/
"operator"?: string;
/**
* The path target value to compare to.
* Value used by the operator in assertions. Can be either a number or string.
*/
"targetValue"?: any;
"targetValue"?: SyntheticsAssertionTargetValue;

/**
* A container for additional, undeclared properties.
Expand Down Expand Up @@ -57,7 +58,7 @@ export class SyntheticsAssertionJSONPathTargetTarget {
},
targetValue: {
baseName: "targetValue",
type: "any",
type: "SyntheticsAssertionTargetValue",
},
additionalProperties: {
baseName: "additionalProperties",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Copyright 2020-Present Datadog, Inc.
*/
import { SyntheticsAssertionOperator } from "./SyntheticsAssertionOperator";
import { SyntheticsAssertionTargetValue } from "./SyntheticsAssertionTargetValue";
import { SyntheticsAssertionTimingsScope } from "./SyntheticsAssertionTimingsScope";
import { SyntheticsAssertionType } from "./SyntheticsAssertionType";

Expand All @@ -22,9 +23,9 @@ export class SyntheticsAssertionTarget {
*/
"property"?: string;
/**
* Value used by the operator.
* Value used by the operator in assertions. Can be either a number or string.
*/
"target": any;
"target": SyntheticsAssertionTargetValue;
/**
* Timings scope for response time assertions.
*/
Expand Down Expand Up @@ -61,7 +62,7 @@ export class SyntheticsAssertionTarget {
},
target: {
baseName: "target",
type: "any",
type: "SyntheticsAssertionTargetValue",
required: true,
},
timingsScope: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/

import { UnparsedObject } from "../../datadog-api-client-common/util";

/**
* Value used by the operator in assertions. Can be either a number or string.
*/

export type SyntheticsAssertionTargetValue = number | string | UnparsedObject;
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/
import { SyntheticsAssertionTargetValue } from "./SyntheticsAssertionTargetValue";

import { AttributeTypeMap } from "../../datadog-api-client-common/util";

Expand All @@ -15,9 +16,9 @@ export class SyntheticsAssertionXPathTargetTarget {
*/
"operator"?: string;
/**
* The path target value to compare to.
* Value used by the operator in assertions. Can be either a number or string.
*/
"targetValue"?: any;
"targetValue"?: SyntheticsAssertionTargetValue;
/**
* The X path to assert.
*/
Expand Down Expand Up @@ -45,7 +46,7 @@ export class SyntheticsAssertionXPathTargetTarget {
},
targetValue: {
baseName: "targetValue",
type: "any",
type: "SyntheticsAssertionTargetValue",
},
xPath: {
baseName: "xPath",
Expand Down