diff --git a/.gitignore b/.gitignore index 42912f488..670c2f73b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ # Ignore compiled files src/**/*.js +regression/**/*.js +regression/**/*.js.map src/**/*.map src/**/*.d.ts node_modules/ diff --git a/changelog.md b/changelog.md index d7cdb3fdb..55cbaacbf 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,15 @@ # Changelog +## What's New (12/18/2020) + +### New validation rules +- Rpaas_ResourceProvisioningState - Validate if 'provisioningState' is defined in a resource definition. + +### Changed Rule + +- TopLevelResourcesListByResourceGroup - Only resource group level resources apply to this rule. +- UniqueXmsEnumName - Compare enum type and modelAsString too, optimize message. + ## What's New (11/23/2020) ### New validation rules diff --git a/regression/__snapshots__/linting_all_readmes.test.ts.snap b/regression/__snapshots__/linting_all_readmes.test.ts.snap index 7f27bc1ee..a524d26e6 100644 --- a/regression/__snapshots__/linting_all_readmes.test.ts.snap +++ b/regression/__snapshots__/linting_all_readmes.test.ts.snap @@ -5244,34 +5244,6 @@ Array [ "type": "error", "validationCategory": "ARMViolation", }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2019-05-05-preview/AlertsManagement.json:770:4 ($.definitions.alert)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2019-05-05-preview/AlertsManagement.json:770:4 ($.definitions.alert)", - "message": "The top-level resource \\"alert\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2019-05-05-preview/AlertsManagement.json:770:4 ($.definitions.alert)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2019-05-05-preview/SmartGroups.json:588:4 ($.definitions.smartGroup)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2019-05-05-preview/SmartGroups.json:588:4 ($.definitions.smartGroup)", - "message": "The top-level resource \\"smartGroup\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2019-05-05-preview/SmartGroups.json:588:4 ($.definitions.smartGroup)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, Object { "code": "OperationsApiResponseSchema", "id": "R4018", @@ -10882,20 +10854,6 @@ Array [ "type": "error", "validationCategory": "ARMViolation", }, - Object { - "code": "UniqueXmsEnumName", - "id": "R4005", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/workbooks_API.json:380:8 ($.definitions.WorkbookProperties.properties.kind)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/workbooks_API.json:380:8 ($.definitions.WorkbookProperties.properties.kind)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is sharedtypekind", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/workbooks_API.json:380:8 ($.definitions.WorkbookProperties.properties.kind)", - ], - "type": "error", - "validationCategory": "SDKViolation", - }, Object { "code": "DeprecatedXmsCodeGenerationSetting", "id": "R4006", @@ -24324,20 +24282,6 @@ Array [ "type": "error", "validationCategory": "ARMViolation", }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/azsadmin/resource-manager/gallery/Microsoft.Gallery.Admin/preview/2015-04-01/GalleryItem.json:186:4 ($.definitions.GalleryItem)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/azsadmin/resource-manager/gallery/Microsoft.Gallery.Admin/preview/2015-04-01/GalleryItem.json:186:4 ($.definitions.GalleryItem)", - "message": "The top-level resource \\"GalleryItem\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/azsadmin/resource-manager/gallery/Microsoft.Gallery.Admin/preview/2015-04-01/GalleryItem.json:186:4 ($.definitions.GalleryItem)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, Object { "code": "OperationsApiResponseSchema", "id": "R4018", @@ -25406,20 +25350,6 @@ Array [ "type": "error", "validationCategory": "ARMViolation", }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/azsadmin/resource-manager/storage/Microsoft.Storage.Admin/preview/2019-08-08/storage.json:316:4 ($.definitions.StorageService)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/azsadmin/resource-manager/storage/Microsoft.Storage.Admin/preview/2019-08-08/storage.json:316:4 ($.definitions.StorageService)", - "message": "The top-level resource \\"StorageService\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/azsadmin/resource-manager/storage/Microsoft.Storage.Admin/preview/2019-08-08/storage.json:316:4 ($.definitions.StorageService)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, Object { "code": "TopLevelResourcesListBySubscription", "id": "R4017", @@ -25744,7 +25674,7 @@ Array [ "id": "R4005", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2020-06-14/kusto.json:3672:8 ($.definitions.DataConnection.properties.kind)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2020-06-14/kusto.json:3672:8 ($.definitions.DataConnection.properties.kind)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is kind", + "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name: kind, path: $.Database.properties.kind", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -25758,7 +25688,7 @@ Array [ "id": "R4005", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2020-06-14/kusto.json:3877:8 ($.definitions.CheckNameRequest.properties.type)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2020-06-14/kusto.json:3877:8 ($.definitions.CheckNameRequest.properties.type)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is type", + "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name: type, path: $.ClusterCheckNameRequest.properties.type", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -25772,7 +25702,7 @@ Array [ "id": "R4005", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2020-06-14/kusto.json:3903:8 ($.definitions.ClusterPrincipalAssignmentCheckNameRequest.properties.type)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2020-06-14/kusto.json:3903:8 ($.definitions.ClusterPrincipalAssignmentCheckNameRequest.properties.type)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is type", + "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name: type, path: $.ClusterCheckNameRequest.properties.type", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -25786,7 +25716,7 @@ Array [ "id": "R4005", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2020-06-14/kusto.json:3928:8 ($.definitions.DataConnectionCheckNameRequest.properties.type)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2020-06-14/kusto.json:3928:8 ($.definitions.DataConnectionCheckNameRequest.properties.type)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is type", + "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name: type, path: $.ClusterCheckNameRequest.properties.type", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -25800,7 +25730,7 @@ Array [ "id": "R4005", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2020-06-14/kusto.json:3953:8 ($.definitions.DatabasePrincipalAssignmentCheckNameRequest.properties.type)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2020-06-14/kusto.json:3953:8 ($.definitions.DatabasePrincipalAssignmentCheckNameRequest.properties.type)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is type", + "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name: type, path: $.ClusterCheckNameRequest.properties.type", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -28294,48 +28224,6 @@ Array [ "type": "Warning", "validationCategory": "SDKViolation", }, - Object { - "code": "UniqueXmsEnumName", - "id": "R4005", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/batchai/resource-manager/Microsoft.BatchAI/stable/2018-05-01/BatchAI.json:2577:8 ($.definitions.JobProperties.properties.provisioningState)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/batchai/resource-manager/Microsoft.BatchAI/stable/2018-05-01/BatchAI.json:2577:8 ($.definitions.JobProperties.properties.provisioningState)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is provisioningstate", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/batchai/resource-manager/Microsoft.BatchAI/stable/2018-05-01/BatchAI.json:2577:8 ($.definitions.JobProperties.properties.provisioningState)", - ], - "type": "error", - "validationCategory": "SDKViolation", - }, - Object { - "code": "UniqueXmsEnumName", - "id": "R4005", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/batchai/resource-manager/Microsoft.BatchAI/stable/2018-05-01/BatchAI.json:3703:8 ($.definitions.WorkspaceProperties.properties.provisioningState)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/batchai/resource-manager/Microsoft.BatchAI/stable/2018-05-01/BatchAI.json:3703:8 ($.definitions.WorkspaceProperties.properties.provisioningState)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is provisioningstate", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/batchai/resource-manager/Microsoft.BatchAI/stable/2018-05-01/BatchAI.json:3703:8 ($.definitions.WorkspaceProperties.properties.provisioningState)", - ], - "type": "error", - "validationCategory": "SDKViolation", - }, - Object { - "code": "UniqueXmsEnumName", - "id": "R4005", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/batchai/resource-manager/Microsoft.BatchAI/stable/2018-05-01/BatchAI.json:3772:8 ($.definitions.ExperimentProperties.properties.provisioningState)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/batchai/resource-manager/Microsoft.BatchAI/stable/2018-05-01/BatchAI.json:3772:8 ($.definitions.ExperimentProperties.properties.provisioningState)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is provisioningstate", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/batchai/resource-manager/Microsoft.BatchAI/stable/2018-05-01/BatchAI.json:3772:8 ($.definitions.ExperimentProperties.properties.provisioningState)", - ], - "type": "error", - "validationCategory": "SDKViolation", - }, Object { "code": "DeprecatedXmsCodeGenerationSetting", "id": "R4006", @@ -28985,20 +28873,6 @@ Array [ "type": "warning", "validationCategory": "ARMViolation", }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/billingV2.json:249:4 ($.definitions.BillingPeriod)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/billingV2.json:249:4 ($.definitions.BillingPeriod)", - "message": "The top-level resource \\"BillingPeriod\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/billingV2.json:249:4 ($.definitions.BillingPeriod)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, Object { "code": "OperationsApiResponseSchema", "id": "R4018", @@ -32471,7 +32345,7 @@ Array [ "id": "R4005", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/cdn/resource-manager/Microsoft.Cdn/stable/2020-04-15/cdnwebapplicationfirewall.json:600:8 ($.definitions.MatchCondition.properties.matchVariable)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/cdn/resource-manager/Microsoft.Cdn/stable/2020-04-15/cdnwebapplicationfirewall.json:600:8 ($.definitions.MatchCondition.properties.matchVariable)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is matchvariable", + "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name: matchvariable, path: $.DeliveryRuleCondition.properties.name", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -34501,20 +34375,6 @@ Array [ "type": "error", "validationCategory": "ARMViolation", }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/changeanalysis/resource-manager/Microsoft.ChangeAnalysis/preview/2020-04-01-preview/changeanalysis.json:369:4 ($.definitions.ConfigurationProfileResource)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/changeanalysis/resource-manager/Microsoft.ChangeAnalysis/preview/2020-04-01-preview/changeanalysis.json:369:4 ($.definitions.ConfigurationProfileResource)", - "message": "The top-level resource \\"ConfigurationProfileResource\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/changeanalysis/resource-manager/Microsoft.ChangeAnalysis/preview/2020-04-01-preview/changeanalysis.json:369:4 ($.definitions.ConfigurationProfileResource)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, Object { "code": "TopLevelResourcesListBySubscription", "id": "R4017", @@ -34912,20 +34772,6 @@ Array [ "type": "Error", "validationCategory": "ARMViolation", }, - Object { - "code": "UniqueXmsEnumName", - "id": "R4005", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/cloudshell/resource-manager/Microsoft.Portal/stable/2018-10-01/CloudShell.json:847:8 ($.definitions.UserProperties.properties.preferredOsType)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/cloudshell/resource-manager/Microsoft.Portal/stable/2018-10-01/CloudShell.json:847:8 ($.definitions.UserProperties.properties.preferredOsType)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is ostype", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/cloudshell/resource-manager/Microsoft.Portal/stable/2018-10-01/CloudShell.json:847:8 ($.definitions.UserProperties.properties.preferredOsType)", - ], - "type": "error", - "validationCategory": "SDKViolation", - }, Object { "code": "DescriptionAndTitleMissing", "id": "R4021", @@ -43953,90 +43799,6 @@ Array [ "type": "Warning", "validationCategory": "ARMViolation", }, - Object { - "code": "UniqueXmsEnumName", - "id": "R4005", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2322:8 ($.definitions.TimerTrigger.properties.status)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2322:8 ($.definitions.TimerTrigger.properties.status)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is triggerstatus", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2322:8 ($.definitions.TimerTrigger.properties.status)", - ], - "type": "error", - "validationCategory": "SDKViolation", - }, - Object { - "code": "UniqueXmsEnumName", - "id": "R4005", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2369:8 ($.definitions.SourceTrigger.properties.status)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2369:8 ($.definitions.SourceTrigger.properties.status)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is triggerstatus", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2369:8 ($.definitions.SourceTrigger.properties.status)", - ], - "type": "error", - "validationCategory": "SDKViolation", - }, - Object { - "code": "UniqueXmsEnumName", - "id": "R4005", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2424:8 ($.definitions.BaseImageTrigger.properties.status)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2424:8 ($.definitions.BaseImageTrigger.properties.status)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is triggerstatus", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2424:8 ($.definitions.BaseImageTrigger.properties.status)", - ], - "type": "error", - "validationCategory": "SDKViolation", - }, - Object { - "code": "UniqueXmsEnumName", - "id": "R4005", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2759:8 ($.definitions.TimerTriggerUpdateParameters.properties.status)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2759:8 ($.definitions.TimerTriggerUpdateParameters.properties.status)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is triggerstatus", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2759:8 ($.definitions.TimerTriggerUpdateParameters.properties.status)", - ], - "type": "error", - "validationCategory": "SDKViolation", - }, - Object { - "code": "UniqueXmsEnumName", - "id": "R4005", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2804:8 ($.definitions.SourceTriggerUpdateParameters.properties.status)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2804:8 ($.definitions.SourceTriggerUpdateParameters.properties.status)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is triggerstatus", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2804:8 ($.definitions.SourceTriggerUpdateParameters.properties.status)", - ], - "type": "error", - "validationCategory": "SDKViolation", - }, - Object { - "code": "UniqueXmsEnumName", - "id": "R4005", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2858:8 ($.definitions.BaseImageTriggerUpdateParameters.properties.status)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2858:8 ($.definitions.BaseImageTriggerUpdateParameters.properties.status)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is triggerstatus", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/containerregistry_build.json:2858:8 ($.definitions.BaseImageTriggerUpdateParameters.properties.status)", - ], - "type": "error", - "validationCategory": "SDKViolation", - }, Object { "code": "RequiredDefaultResponse", "id": "R4010", @@ -50858,7 +50620,7 @@ Array [ "id": "R4005", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.json:2767:8 ($.definitions.QueryComparisonExpression.properties.operator)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.json:2767:8 ($.definitions.QueryComparisonExpression.properties.operator)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is operatortype", + "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name: operatortype, path: $.ReportConfigComparisonExpression.properties.operator", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -62354,7 +62116,7 @@ Array [ "id": "R4005", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/datashare/resource-manager/Microsoft.DataShare/stable/2019-11-01/DataShare.json:4451:8 ($.definitions.DataSetMapping.properties.kind)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/datashare/resource-manager/Microsoft.DataShare/stable/2019-11-01/DataShare.json:4451:8 ($.definitions.DataSetMapping.properties.kind)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is kind", + "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name: kind, path: $.DataSet.properties.kind", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -62368,7 +62130,7 @@ Array [ "id": "R4005", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/datashare/resource-manager/Microsoft.DataShare/stable/2019-11-01/DataShare.json:5937:8 ($.definitions.SourceShareSynchronizationSetting.properties.kind)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/datashare/resource-manager/Microsoft.DataShare/stable/2019-11-01/DataShare.json:5937:8 ($.definitions.SourceShareSynchronizationSetting.properties.kind)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is kind", + "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name: kind, path: $.DataSet.properties.kind", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -62382,7 +62144,7 @@ Array [ "id": "R4005", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/datashare/resource-manager/Microsoft.DataShare/stable/2019-11-01/DataShare.json:6386:8 ($.definitions.SynchronizationSetting.properties.kind)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/datashare/resource-manager/Microsoft.DataShare/stable/2019-11-01/DataShare.json:6386:8 ($.definitions.SynchronizationSetting.properties.kind)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is kind", + "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name: kind, path: $.DataSet.properties.kind", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -62396,7 +62158,7 @@ Array [ "id": "R4005", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/datashare/resource-manager/Microsoft.DataShare/stable/2019-11-01/DataShare.json:6451:8 ($.definitions.Trigger.properties.kind)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/datashare/resource-manager/Microsoft.DataShare/stable/2019-11-01/DataShare.json:6451:8 ($.definitions.Trigger.properties.kind)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is kind", + "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name: kind, path: $.DataSet.properties.kind", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -63535,6 +63297,20 @@ Array [ "type": "Warning", "validationCategory": "SDKViolation", }, + Object { + "code": "PreviewVersionOverOneYear", + "id": "R4024", + "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2019-12-10-preview/desktopvirtualization.json:4:4 ($.info.version)", + "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2019-12-10-preview/desktopvirtualization.json:4:4 ($.info.version)", + "message": "The API version:2019-12-10-preview having been in a preview state over one year , please move it to GA or retire.", + "providerNamespace": false, + "resourceType": false, + "sources": Array [ + "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2019-12-10-preview/desktopvirtualization.json:4:4 ($.info.version)", + ], + "type": "warning", + "validationCategory": "SDKViolation", + }, ] `; @@ -71805,6 +71581,20 @@ Array [ "type": "Warning", "validationCategory": "SDKViolation", }, + Object { + "code": "PreviewVersionOverOneYear", + "id": "R4024", + "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2020-01-01-preview/connectedClusters.json:5:4 ($.info.version)", + "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2020-01-01-preview/connectedClusters.json:5:4 ($.info.version)", + "message": "The API version:2020-01-01-preview having been in a preview state over one year , please move it to GA or retire.", + "providerNamespace": false, + "resourceType": false, + "sources": Array [ + "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2020-01-01-preview/connectedClusters.json:5:4 ($.info.version)", + ], + "type": "warning", + "validationCategory": "SDKViolation", + }, Object { "code": "UniqueXmsExample", "id": "R4030", @@ -71838,20 +71628,6 @@ Array [ "type": "Warning", "validationCategory": "ARMViolation", }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/vendor.json:883:4 ($.definitions.Vendor)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/vendor.json:883:4 ($.definitions.Vendor)", - "message": "The top-level resource \\"Vendor\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/vendor.json:883:4 ($.definitions.Vendor)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, Object { "code": "OperationsApiResponseSchema", "id": "R4018", @@ -71880,6 +71656,90 @@ Array [ "type": "Warning", "validationCategory": "SDKViolation", }, + Object { + "code": "PreviewVersionOverOneYear", + "id": "R4024", + "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/common.json:6:4 ($.info.version)", + "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/common.json:6:4 ($.info.version)", + "message": "The API version:2020-01-01-preview having been in a preview state over one year , please move it to GA or retire.", + "providerNamespace": false, + "resourceType": false, + "sources": Array [ + "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/common.json:6:4 ($.info.version)", + ], + "type": "warning", + "validationCategory": "SDKViolation", + }, + Object { + "code": "PreviewVersionOverOneYear", + "id": "R4024", + "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/device.json:6:4 ($.info.version)", + "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/device.json:6:4 ($.info.version)", + "message": "The API version:2020-01-01-preview having been in a preview state over one year , please move it to GA or retire.", + "providerNamespace": false, + "resourceType": false, + "sources": Array [ + "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/device.json:6:4 ($.info.version)", + ], + "type": "warning", + "validationCategory": "SDKViolation", + }, + Object { + "code": "PreviewVersionOverOneYear", + "id": "R4024", + "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/operations.json:6:4 ($.info.version)", + "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/operations.json:6:4 ($.info.version)", + "message": "The API version:2020-01-01-preview having been in a preview state over one year , please move it to GA or retire.", + "providerNamespace": false, + "resourceType": false, + "sources": Array [ + "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/operations.json:6:4 ($.info.version)", + ], + "type": "warning", + "validationCategory": "SDKViolation", + }, + Object { + "code": "PreviewVersionOverOneYear", + "id": "R4024", + "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/vendor.json:6:4 ($.info.version)", + "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/vendor.json:6:4 ($.info.version)", + "message": "The API version:2020-01-01-preview having been in a preview state over one year , please move it to GA or retire.", + "providerNamespace": false, + "resourceType": false, + "sources": Array [ + "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/vendor.json:6:4 ($.info.version)", + ], + "type": "warning", + "validationCategory": "SDKViolation", + }, + Object { + "code": "PreviewVersionOverOneYear", + "id": "R4024", + "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/virtualNetworkFunction.json:6:4 ($.info.version)", + "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/virtualNetworkFunction.json:6:4 ($.info.version)", + "message": "The API version:2020-01-01-preview having been in a preview state over one year , please move it to GA or retire.", + "providerNamespace": false, + "resourceType": false, + "sources": Array [ + "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/virtualNetworkFunction.json:6:4 ($.info.version)", + ], + "type": "warning", + "validationCategory": "SDKViolation", + }, + Object { + "code": "PreviewVersionOverOneYear", + "id": "R4024", + "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/virtualNetworkFunctionVendors.json:6:4 ($.info.version)", + "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/virtualNetworkFunctionVendors.json:6:4 ($.info.version)", + "message": "The API version:2020-01-01-preview having been in a preview state over one year , please move it to GA or retire.", + "providerNamespace": false, + "resourceType": false, + "sources": Array [ + "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2020-01-01-preview/virtualNetworkFunctionVendors.json:6:4 ($.info.version)", + ], + "type": "warning", + "validationCategory": "SDKViolation", + }, Object { "code": "UniqueXmsExample", "id": "R4030", @@ -76105,7 +75965,7 @@ Array [ "id": "R4005", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/iothub/resource-manager/Microsoft.Devices/stable/2020-08-01/iothub.json:3093:8 ($.definitions.FallbackRouteProperties.properties.source)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/iothub/resource-manager/Microsoft.Devices/stable/2020-08-01/iothub.json:3093:8 ($.definitions.FallbackRouteProperties.properties.source)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is routingsource", + "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name: routingsource, path: $.RouteProperties.properties.source", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -92943,7 +92803,7 @@ Array [ "id": "R4005", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/scheduledQueryRule_API.json:701:8 ($.definitions.Dimension.properties.operator)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-04-16/scheduledQueryRule_API.json:701:8 ($.definitions.Dimension.properties.operator)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is operator", + "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name: operator, path: $.MetricCriteria.properties.operator", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -94128,20 +93988,6 @@ Array [ "type": "error", "validationCategory": "ARMViolation", }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/logProfiles_API.json:317:4 ($.definitions.LogProfileResource)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/logProfiles_API.json:317:4 ($.definitions.LogProfileResource)", - "message": "The top-level resource \\"LogProfileResource\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/logProfiles_API.json:317:4 ($.definitions.LogProfileResource)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, Object { "code": "OperationsApiResponseSchema", "id": "R4018", @@ -100302,34 +100148,6 @@ Array [ "type": "error", "validationCategory": "ARMViolation", }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/network/resource-manager/Microsoft.Network/stable/2020-06-01/expressRoutePort.json:651:4 ($.definitions.ExpressRoutePortsLocation)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/network/resource-manager/Microsoft.Network/stable/2020-06-01/expressRoutePort.json:651:4 ($.definitions.ExpressRoutePortsLocation)", - "message": "The top-level resource \\"ExpressRoutePortsLocation\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/network/resource-manager/Microsoft.Network/stable/2020-06-01/expressRoutePort.json:651:4 ($.definitions.ExpressRoutePortsLocation)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/network/resource-manager/Microsoft.Network/stable/2020-06-01/networkVirtualAppliance.json:982:4 ($.definitions.NetworkVirtualApplianceSku)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/network/resource-manager/Microsoft.Network/stable/2020-06-01/networkVirtualAppliance.json:982:4 ($.definitions.NetworkVirtualApplianceSku)", - "message": "The top-level resource \\"NetworkVirtualApplianceSku\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/network/resource-manager/Microsoft.Network/stable/2020-06-01/networkVirtualAppliance.json:982:4 ($.definitions.NetworkVirtualApplianceSku)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, Object { "code": "TopLevelResourcesListBySubscription", "id": "R4017", @@ -103751,20 +103569,6 @@ Array [ "type": "warning", "validationCategory": "ARMViolation", }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/peering/resource-manager/Microsoft.Peering/stable/2020-04-01/peering.json:2454:4 ($.definitions.PeerAsn)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/peering/resource-manager/Microsoft.Peering/stable/2020-04-01/peering.json:2454:4 ($.definitions.PeerAsn)", - "message": "The top-level resource \\"PeerAsn\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/peering/resource-manager/Microsoft.Peering/stable/2020-04-01/peering.json:2454:4 ($.definitions.PeerAsn)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, ] `; @@ -109998,34 +109802,6 @@ Array [ "type": "Warning", "validationCategory": "SDKViolation", }, - Object { - "code": "UniqueXmsEnumName", - "id": "R4005", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2016-12-01/bms.json:2350:8 ($.definitions.BMSPOQueryObject.properties.backupManagementType)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2016-12-01/bms.json:2350:8 ($.definitions.BMSPOQueryObject.properties.backupManagementType)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is backupmanagementtype", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2016-12-01/bms.json:2350:8 ($.definitions.BMSPOQueryObject.properties.backupManagementType)", - ], - "type": "error", - "validationCategory": "SDKViolation", - }, - Object { - "code": "UniqueXmsEnumName", - "id": "R4005", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2016-12-01/bms.json:2437:8 ($.definitions.BMSWorkloadItemQueryObject.properties.backupManagementType)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2016-12-01/bms.json:2437:8 ($.definitions.BMSWorkloadItemQueryObject.properties.backupManagementType)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is backupmanagementtype", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2016-12-01/bms.json:2437:8 ($.definitions.BMSWorkloadItemQueryObject.properties.backupManagementType)", - ], - "type": "error", - "validationCategory": "SDKViolation", - }, Object { "code": "DeprecatedXmsCodeGenerationSetting", "id": "R4006", @@ -123962,34 +123738,6 @@ Array [ "type": "warning", "validationCategory": "ARMViolation", }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/resources/resource-manager/Microsoft.Authorization/stable/2020-03-01/policyDefinitions.json:597:4 ($.definitions.PolicyDefinition)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/resources/resource-manager/Microsoft.Authorization/stable/2020-03-01/policyDefinitions.json:597:4 ($.definitions.PolicyDefinition)", - "message": "The top-level resource \\"PolicyDefinition\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/resources/resource-manager/Microsoft.Authorization/stable/2020-03-01/policyDefinitions.json:597:4 ($.definitions.PolicyDefinition)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/resources/resource-manager/Microsoft.Authorization/stable/2020-03-01/policySetDefinitions.json:619:4 ($.definitions.PolicySetDefinition)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/resources/resource-manager/Microsoft.Authorization/stable/2020-03-01/policySetDefinitions.json:619:4 ($.definitions.PolicySetDefinition)", - "message": "The top-level resource \\"PolicySetDefinition\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/resources/resource-manager/Microsoft.Authorization/stable/2020-03-01/policySetDefinitions.json:619:4 ($.definitions.PolicySetDefinition)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, Object { "code": "TopLevelResourcesListBySubscription", "id": "R4017", @@ -127529,160 +127277,6 @@ Array [ "type": "warning", "validationCategory": "ARMViolation", }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/autoProvisioningSettings.json:175:4 ($.definitions.AutoProvisioningSetting)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/autoProvisioningSettings.json:175:4 ($.definitions.AutoProvisioningSetting)", - "message": "The top-level resource \\"AutoProvisioningSetting\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/autoProvisioningSettings.json:175:4 ($.definitions.AutoProvisioningSetting)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/securityContacts.json:262:4 ($.definitions.SecurityContact)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/securityContacts.json:262:4 ($.definitions.SecurityContact)", - "message": "The top-level resource \\"SecurityContact\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/securityContacts.json:262:4 ($.definitions.SecurityContact)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/workspaceSettings.json:251:4 ($.definitions.WorkspaceSetting)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/workspaceSettings.json:251:4 ($.definitions.WorkspaceSetting)", - "message": "The top-level resource \\"WorkspaceSetting\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/workspaceSettings.json:251:4 ($.definitions.WorkspaceSetting)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/alertsSuppressionRules.json:217:4 ($.definitions.AlertsSuppressionRule)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/alertsSuppressionRules.json:217:4 ($.definitions.AlertsSuppressionRule)", - "message": "The top-level resource \\"AlertsSuppressionRule\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/alertsSuppressionRules.json:217:4 ($.definitions.AlertsSuppressionRule)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/regulatoryCompliance.json:319:4 ($.definitions.RegulatoryComplianceStandard)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/regulatoryCompliance.json:319:4 ($.definitions.RegulatoryComplianceStandard)", - "message": "The top-level resource \\"RegulatoryComplianceStandard\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/regulatoryCompliance.json:319:4 ($.definitions.RegulatoryComplianceStandard)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/connectors.json:218:4 ($.definitions.ConnectorSetting)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/connectors.json:218:4 ($.definitions.ConnectorSetting)", - "message": "The top-level resource \\"ConnectorSetting\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/connectors.json:218:4 ($.definitions.ConnectorSetting)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/secureScore.json:301:4 ($.definitions.SecureScoreItem)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/secureScore.json:301:4 ($.definitions.SecureScoreItem)", - "message": "The top-level resource \\"SecureScoreItem\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/secureScore.json:301:4 ($.definitions.SecureScoreItem)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/pricings.json:169:4 ($.definitions.Pricing)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/pricings.json:169:4 ($.definitions.Pricing)", - "message": "The top-level resource \\"Pricing\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/pricings.json:169:4 ($.definitions.Pricing)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json:175:4 ($.definitions.Setting)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json:175:4 ($.definitions.Setting)", - "message": "The top-level resource \\"Setting\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json:175:4 ($.definitions.Setting)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/assessmentMetadata.json:281:4 ($.definitions.SecurityAssessmentMetadata)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/assessmentMetadata.json:281:4 ($.definitions.SecurityAssessmentMetadata)", - "message": "The top-level resource \\"SecurityAssessmentMetadata\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/assessmentMetadata.json:281:4 ($.definitions.SecurityAssessmentMetadata)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/common/v1/types.json:153:4 ($.definitions.AscLocation)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/common/v1/types.json:153:4 ($.definitions.AscLocation)", - "message": "The top-level resource \\"AscLocation\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/common/v1/types.json:153:4 ($.definitions.AscLocation)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, Object { "code": "TopLevelResourcesListBySubscription", "id": "R4017", @@ -129728,6 +129322,34 @@ Array [ "type": "warning", "validationCategory": "SDKViolation", }, + Object { + "code": "PreviewVersionOverOneYear", + "id": "R4024", + "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/connectors.json:6:4 ($.info.version)", + "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/connectors.json:6:4 ($.info.version)", + "message": "The API version:2020-01-01-preview having been in a preview state over one year , please move it to GA or retire.", + "providerNamespace": false, + "resourceType": false, + "sources": Array [ + "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/connectors.json:6:4 ($.info.version)", + ], + "type": "warning", + "validationCategory": "SDKViolation", + }, + Object { + "code": "PreviewVersionOverOneYear", + "id": "R4024", + "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/secureScore.json:6:4 ($.info.version)", + "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/secureScore.json:6:4 ($.info.version)", + "message": "The API version:2020-01-01-preview having been in a preview state over one year , please move it to GA or retire.", + "providerNamespace": false, + "resourceType": false, + "sources": Array [ + "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/secureScore.json:6:4 ($.info.version)", + ], + "type": "warning", + "validationCategory": "SDKViolation", + }, Object { "code": "UniqueXmsExample", "id": "R4030", @@ -132964,6 +132586,34 @@ Array [ "type": "error", "validationCategory": "ARMViolation", }, + Object { + "code": "PreviewVersionOverOneYear", + "id": "R4024", + "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/preview/2020-01-01-preview/managedcluster.json:6:4 ($.info.version)", + "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/preview/2020-01-01-preview/managedcluster.json:6:4 ($.info.version)", + "message": "The API version:2020-01-01-preview having been in a preview state over one year , please move it to GA or retire.", + "providerNamespace": false, + "resourceType": false, + "sources": Array [ + "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/preview/2020-01-01-preview/managedcluster.json:6:4 ($.info.version)", + ], + "type": "warning", + "validationCategory": "SDKViolation", + }, + Object { + "code": "PreviewVersionOverOneYear", + "id": "R4024", + "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/preview/2020-01-01-preview/nodetype.json:6:4 ($.info.version)", + "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/preview/2020-01-01-preview/nodetype.json:6:4 ($.info.version)", + "message": "The API version:2020-01-01-preview having been in a preview state over one year , please move it to GA or retire.", + "providerNamespace": false, + "resourceType": false, + "sources": Array [ + "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/preview/2020-01-01-preview/nodetype.json:6:4 ($.info.version)", + ], + "type": "warning", + "validationCategory": "SDKViolation", + }, Object { "code": "UniqueXmsExample", "id": "R4030", @@ -141927,7 +141577,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:1038:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/upgrade\\"].post.responses[\\"201\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:1038:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/upgrade\\"].post.responses[\\"201\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -141941,7 +141591,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:1042:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/upgrade\\"].post.responses[\\"202\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:1042:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/upgrade\\"].post.responses[\\"202\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -141955,7 +141605,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:1046:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/upgrade\\"].post.responses[\\"204\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:1046:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/upgrade\\"].post.responses[\\"204\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -141969,7 +141619,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:336:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}\\"].delete.responses[\\"200\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:336:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}\\"].delete.responses[\\"200\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -141983,7 +141633,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:340:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}\\"].delete.responses[\\"202\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:340:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}\\"].delete.responses[\\"202\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -141997,7 +141647,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:344:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}\\"].delete.responses[\\"204\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:344:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}\\"].delete.responses[\\"204\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -142011,7 +141661,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:582:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/flush\\"].post.responses[\\"200\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:582:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/flush\\"].post.responses[\\"200\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -142025,7 +141675,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:586:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/flush\\"].post.responses[\\"202\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:586:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/flush\\"].post.responses[\\"202\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -142039,7 +141689,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:590:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/flush\\"].post.responses[\\"204\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:590:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/flush\\"].post.responses[\\"204\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -142053,7 +141703,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:646:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/start\\"].post.responses[\\"200\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:646:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/start\\"].post.responses[\\"200\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -142067,7 +141717,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:650:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/start\\"].post.responses[\\"202\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:650:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/start\\"].post.responses[\\"202\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -142081,7 +141731,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:654:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/start\\"].post.responses[\\"204\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:654:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/start\\"].post.responses[\\"204\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -142095,7 +141745,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:710:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/stop\\"].post.responses[\\"200\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:710:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/stop\\"].post.responses[\\"200\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -142109,7 +141759,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:714:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/stop\\"].post.responses[\\"202\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:714:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/stop\\"].post.responses[\\"202\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -142123,7 +141773,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:718:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/stop\\"].post.responses[\\"204\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:718:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/stop\\"].post.responses[\\"204\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -142137,7 +141787,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:839:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}\\"].delete.responses[\\"200\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:839:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}\\"].delete.responses[\\"200\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -142151,7 +141801,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:843:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}\\"].delete.responses[\\"202\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:843:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}\\"].delete.responses[\\"202\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -142165,7 +141815,7 @@ Array [ "id": "R4008", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:847:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}\\"].delete.responses[\\"204\\"].schema)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2020-03-01/storagecache.json:847:12 ($.paths[\\"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}\\"].delete.responses[\\"204\\"].schema)", - "message": "Response schema must not be empty'", + "message": "Response schema must not be empty.", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -145992,20 +145642,6 @@ Array [ "type": "error", "validationCategory": "ARMViolation", }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/support.json:998:4 ($.definitions.SupportTicketDetails)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/support.json:998:4 ($.definitions.SupportTicketDetails)", - "message": "The top-level resource \\"SupportTicketDetails\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/support.json:998:4 ($.definitions.SupportTicketDetails)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, Object { "code": "OperationsApiResponseSchema", "id": "R4018", @@ -147687,7 +147323,7 @@ Array [ "id": "R4005", "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/timeseriesinsights/resource-manager/Microsoft.TimeSeriesInsights/stable/2020-05-15/timeseriesinsights.json:1833:8 ($.definitions.EventSourceCreateOrUpdateParameters.properties.kind)", "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/timeseriesinsights/resource-manager/Microsoft.TimeSeriesInsights/stable/2020-05-15/timeseriesinsights.json:1833:8 ($.definitions.EventSourceCreateOrUpdateParameters.properties.kind)", - "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name is kind", + "message": "Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique. The duplicate x-ms-enum name: kind, path: $.EnvironmentCreateOrUpdateParameters.properties.kind", "providerNamespace": false, "resourceType": false, "sources": Array [ @@ -157427,20 +157063,6 @@ Array [ "type": "error", "validationCategory": "ARMViolation", }, - Object { - "code": "TopLevelResourcesListByResourceGroup", - "id": "R4016", - "json-path": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/web/resource-manager/Microsoft.DomainRegistration/stable/2019-08-01/TopLevelDomains.json:208:4 ($.definitions.TopLevelDomain)", - "jsonref": "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/web/resource-manager/Microsoft.DomainRegistration/stable/2019-08-01/TopLevelDomains.json:208:4 ($.definitions.TopLevelDomain)", - "message": "The top-level resource \\"TopLevelDomain\\" does not have list by resource group operation, please add it.", - "providerNamespace": false, - "resourceType": false, - "sources": Array [ - "file:///home/vsts/work/1/s/regression/azure-rest-api-specs/specification/web/resource-manager/Microsoft.DomainRegistration/stable/2019-08-01/TopLevelDomains.json:208:4 ($.definitions.TopLevelDomain)", - ], - "type": "error", - "validationCategory": "ARMViolation", - }, Object { "code": "OperationsApiResponseSchema", "id": "R4018", diff --git a/src/typescript/azure-openapi-validator/index.ts b/src/typescript/azure-openapi-validator/index.ts index 1539b2f8b..c84dcdb46 100644 --- a/src/typescript/azure-openapi-validator/index.ts +++ b/src/typescript/azure-openapi-validator/index.ts @@ -39,6 +39,7 @@ require("./rules/PreviewVersionOverOneYear") require("./rules/UniqueXmsExample") require("./rules/UniqueClientParameterName") require("./rules/ValidResponseCodeRequired") +require("./rules/Rpaas_ResourceProvisioningState") export async function run( document: string, openapiDefinition: any, diff --git a/src/typescript/azure-openapi-validator/rules/AvoidEmptyResponseSchema.ts b/src/typescript/azure-openapi-validator/rules/AvoidEmptyResponseSchema.ts index 36e44d32a..58ad2249f 100644 --- a/src/typescript/azure-openapi-validator/rules/AvoidEmptyResponseSchema.ts +++ b/src/typescript/azure-openapi-validator/rules/AvoidEmptyResponseSchema.ts @@ -16,9 +16,9 @@ rules.push({ openapiType: OpenApiTypes.arm, appliesTo_JsonQuery: "$.paths.*.*.responses.*.schema", *run(doc, node, path) { - const msg: string = "Response schema must not be empty" + const msg: string = "Response schema must not be empty." if (!Object.keys(node).length) { - yield { message: `${msg}'`, location: path } + yield { message: `${msg}`, location: path } } } }) diff --git a/src/typescript/azure-openapi-validator/rules/Rpaas_ResourceProvisioningState.ts b/src/typescript/azure-openapi-validator/rules/Rpaas_ResourceProvisioningState.ts new file mode 100644 index 000000000..50b4da673 --- /dev/null +++ b/src/typescript/azure-openapi-validator/rules/Rpaas_ResourceProvisioningState.ts @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import { MergeStates, OpenApiTypes, rules } from "../rule" +import { ResourceUtils } from "./utilities/resourceUtils" +import { JsonPath } from "../../jsonrpc/types" +export const Rpaas_ResourceProvisioningState: string = "Rpaas_ResourceProvisioningState" + +rules.push({ + id: "R4031", + name: Rpaas_ResourceProvisioningState, + severity: "error", + category: "RPaaSViolation", + mergeState: MergeStates.individual, + openapiType: OpenApiTypes.rpaas, + appliesTo_JsonQuery: "$", + *run(doc, node, path) { + const msg = `[RPaaS] The resource {0} is defined without 'provisioningState' in properties bag, consider adding the provisioningState for it.` + const utils = new ResourceUtils(doc) + const allResources = utils.getAllResource() + for (const resource of allResources) { + const model = utils.getResourceByName(resource) + const properties = utils.getPropertyOfModel(model,"properties") + let hasProvisioningState = false + if (properties && (!properties.type || properties.type === "object")) { + if (utils.getPropertyOfModel(properties,"provisioningState")) { + hasProvisioningState = true + } + + } + if (!hasProvisioningState) { + yield { message: msg.replace("{0}", resource), + location: ["$", "definitions", resource] as JsonPath} + } + } + } +}) diff --git a/src/typescript/azure-openapi-validator/rules/TopLevelResourcesListByResourceGroup.ts b/src/typescript/azure-openapi-validator/rules/TopLevelResourcesListByResourceGroup.ts index d13be79eb..796f3842b 100644 --- a/src/typescript/azure-openapi-validator/rules/TopLevelResourcesListByResourceGroup.ts +++ b/src/typescript/azure-openapi-validator/rules/TopLevelResourcesListByResourceGroup.ts @@ -15,7 +15,7 @@ rules.push({ *run(doc, node, path) { const msg: string = 'The top-level resource "{0}" does not have list by resource group operation, please add it.' const utils = new ResourceUtils(doc) - const topLevelResources = utils.getAllTopLevelResources() + const topLevelResources = utils.getTopLevelResourcesByRG() const allCollectionPath = utils.getCollectionApiInfo() for (const resource of topLevelResources) { const hasMatched = allCollectionPath.some( diff --git a/src/typescript/azure-openapi-validator/rules/UniqueXmsEnumName.ts b/src/typescript/azure-openapi-validator/rules/UniqueXmsEnumName.ts index caefaa1d8..7ea4a7a04 100644 --- a/src/typescript/azure-openapi-validator/rules/UniqueXmsEnumName.ts +++ b/src/typescript/azure-openapi-validator/rules/UniqueXmsEnumName.ts @@ -5,7 +5,7 @@ import { MergeStates, OpenApiTypes, rules } from "../rule" import { isValidEnum, transformEnum } from "./utilities/rules-helper" export const UniqueXmsEnumName: string = "UniqueXmsEnumName" -import { nodes } from "jsonpath" +import { nodes,stringify } from "jsonpath" rules.push({ id: "R4005", @@ -18,24 +18,30 @@ rules.push({ *run(doc, node, path) { const msg: string = `Must not have duplicate name of x-ms-enum extension , make sure every x-ms-enum name unique.` if (node) { - const enumMap = new Map() + const enumMap = new Map() for (const section of nodes(node, "$..*[?(@.enum)]")) { if (section.value["x-ms-enum"] && isValidEnum(section.value)) { const enumName = section.value["x-ms-enum"].name.toLowerCase() if (enumMap.has(enumName)) { - const curEnum = transformEnum(section.value.type, section.value.enum) - const existingEnum = enumMap.get(enumName) + const curEnum = section.value.enum + const existingNode = enumMap.get(enumName) + const existingEnum = existingNode.value.enum + const existingEnumModelAsString = existingNode.value["x-ms-enum"].modelAsString || false + const currentEnumModelAsString = section.value["x-ms-enum"].modelAsString || false /** - * if existing , check if the two enums' enties is same. + * if existing , check if the two enums are same. */ if ( + section.value.type !== existingNode.value.type || + currentEnumModelAsString !== existingEnumModelAsString || existingEnum.length !== curEnum.length || - existingEnum.some((value, index) => curEnum[index].toLowerCase() !== value.toLowerCase()) + // if modelAsString is true , the order of the values is insensitive , otherwise the order is sensitive. + currentEnumModelAsString ? existingEnum.some(value=> !curEnum.includes(value)) : existingEnum.some((value, index) => curEnum[index] !== value) ) { - yield { message: `${msg} The duplicate x-ms-enum name is ${enumName}`, location: path.concat(section.path.slice(1)) } + yield { message: `${msg} The duplicate x-ms-enum name: ${enumName}, path: ${stringify(existingNode.path)}`, location: path.concat(section.path.slice(1)) } } } else { - enumMap.set(enumName, section.value.enum) + enumMap.set(enumName, section) } } } diff --git a/src/typescript/azure-openapi-validator/rules/utilities/resourceUtils.ts b/src/typescript/azure-openapi-validator/rules/utilities/resourceUtils.ts index 341884efe..e37b3dea8 100644 --- a/src/typescript/azure-openapi-validator/rules/utilities/resourceUtils.ts +++ b/src/typescript/azure-openapi-validator/rules/utilities/resourceUtils.ts @@ -82,7 +82,7 @@ export class ResourceUtils { } } - private getResourceByName(modelName: string) { + public getResourceByName(modelName: string) { if (!modelName) { return undefined } @@ -132,6 +132,10 @@ export class ResourceUtils { } } + + /** + * Get all resources which allOf a x-ms-resource + */ public getAllOfResources() { const keys = Object.keys(this.innerDoc.definitions as object) const AllOfResources = keys.reduce((pre, cur) => { @@ -195,6 +199,42 @@ export class ResourceUtils { } return topLevelModels } + + public getTopLevelResourcesByRG() { + const fullModels = this.getOperationGetResponseResources() + const topLevelModels = new Set() + for (const entry of fullModels.entries()) { + const paths = entry[1] + paths + .filter(p => this.isPathByResourceGroup(p)) + .some(p => { + const hierarchy = this.getResourcesTypeHierarchy(p) + if (hierarchy.length === 1) { + topLevelModels.add(entry[0]) + return true + } + }) + } + return topLevelModels + } + + public getAllResource() { + const fullModels = this.getOperationGetResponseResources() + const resources = new Set() + for (const entry of fullModels.entries()) { + const paths = entry[1] + paths + .some(p => { + const hierarchy = this.getResourcesTypeHierarchy(p) + if (hierarchy.length > 0) { + resources.add(entry[0]) + return true + } + }) + } + return resources.values() + } + /** * * @param path @@ -249,8 +289,25 @@ export class ResourceUtils { return hierarchy } - private dereference(ref: string) { - return this.getResourceByName(this.stripDefinitionPath(ref)) + private dereference(ref: string, visited:Set) { + if (visited.has(ref)) { + return undefined + } + visited.add(ref) + const model = this.getResourceByName(this.stripDefinitionPath(ref)) + if (model && model.$ref) { + return this.dereference(model.$ref, visited) + } + else { + return model + } + } + + private getUnwrappedModel(property:any) { + if (property) { + const ref = property.$ref + return ref ? this.dereference(ref, new Set()) : property + } } public containsDiscriminator(modelName: string) { @@ -325,7 +382,7 @@ export class ResourceUtils { }) } /** - * if a resource definition the match a collection resource schema, we can back-stepping the corresponding operation to make sure + * if a resource definition does match a collection resource schema, we can back-stepping the corresponding operation to make sure * we don't lost it */ const collectionResources = this.getCollectionResources() @@ -432,21 +489,7 @@ export class ResourceUtils { if (!model) { return undefined } - if (model.properties) { - if (model.properties[propertyName]) { - const ref = model.properties[propertyName].$ref - return ref ? this.dereference(ref) : model.properties[propertyName] - } - } - if (model.allOf) { - for (const element of model.allOf) { - const property = this.getPropertyOfModelName(this.stripDefinitionPath(element.$ref), propertyName) - if (property) { - const ref = property.$ref - return ref ? this.dereference(ref) : property - } - } - } + return this.getPropertyOfModel(model,propertyName) } public getPropertyOfModel(sourceModel, propertyName: string) { @@ -455,20 +498,24 @@ export class ResourceUtils { } let model = sourceModel if (sourceModel.$ref) { - model = this.getResourceByName(this.stripDefinitionPath(sourceModel)) + model = this.getUnwrappedModel(sourceModel.$ref) } - if (model.properties) { - if (model.properties[propertyName]) { - const ref = model.properties[propertyName].$ref - return ref ? this.dereference(ref) : model.properties[propertyName] - } + if (!model) { + return undefined + } + if (model.properties && model.properties[propertyName]) { + return this.getUnwrappedModel(model.properties[propertyName]) } if (model.allOf) { for (const element of model.allOf) { - const property = this.getPropertyOfModelName(this.stripDefinitionPath(element.$ref), propertyName) - if (property) { - const ref = property.$ref - return ref ? this.dereference(ref) : property + if (element.$ref) { + const property = this.getPropertyOfModelName(this.stripDefinitionPath(element.$ref), propertyName) + if (property) { + return this.getUnwrappedModel(property) + } + } + else { + return this.getPropertyOfModel(element,propertyName) } } } diff --git a/src/typescript/azure-openapi-validator/rules/utilities/rules-helper.ts b/src/typescript/azure-openapi-validator/rules/utilities/rules-helper.ts index d64efba01..994f8c27f 100644 --- a/src/typescript/azure-openapi-validator/rules/utilities/rules-helper.ts +++ b/src/typescript/azure-openapi-validator/rules/utilities/rules-helper.ts @@ -128,7 +128,7 @@ export function isValidEnum(node) { if (!node || !node.type || typeof node.type !== "string") { return false } - return ["boolean", "integer", "number", "string"].indexOf(node.type) !== -1 + return ["boolean", "integer", "number", "string"].indexOf(node.type) !== -1 && Array.isArray(node.enum) } export function transformEnum(type: string, enumEntries) { diff --git a/src/typescript/azure-openapi-validator/tests/individual-azure-tests.ts b/src/typescript/azure-openapi-validator/tests/individual-azure-tests.ts index 4ed39820c..21990a569 100644 --- a/src/typescript/azure-openapi-validator/tests/individual-azure-tests.ts +++ b/src/typescript/azure-openapi-validator/tests/individual-azure-tests.ts @@ -29,6 +29,7 @@ import { PathResourceTypeNameCamelCase } from "./../rules/PathResourceTypeNameCa import { assertValidationRuleCount, collectTestMessagesFromValidator } from "./utilities/tests-helper" import { Rpaas_DeleteOperationAsyncResponseValidation } from "../rules/Rpaas_DeleteOperationAsyncResponseValidation" import { Rpaas_PostOperationAsyncResponseValidation } from "../rules/Rpaas_PostOperationAsyncResponseValidation" +import { Rpaas_ResourceProvisioningState } from "../rules/Rpaas_ResourceProvisioningState" @suite class IndividualAzureTests { @test public async "control characters not allowed test"() { @@ -245,6 +246,17 @@ class IndividualAzureTests { assertValidationRuleCount(messages, Rpaas_PostOperationAsyncResponseValidation, 0) } + @test public async "Raas resource is defined with empty properties"() { + const fileName = "RpaasResourceWithEmptyPropertiesBag.json" + const messages: Message[] = await collectTestMessagesFromValidator(fileName, OpenApiTypes.rpaas, MergeStates.individual) + assertValidationRuleCount(messages, Rpaas_ResourceProvisioningState, 1) + } + + @test public async "Raas resource is defined with provisioning properties"() { + const fileName = "RpaasResourceWithProvisioningState.json" + const messages: Message[] = await collectTestMessagesFromValidator(fileName, OpenApiTypes.rpaas, MergeStates.individual) + assertValidationRuleCount(messages, Rpaas_ResourceProvisioningState, 0) + } @test public async "Unique x-ms-examples"() { const fileName: string = "UniqueXmsExample.json" diff --git a/src/typescript/azure-openapi-validator/tests/resourceUtilsTest.ts b/src/typescript/azure-openapi-validator/tests/resourceUtilsTest.ts index b1836a0f7..51839ed4a 100644 --- a/src/typescript/azure-openapi-validator/tests/resourceUtilsTest.ts +++ b/src/typescript/azure-openapi-validator/tests/resourceUtilsTest.ts @@ -26,4 +26,24 @@ class ResourceUtilsTests { assert.equal(allCollectionInfo.length, 22) assert.equal(allCollectionModel.size, 21) } + + @test public "test get properties"() { + const swagger = readObjectFromFile(getFilePath("armResource/test_get_properties.json")) + const util = new ResourceUtils(swagger) + const bar = util.getResourceByName("A") + assert.deepEqual( + { + type: "string", + description: "p1" + }, + util.getPropertyOfModel(bar, "p1") + ) + const foo = util.getResourceByName("B") + assert.deepEqual( + { + description: "a ref" + }, + util.getPropertyOfModel(foo, "display") + ) + } } diff --git a/src/typescript/azure-openapi-validator/tests/resources/RpaasResourceWithEmptyPropertiesBag.json b/src/typescript/azure-openapi-validator/tests/resources/RpaasResourceWithEmptyPropertiesBag.json new file mode 100644 index 000000000..d1143f44b --- /dev/null +++ b/src/typescript/azure-openapi-validator/tests/resources/RpaasResourceWithEmptyPropertiesBag.json @@ -0,0 +1,97 @@ +{ + "swagger": "2.0", + "info": { + "title": "Network interfaces have unallowed types", + "description": "Some documentation.", + "version": "2014-04-01-preview" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "basePath": "/", + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { + "get": { + "operationId": "getTestResource", + "summary": "Foo path", + "description": "Foo operation", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersion" + } + ], + "responses": { + "200": { + "description": "Created", + "schema":{ + "$ref": "#/definitions/TestResource" + } + }, + "default": { + "description": "Unexpected error" + } + } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "test subscription id" + }, + "ApiVersion": { + "name": "api-version", + "in": "path", + "required": true, + "type": "string", + "description": "test api version" + } + }, + "definitions": { + "Resource": { + "properties": { + "id": { + "type": "string", + "description": "Resource ID." + }, + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type." + } + }, + "description": "Common resource representation.", + "x-ms-azure-resource": true + }, + "TestResource": { + "description": "test", + "allOf": [ + {"$ref": "#/definitions/Resource"} + ], + "properties": { + "properties":{ + "type":"object", + "description": "properties" + } + } + } + } +} \ No newline at end of file diff --git a/src/typescript/azure-openapi-validator/tests/resources/RpaasResourceWithProvisioningState.json b/src/typescript/azure-openapi-validator/tests/resources/RpaasResourceWithProvisioningState.json new file mode 100644 index 000000000..17959afb5 --- /dev/null +++ b/src/typescript/azure-openapi-validator/tests/resources/RpaasResourceWithProvisioningState.json @@ -0,0 +1,102 @@ +{ + "swagger": "2.0", + "info": { + "title": "Network interfaces have unallowed types", + "description": "Some documentation.", + "version": "2014-04-01-preview" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "basePath": "/", + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { + "get": { + "operationId": "getTestResource", + "summary": "Foo path", + "description": "Foo operation", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersion" + } + ], + "responses": { + "200": { + "description": "Created", + "schema":{ + "$ref": "#/definitions/TestResource" + } + }, + "default": { + "description": "Unexpected error" + } + } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "test subscription id" + }, + "ApiVersion": { + "name": "api-version", + "in": "path", + "required": true, + "type": "string", + "description": "test api version" + } + }, + "definitions": { + "Resource": { + "properties": { + "id": { + "type": "string", + "description": "Resource ID." + }, + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type." + } + }, + "description": "Common resource representation.", + "x-ms-azure-resource": true + }, + "TestResource": { + "description": "test", + "allOf": [ + {"$ref": "#/definitions/Resource"} + ], + "properties": { + "properties":{ + "type":"object", + "description": "properties", + "properties": { + "provisioningState":{ + "type":"string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/typescript/azure-openapi-validator/tests/resources/armResource/test_get_properties.json b/src/typescript/azure-openapi-validator/tests/resources/armResource/test_get_properties.json new file mode 100644 index 000000000..11fc63459 --- /dev/null +++ b/src/typescript/azure-openapi-validator/tests/resources/armResource/test_get_properties.json @@ -0,0 +1,200 @@ +{ + "swagger": "2.0", + "info": { + "version": "2016-04-01", + "title": "Machine Learning Workspaces Management Client", + "description": "These APIs allow end users to operate on Azure Machine Learning Workspace resources. They support CRUD operations for Azure Machine Learning Workspaces." + }, + "host": "management.azure.com", + "schemes": ["https"], + "security": [ + { + "azure_auth": ["user_impersonation"] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/providers/Microsoft.MachineLearning/operations": { + "get": { + "tags": ["Operation"], + "description": "Lists all of the available Azure Machine Learning Studio REST API operations.", + "operationId": "Operations_List", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request was successful; the request was well-formed and received properly.", + "schema": { + "$ref": "#/definitions/OperationListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "produces": ["application/json"], + "consumes": ["application/json"] + } + } + }, + "definitions": { + "ErrorResponse": { + "description": "The error response send when an operation fails.", + "properties": { + "code": { + "type": "string", + "description": "error code" + }, + "message": { + "type": "string", + "description": "error message" + } + }, + "required": ["code", "message"] + }, + "Display": { + "description": "a ref" + }, + "Operation": { + "description": "Azure Machine Learning Studio REST API operation", + "type": "object", + "properties": { + "name": { + "description": "Operation name: {provider}/{resource}/{operation}", + "type": "string" + }, + "display": { + "$ref":"#/definitions/Display" + } + } + }, + "OperationListResult": { + "description": "An array of operations supported by the resource provider.", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Operation" + }, + "description": "List of AML Studio operations supported by the AML Studio resource provider." + } + } + }, + "Resource": { + "description": "An Azure resource.", + "required": ["location"], + "properties": { + "id": { + "description": "The resource ID.", + "type": "string", + "readOnly": true + }, + "name": { + "description": "The name of the resource.", + "type": "string", + "readOnly": true + }, + "type": { + "description": "The type of the resource.", + "type": "string", + "readOnly": true + }, + "location": { + "description": "The location of the resource. This cannot be changed after the resource is created.", + "type": "string" + }, + "tags": { + "description": "The tags of the resource.", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "x-ms-azure-resource": true + }, + "A": { + "allOf": [ + { + "properties": { + "p1":{ + "type":"string", + "description": "p1" + } + } + }, + { + "$ref": "#/definitions/Resource" + } + ] + }, + "B": { + "allOf": [ + { + "$ref": "#/definitions/Operation" + } + ], + "properties": { + "p1":{ + "type":"object", + "properties": { + "pp1": { + "type":"string" + } + } + } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "description": "The Microsoft Azure subscription ID.", + "required": true, + "type": "string" + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "description": "The client API version.", + "required": true, + "type": "string" + }, + "ResourceGroupParameter": { + "name": "resourceGroupName", + "in": "path", + "description": "The name of the resource group to which the machine learning workspace belongs.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "WorkspaceNameParameter": { + "name": "workspaceName", + "in": "path", + "description": "The name of the machine learning workspace.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + } + } +} \ No newline at end of file diff --git a/src/typescript/azure-openapi-validator/tests/utilities/tests-helper.ts b/src/typescript/azure-openapi-validator/tests/utilities/tests-helper.ts index f5e30823b..d0571f915 100644 --- a/src/typescript/azure-openapi-validator/tests/utilities/tests-helper.ts +++ b/src/typescript/azure-openapi-validator/tests/utilities/tests-helper.ts @@ -4,12 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from "assert" import { safeLoad } from "js-yaml" -import { only, skip, slow, suite, test, timeout } from "mocha-typescript" import { run } from "../../../azure-openapi-validator" -import { AutoRestPluginHost } from "../../../jsonrpc/plugin-host" import { Message } from "../../../jsonrpc/types" import { MergeStates, OpenApiTypes } from "../../rule" - const fs = require("fs") const path = require("path") const pathToTestResources: string = "../../tests/resources/" diff --git a/src/typescript/package.json b/src/typescript/package.json index 79e34c5b7..9895ce4fa 100644 --- a/src/typescript/package.json +++ b/src/typescript/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft.azure/openapi-validator", - "version": "1.6.0", + "version": "1.7.0", "description": "Azure OpenAPI Validator", "main": "src/index.js", "scripts": {