Project: KICS (Provisioning / Security & Compliance)
File: 59c2f769-7cc2-49c8-a3de-4e211135cfab.md

title: Property 'allowEmptyValue' Ignored hide: toc: true navigation: true <style> .highlight .hll { background-color: #ff171742; } .md-content { max-width: 1100px; margin: 0 auto; } </style> Query id: 59c2f769-7cc2-49c8-a3de-4e211135cfab Query name: Property 'allowEmptyValue' Ignored Platform: OpenAPI Severity: <span style="color:#5bc0de">Info</span> Category: Best Practices URL: Property 'allowEmptyValue' is ignored in the following cases: {sytle: simple, explode: false}, {sytle: simple, explode: true}, {sytle: spaceDelimited, explode: false}, {sytle: pipeDelimited, explode: false}, and {sytle: deepObject, explode: true}<br> ```json title="Positive test num. 1 - json file" hl_lines="47" { "openapi": "3.0.0", "info": { "title": "Simple API overview", "version": "1.0.0" }, "paths": { "/": { "get": { "operationId": "listVersionsv2", "summary": "List API versions", "responses": { "200": { "description": "200 response", "content": { "application/json": { "examples": { "foo": { "value": { "versions": [ { "status": "CURRENT", "updated": "2011-01-21T11:33:21Z", "id": "v2.0", "links": [ { "href": "http://127.0.0.1:8774/v2/", "rel": "self" } ] } ] } } } } } } } }, "parameters": [ { "name": "id", "in": "path", "description": "ID of the API version", "required": true, "allowEmptyValue": true, "schema": { "type": "integer" } } ] } } } ``` ```yaml title="Positive test num. 2 - yaml file" hl_lines="30" openapi: 3.0.0 info: title: Simple API overview version: 1.0.0 paths: "/": get: operationId: listVersionsv2 summary: List API versions responses: "200": description: 200 response content: application/json: examples: foo: value: versions: status: CURRENT updated: "2011-01-21T11:33:21Z" id: v2.0 links: href: http://127.0.0.1:8774/v2/ rel: self parameters: name: id in: path description: ID of the API version required: true allowEmptyValue: true schema: type: integer ``` ```json title="Positive test num. 3 - json file" hl_lines="12" { "openapi": "3.0.0", "info": { "title": "Simple API overview", "version": "1.0.0" }, "paths": { "/": { "parameters": [ { "required": true, "allowEmptyValue": true, "schema": { "type": "integer" }, "name": "id", "in": "query", "style": "deepObject", "explode": true, "description": "ID of the API version" } ], "get": { "operationId": "listVersionsv2", "summary": "List API versions", "responses": { "200": { "description": "200 response", "content": { "application/json": { "examples": { "foo": { "value": { "versions": [ { "status": "CURRENT", "updated": "2011-01-21T11:33:21Z", "id": "v2.0", "links": [ { "href": "http://127.0.0.1:8774/v2/", "rel": "self" } ] } ] } } } } } } } } } } } ``` <details><summary>Positive test num. 4 - yaml file</summary> ```yaml hl_lines="32" openapi: 3.0.0 info: title: Simple API overview version: 1.0.0 paths: "/": get: operationId: listVersionsv2 summary: List API versions responses: "200": description: 200 response content: application/json: examples: foo: value: versions: status: CURRENT updated: "2011-01-21T11:33:21Z" id: v2.0 links: href: http://127.0.0.1:8774/v2/ rel: self parameters: name: id in: query style: deepObject explode: true description: ID of the API version required: true allowEmptyValue: true schema: type: integer ``` </details> <details><summary>Positive test num. 5 - json file</summary> ```json hl_lines="16" { "openapi": "3.0.0", "info": { "title": "Simple API overview", "version": "1.0.0" }, "paths": { "/": { "parameters": [ { "name": "id", "in": "query", "style": "spaceDelimited", "description": "ID of the API version", "required": true, "allowEmptyValue": true, "schema": { "type": "integer" } } ], "get": { "operationId": "listVersionsv2", "summary": "List API versions", "responses": { "200": { "description": "200 response", "content": { "application/json": { "examples": { "foo": { "value": { "versions": [ { "status": "CURRENT", "updated": "2011-01-21T11:33:21Z", "id": "v2.0", "links": [ { "href": "http://127.0.0.1:8774/v2/", "rel": "self" } ] } ] } } } } } } } } } } } ``` </details> <details><summary>Positive test num. 6 - yaml file</summary> ```yaml hl_lines="31" openapi: 3.0.0 info: title: Simple API overview version:

paths: "/": get: operationId: listVersionsv2 summary: List API versions responses: "200": description: 200 response content: application/json: examples: foo: value: versions: status: CURRENT updated: "2011-01-21T11:33:21Z" id: v2.0 links: href: http://127.0.0.1:8774/v2/ rel: self parameters: name: id in: query style: spaceDelimited description: ID of the API version required: true allowEmptyValue: true schema: type: integer ``` </details> ```json title="Negative test num. 1 - json file" { "openapi": "3.0.0", "info": { "title": "Simple API overview", "version": "1.0.0" }, "paths": { "/": { "get": { "operationId": "listVersionsv2", "summary": "List API versions", "responses": { "200": { "description": "200 response", "content": { "application/json": { "examples": { "foo": { "value": { "versions": [ { "status": "CURRENT", "updated": "2011-01-21T11:33:21Z", "id": "v2.0", "links": [ { "href": "http://127.0.0.1:8774/v2/", "rel": "self" } ] } ] } } } } } } } }, "parameters": [ { "in": "path", "style": "label", "description": "ID of the API version", "required": true, "allowEmptyValue": true, "schema": { "type": "integer" } } ] } } } ``` ```yaml title="Negative test num. 2 - yaml file" openapi: 3.0.0 info: title: Simple API overview version: 1.0.0 paths: "/": get: operationId: listVersionsv2 summary: List API versions responses: "200": description: 200 response content: application/json: examples: foo: value: versions: status: CURRENT updated: "2011-01-21T11:33:21Z" id: v2.0 links: href: http://127.0.0.1:8774/v2/ rel: self parameters: name: id in: path style: label description: ID of the API version required: true allowEmptyValue: true schema: type: integer ``` ```json title="Negative test num. 3 - json file" { "openapi": "3.0.0", "info": { "title": "Simple API overview", "version": "1.0.0" }, "paths": { "/": { "parameters": [ { "required": true, "allowEmptyValue": true, "schema": { "type": "integer" }, "name": "id", "in": "query", "style": "deepObject", "explode": false, "description": "ID of the API version" } ], "get": { "operationId": "listVersionsv2", "summary": "List API versions", "responses": { "200": { "description": "200 response", "content": { "application/json": { "examples": { "foo": { "value": { "versions": [ { "status": "CURRENT", "updated": "2011-01-21T11:33:21Z", "id": "v2.0", "links": [ { "href": "http://127.0.0.1:8774/v2/", "rel": "self" } ] } ] } } } } } } } } } } } ``` <details><summary>Negative test num. 4 - yaml file</summary> ```yaml openapi: 3.0.0 info: title: Simple API overview version: 1.0.0 paths: "/": get: operationId: listVersionsv2 summary: List API versions responses: "200": description: 200 response content: application/json: examples: foo: value: versions: status: CURRENT updated: "2011-01-21T11:33:21Z" id: v2.0 links: href: http://127.0.0.1:8774/v2/ rel: self parameters: name: id in: query style: deepObject explode: false description: ID of the API version required: true allowEmptyValue: true schema: type: integer ``` </details> <details><summary>Negative test num. 5 - json file</summary> ```json { "openapi": "3.0.0", "info": { "title": "Simple API overview", "version": "1.0.0" }, "paths": { "/": { "parameters": [ { "name": "id", "in": "query", "style": "spaceDelimited", "explode": false, "description": "ID of the API version", "required": true, "allowEmptyValue": false, "schema": { "type": "integer" } } ], "get": { "operationId": "listVersionsv2", "summary": "List API versions", "responses": { "200": { "description": "200 response", "content": { "application/json": { "examples": { "foo": { "value": { "versions": [ { "status": "CURRENT", "updated": "2011-01-21T11:33:21Z", "id": "v2.0", "links": [ { "href": "http://127.0.0.1:8774/v2/", "rel": "self" } ] } ] } } } } } } } } } } } ``` </details> <details><summary>Negative test num. 6 - yaml file</summary> ```yaml openapi: 3.0.0 info: title: Simple API overview version: 1.0.0 paths: "/": get: operationId: listVersionsv2 summary: List API versions responses: "200": description: 200 response content: application/json: examples: foo: value: versions: status: CURRENT updated: "2011-01-21T11:33:21Z" id: v2.0 links: href: http://127.0.0.1:8774/v2/ rel: self parameters: name: id in: query style: spaceDelimited explode: false description: ID of the API version required: true allowEmptyValue: false schema: type: integer ``` </details>