Skip to content

Commit 7f4f9b2

Browse files
authored
[App Config] Update Response Output for Label for Configuration Setting (Azure#27622)
1 parent c6dbe7e commit 7f4f9b2

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

sdk/appconfiguration/app-configuration/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
## 1.5.0-beta.3 (Unreleased)
44

5-
65
### Features Added
76

87
### Breaking Changes
98

109
### Bugs Fixed
1110

11+
- To match the input type, change the output representation of `label` and `contentType` from `null` to `undefined` when these properties are empty or not defined in the configuration setting object. [#27622](https://github.com/Azure/azure-sdk-for-js/pull/27622)
12+
1213
### Other Changes
1314

1415
## 1.5.0-beta.2 (2023-10-10)

sdk/appconfiguration/app-configuration/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "js",
44
"TagPrefix": "js/appconfiguration/app-configuration",
5-
"Tag": "js/appconfiguration/app-configuration_7d75890bc5"
5+
"Tag": "js/appconfiguration/app-configuration_0d80770eb3"
66
}

sdk/appconfiguration/app-configuration/src/internal/helpers.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,13 @@ export function transformKeyValue<T>(kvp: T & KeyValue): T & ConfigurationSettin
227227
...kvp,
228228
isReadOnly: !!kvp.locked,
229229
};
230-
231230
delete setting.locked;
232-
231+
if (!setting.label) {
232+
delete setting.label;
233+
}
234+
if (!setting.contentType) {
235+
delete setting.contentType;
236+
}
233237
return setting;
234238
}
235239

sdk/appconfiguration/app-configuration/test/public/index.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ describe("AppConfigurationClient", () => {
11541154
);
11551155
assert.strictEqual(
11561156
replacedResult.contentType,
1157-
null,
1157+
undefined,
11581158
"Unexpected contentType in result from setConfigurationSetting()."
11591159
);
11601160

@@ -1256,7 +1256,7 @@ describe("AppConfigurationClient", () => {
12561256
);
12571257
assert.strictEqual(
12581258
replacedResult.contentType,
1259-
null,
1259+
undefined,
12601260
"Unexpected contentType in result from setConfigurationSetting()."
12611261
);
12621262

@@ -1300,7 +1300,7 @@ describe("AppConfigurationClient", () => {
13001300
);
13011301
assert.strictEqual(
13021302
result.contentType,
1303-
null,
1303+
undefined,
13041304
"Unexpected contentType in result from setConfigurationSetting()."
13051305
);
13061306
});

0 commit comments

Comments
 (0)