Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ManagedClusterUpgradeProfileProperties.agentPoolProfiles is not marked as nullable #265

Open
ZeWaka opened this issue May 26, 2021 · 1 comment
Labels
CodeGen Issues that relate to code generation Mgmt This issue is related to a management-plane library. Previous Versions Work related to older, unsupported SDKs

Comments

@ZeWaka
Copy link

ZeWaka commented May 26, 2021

pub struct ManagedClusterUpgradeProfileProperties {
#[serde(rename = "controlPlaneProfile")]
pub control_plane_profile: ManagedClusterPoolUpgradeProfile,
#[serde(rename = "agentPoolProfiles")]
pub agent_pool_profiles: Vec<ManagedClusterPoolUpgradeProfile>,
}

I can query this part of the API via a route such as azure_mgmt_containerservice::operations::managed_clusters::get_upgrade_profile().

Depending on the resources, of course, but I can get a null ("agentPoolProfiles": null) result for ManagedClusterUpgradeProfileProperties.agentPoolProfiles. This API/SDK will then error out during deserialization, throwing a:

Error: DeserializeError { source: Error("invalid type: null, expected a sequence", line: 18, column: 28)

for a JSON response like:

{
  "id": "/subscriptions/decafbad-d3ad-b33f-b000-deadf00dba11/resourcegroups/RedactedGroup/providers/Microsoft.ContainerService/managedClusters/RedactedCluster/upgradeprofiles/default",
  "name": "default",
  "type": "Microsoft.ContainerService/managedClusters/upgradeprofiles",
  "properties": {
   "controlPlaneProfile": {
    "kubernetesVersion": "1.18.17",
    "osType": "Linux",
    "upgrades": [
     {
      "kubernetesVersion": "1.19.7"
     },
     {
      "kubernetesVersion": "1.19.9"
     }
    ]
   },
   "agentPoolProfiles": null
  }
 }

Therefore, I believe this field (both, probably?) should be marked as an Option and skip_serializing_if = "Option::is_none")

However - this might be an error on the upstream api spec? re: https://github.com/Azure/azure-rest-api-specs/blob/1b0ed8edd58bb7c9ade9a27430759527bd4eec8e/specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2020-03-01/managedClusters.json#L2187-L2193, it's not marked "x-nullable": true or non-required.

@ctaggart ctaggart self-assigned this May 27, 2021
@ctaggart
Copy link
Contributor

Probably something like serde-rs/serde#1098 is needed for a type is "x-nullable": true.

@cataggar cataggar added Mgmt This issue is related to a management-plane library. CodeGen Issues that relate to code generation labels Oct 26, 2021
@heaths heaths added the Previous Versions Work related to older, unsupported SDKs label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CodeGen Issues that relate to code generation Mgmt This issue is related to a management-plane library. Previous Versions Work related to older, unsupported SDKs
Projects
None yet
Development

No branches or pull requests

4 participants