Project: KICS (Provisioning / Security & Compliance)
File: 750b40be-4bac-4f59-bdc4-1ca0e6c3450e.md

title: Property Not Unique hide: toc: true navigation: true <style> .highlight .hll { background-color: #ff171742; } .md-content { max-width: 1100px; margin: 0 auto; } </style> Query id: 750b40be-4bac-4f59-bdc4-1ca0e6c3450e Query name: Property Not Unique Platform: OpenAPI Severity: <span style="color:#5bc0de">Info</span> Category: Structure and Semantics URL: Every defined property must be unique throughout the whole API<br> ```json title="Positive test num. 1 - json file" hl_lines="33 54 57 27 60 30" { "swagger": "2.0", "info": { "title": "Simple API Overview", "version": "1.0.0" }, "basePath": "/api", "paths": { "/": { "get": { "operationId": "listVersionsv2", "summary": "List API versions", "responses": { "200": { "description": "200 response" } }, "parameters": [ { "name": "limit2", "in": "body", "description": "max records to return", "required": true, "schema": { "type": "object", "properties": { "name": { "type": "string" }, "address": { "$ref": "#/definitions/Address" }, "age": { "type": "integer", "format": "int32" } } } } ] } } }, "parameters": { "limitParam": { "name": "limit", "in": "body", "description": "max records to return", "required": true, "schema": { "type": "object" }, "properties": { "name": { "type": "string" }, "address": { "$ref": "#/definitions/Address" }, "age": { "type": "integer", "format": "int32" } } } } } ``` ```yaml title="Positive test num. 2 - yaml file" hl_lines="38 40 42 22 24 26" swagger: "2.0" info: title: Simple API Overview version: 1.0.0 basePath: "/api" paths: "/": get: operationId: listVersionsv2 summary: List API versions responses: "200": description: 200 response parameters: name: limit2 in: body description: max records to return required: true schema: type: object properties: name: type: string address: $ref: "#/definitions/Address" age: type: integer format: int32 parameters: limitParam: name: limit in: body description: max records to return required: true schema: type: object properties: name: type: string address: $ref: "#/definitions/Address" age: type: integer format: int32 ``` ```json title="Negative test num. 1 - json file" { "swagger": "2.0", "info": { "title": "Simple API Overview", "version": "1.0.0" }, "basePath": "/api", "paths": { "/": { "get": { "operationId": "listVersionsv2", "summary": "List API versions", "responses": { "200": { "description": "200 response" } }, "parameters": [ { "name": "limit2", "in": "body", "description": "max records to return", "required": true, "schema": { "type": "object", "properties": { "name": { "type": "string" }, "address": { "$ref": "#/definitions/Address" }, "age": { "type": "integer", "format": "int32" } } } } ] } } }, "parameters": { "limitParam": { "name": "limit", "in": "body", "description": "max records to return", "required": true, "schema": { "type": "object" }, "properties": { "name_2": { "type": "string" }, "address_2": { "$ref": "#/definitions/Address" }, "age_2": { "type": "integer", "format": "int32" } } } } } ``` ```yaml title="Negative test num. 2 - yaml file" swagger: "2.0" info: title: Simple API Overview version: 1.0.0 basePath: "/api" paths: "/": get: operationId: listVersionsv2 summary: List API versions responses: "200": description: 200 response parameters: name: limit2 in: body description: max records to return required: true schema: type: object properties: name: type: string address: $ref: "#/definitions/Address" age: type: integer format: int32 parameters: limitParam: name: limit in: body description: max records to return required: true schema: type: object properties: name_2: type: string address_2: $ref: "#/definitions/Address" age_2: type: integer format: int32 ```