The properties of CIAMResourceSKU are defined as such:
"properties": {
"name": {
"type": "string",
"description": "The name of the SKU for the tenant.",
"enum": [
"Standard",
"PremiumP1",
"PremiumP2"
],
"x-ms-enum": {
"name": "CIAMResourceSKUName",
"modelAsString": true
}
},
"tier": {
"type": "string",
"description": "The tier of the tenant.",
"enum": [
"A0"
],
"x-ms-mutability": [
"create",
"read"
],
"x-ms-client-flatten": true, // <--------
"x-ms-enum": {
"name": "CIAMResourceSKUTier",
"modelAsString": true,
"values": [
{
"value": "A0",
"description": "The SKU tier used for all Azure AD for customers tenants."
}
]
}
}
Note that tier is annotated with x-ms-client-flatten, while name is not. This annotation seems wrong because both properties are part of the SKU. The Azure portal JSON view also shows this:
"sku": {
"name": "Base",
"tier": "A0"
},
Expected behavior
Tools parsing the spec can correctly construct a SKU object for CIAMResource like
"sku": {
"name": "Base",
"tier": "A0"
},
Actual behavior
Tools parsing the spec construct a SKU object for CIAMResource with missing tier because it's flattened, like
"sku": {
"name": "Base",
},
This leads to a 400 Bad Request response from Azure when creating a CIAMResource:
{"additionalInfo":null,"code":"InvalidProperties","details":null,"message":"The Tier field is required.","target":"createCIAMRequest.Sku.Tier"}
Reproduction Steps
To reproduce the Azure API error, run the create example with the tier property removed.
Reproducing the flattening depends on the tool used to parse the spec. For instance, Pulumi encounters this error in pulumi/pulumi-azure-native#3556.
API Spec link
https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cpim/resource-manager/Microsoft.AzureActiveDirectory/preview/2023-05-17-preview/externalIdentities.json#L1506
API Spec version
2023-05-17-preview
Describe the bug
The properties of
CIAMResourceSKU
are defined as such:Note that
tier
is annotated withx-ms-client-flatten
, whilename
is not. This annotation seems wrong because both properties are part of the SKU. The Azure portal JSON view also shows this:Expected behavior
Tools parsing the spec can correctly construct a SKU object for CIAMResource like
Actual behavior
Tools parsing the spec construct a SKU object for CIAMResource with missing
tier
because it's flattened, likeThis leads to a 400 Bad Request response from Azure when creating a CIAMResource:
Reproduction Steps
To reproduce the Azure API error, run the create example with the
tier
property removed.Reproducing the flattening depends on the tool used to parse the spec. For instance, Pulumi encounters this error in pulumi/pulumi-azure-native#3556.
Environment
No response