From 9842ff2bf1d3c8740a70c170574a3e3df39e784c Mon Sep 17 00:00:00 2001 From: Zhenyu Zhou Date: Mon, 10 Oct 2022 16:20:00 +0800 Subject: [PATCH 1/2] Fix operation missed example and duration value is invalid format in example linter errors --- ...ocations_ValidateClusterCreateRequest.json | 2 +- .../examples/ListHDInsightOperations.json | 31 +++++++++++++++++++ .../stable/2018-06-01-preview/operations.json | 5 +++ ...ocations_ValidateClusterCreateRequest.json | 2 +- .../examples/ListHDInsightOperations.json | 31 +++++++++++++++++++ .../stable/2021-06-01/operations.json | 5 +++ 6 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/examples/ListHDInsightOperations.json create mode 100644 specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/ListHDInsightOperations.json diff --git a/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/examples/HDI_Locations_ValidateClusterCreateRequest.json b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/examples/HDI_Locations_ValidateClusterCreateRequest.json index db500e26a969..1ff9df143412 100644 --- a/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/examples/HDI_Locations_ValidateClusterCreateRequest.json +++ b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/examples/HDI_Locations_ValidateClusterCreateRequest.json @@ -103,7 +103,7 @@ "200": { "body": { "validationErrors": [], - "estimatedCreationDuration": "00:20:00" + "estimatedCreationDuration": "PT20M" } } } diff --git a/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/examples/ListHDInsightOperations.json b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/examples/ListHDInsightOperations.json new file mode 100644 index 000000000000..ee290785e23e --- /dev/null +++ b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/examples/ListHDInsightOperations.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "api-version": "2018-06-01-preview" + }, + "responses": { + "200": { + "value": [ + { + "name": "Microsoft.HDInsight/register/action", + "display": { + "provider": "Microsoft.HDInsight", + "resource": null, + "operation": "Register HDInsight resource provider", + "description": "Register HDInsight resource provider for the subscription" + }, + "properties": null + }, + { + "name": "Microsoft.HDInsight/unregister/action", + "display": { + "provider": "Microsoft.HDInsight", + "resource": null, + "operation": "Unregister HDInsight resource provider", + "description": "Unregister HDInsight resource provider for the subscription" + }, + "properties": null + } + ] + } + } +} diff --git a/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/operations.json b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/operations.json index 48beffae6656..55eaa9c1fb65 100644 --- a/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/operations.json +++ b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/operations.json @@ -41,6 +41,11 @@ ], "description": "Lists all of the available HDInsight REST API operations.", "operationId": "Operations_List", + "x-ms-examples": { + "Lists all of the available operations": { + "$ref": "./examples/ListHDInsightOperations.json" + } + }, "parameters": [ { "$ref": "#/parameters/ApiVersionParameter" diff --git a/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/HDI_Locations_ValidateClusterCreateRequest.json b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/HDI_Locations_ValidateClusterCreateRequest.json index c7e6c687da34..1095f47c3b9a 100644 --- a/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/HDI_Locations_ValidateClusterCreateRequest.json +++ b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/HDI_Locations_ValidateClusterCreateRequest.json @@ -103,7 +103,7 @@ "200": { "body": { "validationErrors": [], - "estimatedCreationDuration": "00:20:00" + "estimatedCreationDuration": "PT20M" } } } diff --git a/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/ListHDInsightOperations.json b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/ListHDInsightOperations.json new file mode 100644 index 000000000000..d1006b7cd561 --- /dev/null +++ b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/ListHDInsightOperations.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "api-version": "2021-06-01" + }, + "responses": { + "200": { + "value": [ + { + "name": "Microsoft.HDInsight/register/action", + "display": { + "provider": "Microsoft.HDInsight", + "resource": null, + "operation": "Register HDInsight resource provider", + "description": "Register HDInsight resource provider for the subscription" + }, + "properties": null + }, + { + "name": "Microsoft.HDInsight/unregister/action", + "display": { + "provider": "Microsoft.HDInsight", + "resource": null, + "operation": "Unregister HDInsight resource provider", + "description": "Unregister HDInsight resource provider for the subscription" + }, + "properties": null + } + ] + } + } +} diff --git a/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/operations.json b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/operations.json index 04a864355aea..628513f5fd41 100644 --- a/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/operations.json +++ b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/operations.json @@ -41,6 +41,11 @@ ], "description": "Lists all of the available HDInsight REST API operations.", "operationId": "Operations_List", + "x-ms-examples": { + "Lists all of the available operations": { + "$ref": "./examples/ListHDInsightOperations.json" + } + }, "parameters": [ { "$ref": "#/parameters/ApiVersionParameter" From 54ab50e23d5066484f6c169903832b6fc469e53b Mon Sep 17 00:00:00 2001 From: Zhenyu Zhou Date: Mon, 10 Oct 2022 18:09:41 +0800 Subject: [PATCH 2/2] Update example file to fix schema issue --- .../examples/ListHDInsightOperations.json | 44 ++++++++++--------- .../examples/ListHDInsightOperations.json | 44 ++++++++++--------- 2 files changed, 46 insertions(+), 42 deletions(-) diff --git a/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/examples/ListHDInsightOperations.json b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/examples/ListHDInsightOperations.json index ee290785e23e..0537940b4db1 100644 --- a/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/examples/ListHDInsightOperations.json +++ b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/examples/ListHDInsightOperations.json @@ -4,28 +4,30 @@ }, "responses": { "200": { - "value": [ - { - "name": "Microsoft.HDInsight/register/action", - "display": { - "provider": "Microsoft.HDInsight", - "resource": null, - "operation": "Register HDInsight resource provider", - "description": "Register HDInsight resource provider for the subscription" + "body": { + "value": [ + { + "name": "Microsoft.HDInsight/register/action", + "display": { + "provider": "Microsoft.HDInsight", + "resource": null, + "operation": "Register HDInsight resource provider", + "description": "Register HDInsight resource provider for the subscription" + }, + "properties": null }, - "properties": null - }, - { - "name": "Microsoft.HDInsight/unregister/action", - "display": { - "provider": "Microsoft.HDInsight", - "resource": null, - "operation": "Unregister HDInsight resource provider", - "description": "Unregister HDInsight resource provider for the subscription" - }, - "properties": null - } - ] + { + "name": "Microsoft.HDInsight/unregister/action", + "display": { + "provider": "Microsoft.HDInsight", + "resource": null, + "operation": "Unregister HDInsight resource provider", + "description": "Unregister HDInsight resource provider for the subscription" + }, + "properties": null + } + ] + } } } } diff --git a/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/ListHDInsightOperations.json b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/ListHDInsightOperations.json index d1006b7cd561..461024cb0d20 100644 --- a/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/ListHDInsightOperations.json +++ b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/ListHDInsightOperations.json @@ -4,28 +4,30 @@ }, "responses": { "200": { - "value": [ - { - "name": "Microsoft.HDInsight/register/action", - "display": { - "provider": "Microsoft.HDInsight", - "resource": null, - "operation": "Register HDInsight resource provider", - "description": "Register HDInsight resource provider for the subscription" + "body": { + "value": [ + { + "name": "Microsoft.HDInsight/register/action", + "display": { + "provider": "Microsoft.HDInsight", + "resource": null, + "operation": "Register HDInsight resource provider", + "description": "Register HDInsight resource provider for the subscription" + }, + "properties": null }, - "properties": null - }, - { - "name": "Microsoft.HDInsight/unregister/action", - "display": { - "provider": "Microsoft.HDInsight", - "resource": null, - "operation": "Unregister HDInsight resource provider", - "description": "Unregister HDInsight resource provider for the subscription" - }, - "properties": null - } - ] + { + "name": "Microsoft.HDInsight/unregister/action", + "display": { + "provider": "Microsoft.HDInsight", + "resource": null, + "operation": "Unregister HDInsight resource provider", + "description": "Unregister HDInsight resource provider for the subscription" + }, + "properties": null + } + ] + } } } }