-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7327 from Checkmarx/eduardose/maximum_length_unde…
…fined fix(query): openapi maximum_length_undefined query enum and format sanitizers
- Loading branch information
Showing
5 changed files
with
245 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
assets/queries/openAPI/general/maximum_length_undefined/test/negative10.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
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 | ||
components: | ||
schemas: | ||
GeneralError: | ||
type: object | ||
discriminator: | ||
propertyName: petType | ||
additionalProperties: false | ||
properties: | ||
code: | ||
type: string | ||
enum: | ||
- brown | ||
- grey | ||
- black | ||
- white | ||
message: | ||
type: string | ||
format: date | ||
extra: | ||
type: string | ||
format: date-time | ||
required: | ||
- petType | ||
requestBodies: | ||
NewItem: | ||
description: A JSON object containing item data | ||
required: true | ||
content: | ||
multipart/form-data: | ||
schema: | ||
$ref: "#/components/schemas/GeneralError" |
50 changes: 50 additions & 0 deletions
50
assets/queries/openAPI/general/maximum_length_undefined/test/negative11.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"title": "Simple API Overview", | ||
"version": "1.0.0", | ||
"contact": { | ||
"name": "contact", | ||
"url": "https://www.google.com/", | ||
"email": "[email protected]" | ||
} | ||
}, | ||
"paths": { | ||
"/": { | ||
"get": { | ||
"responses": { | ||
"200": { | ||
"description": "200 response", | ||
"schema": { | ||
"discriminator": "petType", | ||
"additionalProperties": false, | ||
"properties": { | ||
"code": { | ||
"type": "string", | ||
"enum": [ | ||
"brown", | ||
"grey", | ||
"black", | ||
"white" | ||
] | ||
}, | ||
"message": { | ||
"type": "string", | ||
"format": "date" | ||
}, | ||
"extra": { | ||
"type": "string", | ||
"format": "date-time" | ||
} | ||
}, | ||
"required": [ | ||
"petType" | ||
], | ||
"type": "object" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
assets/queries/openAPI/general/maximum_length_undefined/test/negative12.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
swagger: "2.0" | ||
info: | ||
title: Simple API Overview | ||
version: 1.0.0 | ||
paths: | ||
"/": | ||
get: | ||
operationId: listVersionsv2 | ||
summary: List API versions | ||
responses: | ||
"200": | ||
description: 200 response | ||
schema: | ||
type: object | ||
discriminator: petType | ||
additionalProperties: false | ||
properties: | ||
code: | ||
type: string | ||
enum: | ||
- brown | ||
- grey | ||
- black | ||
- white | ||
message: | ||
type: string | ||
format: date | ||
extra: | ||
type: string | ||
format: date-time | ||
required: | ||
- petType |
94 changes: 94 additions & 0 deletions
94
assets/queries/openAPI/general/maximum_length_undefined/test/negative9.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"openapi": "3.0.0", | ||
"info": { | ||
"title": "Simple API Overview", | ||
"version": "1.0.0", | ||
"contact": { | ||
"name": "contact", | ||
"url": "https://www.google.com/", | ||
"email": "[email protected]" | ||
} | ||
}, | ||
"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" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"GeneralError": { | ||
"type": "object", | ||
"discriminator": { | ||
"propertyName": "petType" | ||
}, | ||
"additionalProperties": false, | ||
"properties": { | ||
"code": { | ||
"type": "string", | ||
"enum": [ | ||
"brown", | ||
"grey", | ||
"black", | ||
"white" | ||
] | ||
}, | ||
"message": { | ||
"type": "string", | ||
"format": "date" | ||
}, | ||
"extra": { | ||
"type": "string", | ||
"format": "date-time" | ||
} | ||
}, | ||
"required": [ | ||
"petType" | ||
] | ||
} | ||
}, | ||
"requestBodies": { | ||
"NewItem": { | ||
"description": "A JSON object containing item data", | ||
"required": true, | ||
"content": { | ||
"multipart/form-data": { | ||
"schema": { | ||
"$ref": "#/components/schemas/GeneralError" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |