Skip to content

Commit eb78ef4

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
[K9VULN-4477]: Remove Description and Icon URL as Required Fields From Get Framework (#655)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 416d3c0 commit eb78ef4

File tree

6 files changed

+39
-43
lines changed

6 files changed

+39
-43
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": "2025-05-13 09:46:04.726154",
8-
"spec_repo_commit": "767fe63b"
7+
"regenerated": "2025-05-13 17:47:36.777678",
8+
"spec_repo_commit": "b673a489"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-13 09:46:04.743250",
13-
"spec_repo_commit": "767fe63b"
12+
"regenerated": "2025-05-13 17:47:36.793298",
13+
"spec_repo_commit": "b673a489"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10937,8 +10937,6 @@ components:
1093710937
- handle
1093810938
- version
1093910939
- name
10940-
- description
10941-
- icon_url
1094210940
type: object
1094310941
DORADeploymentRequest:
1094410942
description: Request to create a DORA deployment event.
@@ -15262,10 +15260,6 @@ components:
1526215260
FullCustomFrameworkDataAttributes:
1526315261
description: Full Framework Data Attributes.
1526415262
properties:
15265-
description:
15266-
description: Framework Description
15267-
example: this is a security framework
15268-
type: string
1526915263
handle:
1527015264
description: Framework Handle
1527115265
example: sec2
@@ -15291,8 +15285,6 @@ components:
1529115285
- handle
1529215286
- version
1529315287
- name
15294-
- description
15295-
- icon_url
1529615288
- requirements
1529715289
type: object
1529815290
GCPMetricNamespaceConfig:

src/datadogV2/model/model_custom_framework_without_requirements.rs

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ use std::fmt::{self, Formatter};
1313
pub struct CustomFrameworkWithoutRequirements {
1414
/// Framework Description
1515
#[serde(rename = "description")]
16-
pub description: String,
16+
pub description: Option<String>,
1717
/// Framework Handle
1818
#[serde(rename = "handle")]
1919
pub handle: String,
2020
/// Framework Icon URL
2121
#[serde(rename = "icon_url")]
22-
pub icon_url: String,
22+
pub icon_url: Option<String>,
2323
/// Framework Name
2424
#[serde(rename = "name")]
2525
pub name: String,
@@ -35,23 +35,31 @@ pub struct CustomFrameworkWithoutRequirements {
3535

3636
impl CustomFrameworkWithoutRequirements {
3737
pub fn new(
38-
description: String,
3938
handle: String,
40-
icon_url: String,
4139
name: String,
4240
version: String,
4341
) -> CustomFrameworkWithoutRequirements {
4442
CustomFrameworkWithoutRequirements {
45-
description,
43+
description: None,
4644
handle,
47-
icon_url,
45+
icon_url: None,
4846
name,
4947
version,
5048
additional_properties: std::collections::BTreeMap::new(),
5149
_unparsed: false,
5250
}
5351
}
5452

53+
pub fn description(mut self, value: String) -> Self {
54+
self.description = Some(value);
55+
self
56+
}
57+
58+
pub fn icon_url(mut self, value: String) -> Self {
59+
self.icon_url = Some(value);
60+
self
61+
}
62+
5563
pub fn additional_properties(
5664
mut self,
5765
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -92,13 +100,19 @@ impl<'de> Deserialize<'de> for CustomFrameworkWithoutRequirements {
92100
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
93101
match k.as_str() {
94102
"description" => {
103+
if v.is_null() {
104+
continue;
105+
}
95106
description =
96107
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
97108
}
98109
"handle" => {
99110
handle = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
100111
}
101112
"icon_url" => {
113+
if v.is_null() {
114+
continue;
115+
}
102116
icon_url = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
103117
}
104118
"name" => {
@@ -114,10 +128,7 @@ impl<'de> Deserialize<'de> for CustomFrameworkWithoutRequirements {
114128
}
115129
}
116130
}
117-
let description =
118-
description.ok_or_else(|| M::Error::missing_field("description"))?;
119131
let handle = handle.ok_or_else(|| M::Error::missing_field("handle"))?;
120-
let icon_url = icon_url.ok_or_else(|| M::Error::missing_field("icon_url"))?;
121132
let name = name.ok_or_else(|| M::Error::missing_field("name"))?;
122133
let version = version.ok_or_else(|| M::Error::missing_field("version"))?;
123134

src/datadogV2/model/model_full_custom_framework_data_attributes.rs

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,12 @@ use std::fmt::{self, Formatter};
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct FullCustomFrameworkDataAttributes {
14-
/// Framework Description
15-
#[serde(rename = "description")]
16-
pub description: String,
1714
/// Framework Handle
1815
#[serde(rename = "handle")]
1916
pub handle: String,
2017
/// Framework Icon URL
2118
#[serde(rename = "icon_url")]
22-
pub icon_url: String,
19+
pub icon_url: Option<String>,
2320
/// Framework Name
2421
#[serde(rename = "name")]
2522
pub name: String,
@@ -38,17 +35,14 @@ pub struct FullCustomFrameworkDataAttributes {
3835

3936
impl FullCustomFrameworkDataAttributes {
4037
pub fn new(
41-
description: String,
4238
handle: String,
43-
icon_url: String,
4439
name: String,
4540
requirements: Vec<crate::datadogV2::model::CustomFrameworkRequirement>,
4641
version: String,
4742
) -> FullCustomFrameworkDataAttributes {
4843
FullCustomFrameworkDataAttributes {
49-
description,
5044
handle,
51-
icon_url,
45+
icon_url: None,
5246
name,
5347
requirements,
5448
version,
@@ -57,6 +51,11 @@ impl FullCustomFrameworkDataAttributes {
5751
}
5852
}
5953

54+
pub fn icon_url(mut self, value: String) -> Self {
55+
self.icon_url = Some(value);
56+
self
57+
}
58+
6059
pub fn additional_properties(
6160
mut self,
6261
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -83,7 +82,6 @@ impl<'de> Deserialize<'de> for FullCustomFrameworkDataAttributes {
8382
where
8483
M: MapAccess<'a>,
8584
{
86-
let mut description: Option<String> = None;
8785
let mut handle: Option<String> = None;
8886
let mut icon_url: Option<String> = None;
8987
let mut name: Option<String> = None;
@@ -99,14 +97,13 @@ impl<'de> Deserialize<'de> for FullCustomFrameworkDataAttributes {
9997

10098
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
10199
match k.as_str() {
102-
"description" => {
103-
description =
104-
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
105-
}
106100
"handle" => {
107101
handle = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
108102
}
109103
"icon_url" => {
104+
if v.is_null() {
105+
continue;
106+
}
110107
icon_url = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
111108
}
112109
"name" => {
@@ -126,17 +123,13 @@ impl<'de> Deserialize<'de> for FullCustomFrameworkDataAttributes {
126123
}
127124
}
128125
}
129-
let description =
130-
description.ok_or_else(|| M::Error::missing_field("description"))?;
131126
let handle = handle.ok_or_else(|| M::Error::missing_field("handle"))?;
132-
let icon_url = icon_url.ok_or_else(|| M::Error::missing_field("icon_url"))?;
133127
let name = name.ok_or_else(|| M::Error::missing_field("name"))?;
134128
let requirements =
135129
requirements.ok_or_else(|| M::Error::missing_field("requirements"))?;
136130
let version = version.ok_or_else(|| M::Error::missing_field("version"))?;
137131

138132
let content = FullCustomFrameworkDataAttributes {
139-
description,
140133
handle,
141134
icon_url,
142135
name,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-04-27T22:14:16.448Z
1+
2025-05-13T17:29:58.139Z

tests/scenarios/cassettes/v2/security_monitoring/Get-a-custom-framework-returns-OK-response.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"message": "OK"
3333
}
3434
},
35-
"recorded_at": "Sun, 27 Apr 2025 22:14:16 GMT"
35+
"recorded_at": "Tue, 13 May 2025 17:29:58 GMT"
3636
},
3737
{
3838
"request": {
@@ -47,7 +47,7 @@
4747
},
4848
"response": {
4949
"body": {
50-
"string": "{\"data\":{\"id\":\"create-framework-new-10\",\"type\":\"custom_framework\",\"attributes\":{\"description\":\"\",\"handle\":\"create-framework-new\",\"icon_url\":\"test-url\",\"name\":\"name\",\"requirements\":[{\"name\":\"requirement\",\"controls\":[{\"name\":\"control\",\"rules_id\":[\"def-000-be9\"]}]}],\"version\":\"10\"}}}",
50+
"string": "{\"data\":{\"id\":\"create-framework-new-10\",\"type\":\"custom_framework\",\"attributes\":{\"handle\":\"create-framework-new\",\"icon_url\":\"test-url\",\"name\":\"name\",\"requirements\":[{\"name\":\"requirement\",\"controls\":[{\"name\":\"control\",\"rules_id\":[\"def-000-be9\"]}]}],\"version\":\"10\"}}}",
5151
"encoding": null
5252
},
5353
"headers": {
@@ -60,7 +60,7 @@
6060
"message": "OK"
6161
}
6262
},
63-
"recorded_at": "Sun, 27 Apr 2025 22:14:16 GMT"
63+
"recorded_at": "Tue, 13 May 2025 17:29:58 GMT"
6464
},
6565
{
6666
"request": {
@@ -88,7 +88,7 @@
8888
"message": "OK"
8989
}
9090
},
91-
"recorded_at": "Sun, 27 Apr 2025 22:14:16 GMT"
91+
"recorded_at": "Tue, 13 May 2025 17:29:58 GMT"
9292
}
9393
],
9494
"recorded_with": "VCR 6.0.0"

0 commit comments

Comments
 (0)