Project: KICS (Provisioning / Security & Compliance)
File: 750f6448-27c0-49f8-a153-b81735c1e19c.md

title: Multi 'collectionformat' Not Valid For 'in' Parameter hide: toc: true navigation: true <style> .highlight .hll { background-color: #ff171742; } .md-content { max-width: 1100px; margin: 0 auto; } </style> Query id: 750f6448-27c0-49f8-a153-b81735c1e19c Query name: Multi 'collectionformat' Not Valid For 'in' Parameter Platform: OpenAPI Severity: <span style="color:#5bc0de">Info</span> Category: Structure and Semantics URL: When 'collectionformat' is defined as 'multi', 'in' field must be 'query' or 'formData'<br> ```json title="Positive test num. 1 - json file" hl_lines="37 13" { "swagger": "2.0", "info": { "title": "Simple API Overview", "version": "1.0.0" }, "paths": { "/": { "get": { "parameters": [ { "name": "limit2", "in": "path", "description": "max records to return", "required": true, "type": "array", "items": { "type": "integer", "format": "int64" }, "collectionFormat": "multi" } ], "operationId": "listVersionsV2", "summary": "List API versions", "responses": { "200": { "description": "200 response" } } } } }, "parameters": { "limitParam": { "name": "limit", "in": "path", "description": "max records to return", "required": true, "type": "array", "items": { "type": "integer", "format": "int64" }, "collectionFormat": "multi" } } } ``` ```yaml title="Positive test num. 2 - yaml file" hl_lines="10 26" swagger: '2.0' info: title: Simple API Overview version: 1.0.0 paths: "/": get: parameters: name: limit2 in: path description: max records to return required: true type: array items: type: integer format: int64 collectionFormat: multi operationId: listVersionsV2 summary: List API versions responses: '200': description: 200 response parameters: limitParam: name: limit in: path description: max records to return required: true type: array items: type: integer format: int64 collectionFormat: multi ``` ```json title="Negative test num. 1 - json file" { "swagger": "2.0", "info": { "title": "Simple API Overview", "version": "1.0.0" }, "paths": { "/": { "get": { "parameters": [ { "name": "limit2", "in": "query", "description": "max records to return", "required": true, "type": "array", "items": { "type": "integer", "format": "int64" }, "collectionFormat": "multi" } ], "operationId": "listVersionsV2", "summary": "List API versions", "responses": { "200": { "description": "200 response" } } } } }, "parameters": { "limitParam": { "name": "limit", "in": "path", "description": "max records to return", "required": true, "type": "array", "items": { "type": "integer", "format": "int64" }, "collectionFormat": "csv" } } } ``` ```yaml title="Negative test num. 2 - yaml file" swagger: '2.0' info: title: Simple API Overview version: 1.0.0 paths: "/": get: parameters: name: limit2 in: query description: max records to return required: true type: array items: type: integer format: int64 collectionFormat: multi operationId: listVersionsV2 summary: List API versions responses: '200': description: 200 response parameters: limitParam: name: limit in: path description: max records to return required: true type: array items: type: integer format: int64 collectionFormat: csv ```