Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.64k stars 5.08k forks source link

`WebApps_GetConfiguration` returning `null` for structs and arrays #20990

Open cataggar opened 2 years ago

cataggar commented 2 years ago

Part of a WebApps_GetConfiguration response is a SiteConfig model which does not have any x-nullable to say that null values are allowed.

By default, a null value should be disallowed when forming a request and rejected during payload deserialization.

The operation response has a ton a null values:

{
  "id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/myrg/providers/Microsoft.Web/sites/mysite/config/web",
  "name": "mysite",
  "type": "Microsoft.Web/sites/config",
  "location": "East US",
  "properties": {
    "numberOfWorkers": 1,
    "defaultDocuments": [
      "Default.htm",
      "Default.html",
      "Default.asp",
      "index.htm",
      "index.html",
      "iisstart.htm",
      "default.aspx",
      "index.php",
      "hostingstart.html"
    ],
    "netFrameworkVersion": "v4.0",
    "phpVersion": "",
    "pythonVersion": "",
    "nodeVersion": "",
    "powerShellVersion": "",
    "linuxFxVersion": "DOCKER|myacr.azurecr.io/myapp:7.2.5210-37335542",
    "windowsFxVersion": null,
    "requestTracingEnabled": true,
    "requestTracingExpirationTime": "9999-12-31T23:59:00Z",
    "remoteDebuggingEnabled": false,
    "remoteDebuggingVersion": null,
    "httpLoggingEnabled": true,
    "azureMonitorLogCategories": null,
    "acrUseManagedIdentityCreds": true,
    "acrUserManagedIdentityID": null,
    "logsDirectorySizeLimit": 40,
    "detailedErrorLoggingEnabled": true,
    "publishingUsername": "$mysite",
    "publishingPassword": null,
    "appSettings": null,
    "metadata": null,
    "connectionStrings": null,
    "machineKey": null,
    "handlerMappings": null,
    "documentRoot": null,
    "scmType": "None",
    "use32BitWorkerProcess": true,
    "webSocketsEnabled": false,
    "alwaysOn": true,
    "javaVersion": null,
    "javaContainer": null,
    "javaContainerVersion": null,
    "appCommandLine": "",
    "managedPipelineMode": "Integrated",
    "virtualApplications": [
      {
        "virtualPath": "/",
        "physicalPath": "site\\wwwroot",
        "preloadEnabled": true,
        "virtualDirectories": null
      }
    ],
    "winAuthAdminState": 0,
    "winAuthTenantState": 0,
    "customAppPoolIdentityAdminState": false,
    "customAppPoolIdentityTenantState": false,
    "runtimeADUser": null,
    "runtimeADUserPassword": null,
    "loadBalancing": "LeastRequests",
    "routingRules": [],
    "experiments": { "rampUpRules": [] },
    "limits": null,
    "autoHealEnabled": false,
    "autoHealRules": null,
    "tracingOptions": null,
    "vnetName": "",
    "vnetRouteAllEnabled": false,
    "vnetPrivatePortsCount": 0,
    "publicNetworkAccess": null,
    "siteAuthEnabled": true,
    "siteAuthSettingsV2": {
      "globalValidation": {
        "requireAuthentication": true,
        "unauthenticatedClientAction": "Return401"
      },
      "identityProviders": {
        "azureActiveDirectory": {
          "enabled": true,
          "registration": {
            "clientId": "00000000-0000-0000-0000-00000000000",
            "clientSecretSettingName": "APP_REGISTRATION_SECRET"
          },
          "validation": {
            "allowedAudiences": ["00000000-0000-0000-0000-00000000000"]
          }
        }
      }
    },
    "cors": null,
    "push": null,
    "apiDefinition": null,
    "apiManagementConfig": null,
    "autoSwapSlotName": null,
    "localMySqlEnabled": false,
    "managedServiceIdentityId": 3006,
    "xManagedServiceIdentityId": null,
    "keyVaultReferenceIdentity": null,
    "ipSecurityRestrictions": [
      {
        "ipAddress": "Any",
        "action": "Allow",
        "priority": 2147483647,
        "name": "Allow all",
        "description": "Allow all access"
      }
    ],
    "ipSecurityRestrictionsDefaultAction": null,
    "scmIpSecurityRestrictions": [
      {
        "ipAddress": "Any",
        "action": "Allow",
        "priority": 2147483647,
        "name": "Allow all",
        "description": "Allow all access"
      }
    ],
    "scmIpSecurityRestrictionsDefaultAction": null,
    "scmIpSecurityRestrictionsUseMain": false,
    "http20Enabled": true,
    "minTlsVersion": "1.2",
    "minTlsCipherSuite": null,
    "supportedTlsCipherSuites": null,
    "scmMinTlsVersion": "1.0",
    "ftpsState": "Disabled",
    "preWarmedInstanceCount": 0,
    "functionAppScaleLimit": null,
    "elasticWebAppScaleLimit": 0,
    "healthCheckPath": "/api/health",
    "fileChangeAuditEnabled": false,
    "functionsRuntimeScaleMonitoringEnabled": false,
    "websiteTimeZone": null,
    "minimumElasticInstanceCount": 1,
    "azureStorageAccounts": {},
    "http20ProxyFlag": 0,
    "sitePort": null,
    "antivirusScanEnabled": false,
    "storageType": "StorageVolume"
  }
}

For arrays, null values should not be used:

For arrays, sending/receiving a null array entry is not supported and should result in an error.

This currently is breaking deserialization in the Azure SDK for Rust: https://github.com/Azure/azure-sdk-for-rust/issues/1113

raych1 commented 2 years ago

@cataggar , there're no changes on x-nullable validation recently. This is a new request. @keryul , can you replicate this issue to oav repo?

keryul commented 2 years ago

@cataggar , there're no changes on x-nullable validation recently. This is a new request. @keryul , can you replicate this issue to oav repo?

https://github.com/Azure/oav/issues/877

drdamour commented 1 year ago

i think the service just isn't working as it's supposed to. #12104 so teh spec is right but the service is broken