From 65d16945f6922fec1bae78d37367e36a793e657b Mon Sep 17 00:00:00 2001 From: Jin Soon Lim Date: Fri, 15 Mar 2019 15:54:22 -0700 Subject: [PATCH 1/2] Fix incorrect types --- ...ryResourceScopeExpandPolicyEvaluationDetails.json | 12 ++++++------ .../preview/2018-07-01-preview/policyStates.json | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceScopeExpandPolicyEvaluationDetails.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceScopeExpandPolicyEvaluationDetails.json index b7e3ea191a3c..f0dea990f1d9 100644 --- a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceScopeExpandPolicyEvaluationDetails.json +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/examples/PolicyStates_QueryResourceScopeExpandPolicyEvaluationDetails.json @@ -93,12 +93,12 @@ "policyEvaluationDetails": { "evaluatedExpressions": [ { - "result": "False", - "expression": "name", - "path": "name", - "expressionValue": "myDomainName", - "targetValue": "someName", - "operator": "Equals" + "result": "True", + "expression": "tags", + "path": "tags", + "expressionValue": {}, + "targetValue": "global-opco", + "operator": "NotContainsKey" } ], "ifNotExistsDetails": { diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/policyStates.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/policyStates.json index 6fa367e0a113..c0f69efd6a21 100644 --- a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/policyStates.json +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/policyStates.json @@ -1165,11 +1165,11 @@ }, "expressionValue": { "description": "Value of the expression.", - "type": "string" + "type": "object" }, "targetValue": { "description": "Target value to be compared with the expression value.", - "type": "string" + "type": "object" }, "operator": { "description": "Operator to compare the expression value and the target value.", From 5dec070cc11762115c20ebe31ac0b2d11428a326 Mon Sep 17 00:00:00 2001 From: Jin Soon Lim Date: Mon, 1 Apr 2019 15:52:55 -0700 Subject: [PATCH 2/2] Transform the type of expressionValue and targetValue to object type for the languages that support a generic object type. --- .../2018-07-01-preview/policyStates.json | 4 ++-- .../policyinsights/resource-manager/readme.md | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/policyStates.json b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/policyStates.json index c0f69efd6a21..6fa367e0a113 100644 --- a/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/policyStates.json +++ b/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/preview/2018-07-01-preview/policyStates.json @@ -1165,11 +1165,11 @@ }, "expressionValue": { "description": "Value of the expression.", - "type": "object" + "type": "string" }, "targetValue": { "description": "Target value to be compared with the expression value.", - "type": "object" + "type": "string" }, "operator": { "description": "Operator to compare the expression value and the target value.", diff --git a/specification/policyinsights/resource-manager/readme.md b/specification/policyinsights/resource-manager/readme.md index 1578d675bd00..ecd30c2cd761 100644 --- a/specification/policyinsights/resource-manager/readme.md +++ b/specification/policyinsights/resource-manager/readme.md @@ -145,6 +145,13 @@ csharp: namespace: Microsoft.Azure.Management.PolicyInsights output-folder: $(csharp-sdks-folder)/PolicyInsights/Management/Management.PolicyInsights/Generated clear-output-folder: true +directive: + - from: swagger-document + where: $.definitions.ExpressionEvaluationDetails.properties.expressionValue + transform: $.type = "object" + - from: swagger-document + where: $.definitions.ExpressionEvaluationDetails.properties.targetValue + transform: $.type = "object" ``` ## Python @@ -162,6 +169,13 @@ python: namespace: azure.mgmt.policyinsights package-name: azure-mgmt-policyinsights clear-output-folder: true +directive: + - from: swagger-document + where: $.definitions.ExpressionEvaluationDetails.properties.expressionValue + transform: $.type = "object" + - from: swagger-document + where: $.definitions.ExpressionEvaluationDetails.properties.targetValue + transform: $.type = "object" ``` ``` yaml $(python) && $(python-mode) == 'update' python: @@ -190,6 +204,13 @@ namespace: com.microsoft.azure.management.policyinsights license-header: MICROSOFT_MIT_NO_CODEGEN payload-flattening-threshold: 1 output-folder: $(azure-libraries-for-java-folder)/azure-mgmt-policyinsights +directive: + - from: swagger-document + where: $.definitions.ExpressionEvaluationDetails.properties.expressionValue + transform: $.type = "object" + - from: swagger-document + where: $.definitions.ExpressionEvaluationDetails.properties.targetValue + transform: $.type = "object" ``` ### Java multi-api