Skip to content

Commit

Permalink
[AppService] Add status code 202 and allow some properties to be empty (
Browse files Browse the repository at this point in the history
  • Loading branch information
melina5656 authored Nov 11, 2024
1 parent e081f8a commit f962fe1
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 42 deletions.
8 changes: 2 additions & 6 deletions sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Release History

## 1.3.0-beta.2 (Unreleased)

### Features Added

### Breaking Changes
## 1.3.0-beta.2 (2024-11-11)

### Bugs Fixed

### Other Changes
- Add status code 202 and allow some properties to be empty. Issue at 'https://github.com/Azure/azure-sdk-for-net/issues/46854.

## 1.3.0-beta.1 (2024-10-14)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ internal static AppCertificateData DeserializeAppCertificateData(JsonElement ele
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
List<string> array = new List<string>();
Expand All @@ -145,7 +144,6 @@ internal static AppCertificateData DeserializeAppCertificateData(JsonElement ele
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
pfxBlob = property0.Value.GetBytesFromBase64("D");
Expand All @@ -170,7 +168,6 @@ internal static AppCertificateData DeserializeAppCertificateData(JsonElement ele
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
issueDate = property0.Value.GetDateTimeOffset("O");
Expand All @@ -180,7 +177,6 @@ internal static AppCertificateData DeserializeAppCertificateData(JsonElement ele
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
expirationDate = property0.Value.GetDateTimeOffset("O");
Expand All @@ -190,7 +186,6 @@ internal static AppCertificateData DeserializeAppCertificateData(JsonElement ele
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
thumbprintString = property0.Value.GetString();
Expand All @@ -200,7 +195,6 @@ internal static AppCertificateData DeserializeAppCertificateData(JsonElement ele
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
valid = property0.Value.GetBoolean();
Expand All @@ -210,7 +204,6 @@ internal static AppCertificateData DeserializeAppCertificateData(JsonElement ele
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
cerBlob = property0.Value.GetBytesFromBase64("D");
Expand All @@ -225,7 +218,6 @@ internal static AppCertificateData DeserializeAppCertificateData(JsonElement ele
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
hostingEnvironmentProfile = HostingEnvironmentProfile.DeserializeHostingEnvironmentProfile(property0.Value);
Expand All @@ -235,7 +227,6 @@ internal static AppCertificateData DeserializeAppCertificateData(JsonElement ele
{
if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.GetString().Length == 0)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
keyVaultId = new ResourceIdentifier(property0.Value.GetString());
Expand All @@ -250,7 +241,6 @@ internal static AppCertificateData DeserializeAppCertificateData(JsonElement ele
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
keyVaultSecretStatus = property0.Value.GetString().ToKeyVaultSecretStatus();
Expand All @@ -260,7 +250,6 @@ internal static AppCertificateData DeserializeAppCertificateData(JsonElement ele
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
serverFarmId = new ResourceIdentifier(property0.Value.GetString());
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions sdk/websites/Azure.ResourceManager.AppService/src/autorest.md
Original file line number Diff line number Diff line change
Expand Up @@ -1052,4 +1052,27 @@ directive:
$.properties.properties.properties.threads.items = {
"$ref": "#/definitions/ProcessThreadProperties"
};
# Fix for issue: https://github.com/Azure/azure-sdk-for-net/issues/46854
# TODO: Remove this workaround after the issue is resolved. Issue link: https://github.com/Azure/azure-rest-api-specs/issues/19022
- from: Certificates.json
where: $.paths['/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'].put
transform: >
$["x-ms-long-running-operation"] = true;
$['responses'] = {
"200": {
"description": "OK.",
"schema": {
"$ref": "#/definitions/Certificate"
}
},
"202": {
"description": "OK.",
},
"default": {
"description": "App Service error response.",
"schema": {
"$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse"
}
}
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,10 @@ public async Task CreateOrUpdateWithNullKeyVaultId()
KeyVaultId = null // Test to see that if service works fine when we set KeyVaultId to null.
};
var collection = Client.GetResourceGroupResource(ResourceGroupResource.CreateResourceIdentifier("db1ab6f0-4769-4b27-930e-01e2ef9c123c", "testRG-666")).GetAppCertificates();
#if DEBUG
Assert.ThrowsAsync<JsonException>(async delegate { await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); });
await Task.CompletedTask;
#else
var lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data);
var certificate = lro.Value;
Assert.AreEqual(name, certificate.Data.Name);
Assert.IsNull(certificate.Data.KeyVaultId);
#endif
}

[TestCase]
Expand Down

0 comments on commit f962fe1

Please sign in to comment.