Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 1.24 KB

all-resources-must-have-get-operation.md

File metadata and controls

53 lines (34 loc) · 1.24 KB

AllResourcesMustHaveGetOperation

Category

ARM Error

Applies to

ARM OpenAPI(swagger) specs

Related ARM Guideline Code

  • RPC-Get-V1-04

Output Message

The resource "{0}" does not have get operation, please add it.

Description

Per ARM guidelines ,all the resources ,including top-level and nested resources, must have a get operation.

CreatedAt

July 13, 2020

LastModifiedAt

July 13, 2020

How to fix the violation

Since all the models that having 'x-ms-azure-resource' enabled are considered as ARM resource, If the output resource is not exactly a ARM resource,you should remove the extension from the model. Otherwise,for each resource which doesn't have a get operation,add the corresponding get operation.

For example:

"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MyNameSpace/MyResourceType/{Name}/SubResource/{subName}": {
      "get": {
         ...
        "operationId": "SubResource_Get",
        "parameters": [

        ],
        "responses": {
          "200": {
            "schema": {
              "$ref": "#/definitions/SubResource"
            }
          },