Skip to content

Latest commit

 

History

History
78 lines (63 loc) · 1.54 KB

File metadata and controls

78 lines (63 loc) · 1.54 KB

QueryParametersInCollectionGet

Category

ARM Error

Applies to

ARM OpenAPI(swagger) specs

Related ARM Guideline Code

  • RPC-Get-V1-15

Description

Collection Get's/List operations MUST not have query parameters other than api-version & OData filter.

How to fix the violation

Ensure that collection GET/List operations do not include any query parameters other than api-version and the OData $filter.

Good Examples

      "Microsoft.Music/Songs": {
        "get": {
          "operationId": "Foo_Update",
          "description": "Test Description",
          "parameters": [
            {
              "name": "api-version",
              "in": "query"
            },
          ],
        },
      },
      "Microsoft.Music/Songs": {
        "get": {
          "operationId": "Foo_Update",
          "description": "Test Description",
          "parameters": [
            {
              "name": "api-version",
              "in": "query"
            },
            {
              "name": "$filter",
              "in": "query",
              "required": false,
              "type": "string",
            },
          ],
        },
      },

Bad Examples

      "Microsoft.Music/Songs": {
        "get": {
          "operationId": "Foo_Update",
          "description": "Test Description",
          "parameters": [
            {
              "name": "name",
              "in": "query",
              "required": false,
              "type": "string",
            },
          ],
        },
      },