Skip to content

Commit 2d20c14

Browse files
api-clients-generation-pipeline[bot]skarimoci.datadog-api-spec
authored
Add test support for file parameters (#1491)
* correctly handle file parameters in bdd * Regenerate client from commit b407748b of spec repo --------- Co-authored-by: Sherzod Karimov <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 4897d61 commit 2d20c14

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
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-01-18 23:59:54.263751",
8-
"spec_repo_commit": "7dba000a"
7+
"regenerated": "2024-01-19 15:18:16.953455",
8+
"spec_repo_commit": "b407748b"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-01-18 23:59:54.282131",
13-
"spec_repo_commit": "7dba000a"
12+
"regenerated": "2024-01-19 15:18:16.970683",
13+
"spec_repo_commit": "b407748b"
1414
}
1515
}
1616
}

features/step_definitions/request_steps.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,21 @@ When("the request is sent", async function (this: World) {
116116
// Deserialize obejcts into correct model types
117117
const objectSerializer = getProperty(datadogApiClient, this.apiVersion).ObjectSerializer;
118118
Object.keys(this.opts).forEach(key => {
119-
this.opts[key] = objectSerializer.deserialize(
120-
this.opts[key],
121-
ScenariosModelMappings[`${this.apiVersion}.${this.operationId}`][key].type,
122-
ScenariosModelMappings[`${this.apiVersion}.${this.operationId}`][key].format
123-
)
119+
const type = ScenariosModelMappings[`${this.apiVersion}.${this.operationId}`][key].type
120+
const format = ScenariosModelMappings[`${this.apiVersion}.${this.operationId}`][key].format
121+
122+
if (type === "HttpFile" && format === "binary") {
123+
this.opts[key] = {
124+
data: Buffer.from(fs.readFileSync(path.join(__dirname, `../${this.apiVersion}`, this.opts[key]))),
125+
name: this.opts[key],
126+
};
127+
} else {
128+
this.opts[key] = objectSerializer.deserialize(
129+
this.opts[key],
130+
type,
131+
format
132+
)
133+
}
124134
});
125135

126136
// store request context from response processor

features/v2/organizations.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Feature: Organizations
2020
When the request is sent
2121
Then the response status is 400 Bad Request
2222

23-
@skip-go @skip-java @skip-python @skip-ruby @skip-terraform-config @skip-typescript @skip-validation @team:DataDog/team-aaa-identity
23+
@integration-only @skip-terraform-config @skip-validation @team:DataDog/team-aaa-identity
2424
Scenario: Upload IdP metadata returns "OK" response
2525
Given request contains "idp_file" parameter with value "fixtures/organizations/saml_configurations/valid_idp_metadata.xml"
2626
When the request is sent

0 commit comments

Comments
 (0)