Skip to content

Commit

Permalink
Merge pull request #6681 from Checkmarx/kics/934
Browse files Browse the repository at this point in the history
fix(query): add 2xx as possible response code
  • Loading branch information
JoaoAtGit authored Mar 13, 2024
2 parents ca7bef9 + 66d9283 commit c5a8011
Show file tree
Hide file tree
Showing 18 changed files with 308 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CxPolicy[result] {
not common_lib.valid_key(response, "201")
not common_lib.valid_key(response, "202")
not common_lib.valid_key(response, "204")
not common_lib.valid_key(response, "2XX")

result := {
"documentId": doc.id,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"swagger": "2.0",
"info": {
"title": "Simple API",
"version": "1.0.0"
},
"paths": {
"/item": {
"delete": {
"operationId": "deleteItem",
"summary": "Delete item",
"responses": {
"2XX": {
"description": "Item deleted successfully"
},
"default": {
"description": "Error"
}
}
},
"patch": {
"operationId": "updateItem",
"summary": "Update item",
"responses": {
"default": {
"description": "Error"
}
}
}
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
swagger: "2.0"
info:
title: Simple API
version: 1.0.0
paths:
"/item":
delete:
operationId: deleteItem
summary: Delete item
responses:
"2XX":
description: Item deleted successfully
default:
description: Error
patch:
operationId: updateItem
summary: Update item
responses:
default:
description: Error
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ CxPolicy[result] {

not common_lib.valid_key(response, "200")
not common_lib.valid_key(response, "202")
not common_lib.valid_key(response, "2XX")

result := {
"documentId": doc.id,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"swagger": "2.0",
"info": {
"title": "Simple API",
"version": "1.0.0"
},
"paths": {
"/item": {
"get": {
"operationId": "getItem",
"summary": "get item",
"responses": {
"2XX": {
"description": "Item getd successfully"
},
"default": {
"description": "Error"
}
}
},
"patch": {
"operationId": "updateItem",
"summary": "Update item",
"responses": {
"default": {
"description": "Error"
}
}
}
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
swagger: "2.0"
info:
title: Simple API
version: 1.0.0
paths:
"/item":
get:
operationId: getItem
summary: get item
responses:
"2XX":
description: Item getd successfully
default:
description: Error
patch:
operationId: updateItem
summary: Update item
responses:
default:
description: Error
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ CxPolicy[result] {

not common_lib.valid_key(response, "200")
not common_lib.valid_key(response, "202")
not common_lib.valid_key(response, "2XX")

result := {
"documentId": doc.id,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"swagger": "2.0",
"info": {
"title": "Simple API",
"version": "1.0.0"
},
"paths": {
"/item": {
"head": {
"operationId": "headItem",
"summary": "head item",
"responses": {
"2XX": {
"description": "Item head successfully"
},
"default": {
"description": "Error"
}
}
},
"patch": {
"operationId": "updateItem",
"summary": "Update item",
"responses": {
"default": {
"description": "Error"
}
}
}
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
swagger: "2.0"
info:
title: Simple API
version: 1.0.0
paths:
"/item":
head:
operationId: headItem
summary: head item
responses:
"2XX":
description: Item head successfully
default:
description: Error
patch:
operationId: updateItem
summary: Update item
responses:
default:
description: Error
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CxPolicy[result] {
not common_lib.valid_key(response, "201")
not common_lib.valid_key(response, "202")
not common_lib.valid_key(response, "204")
not common_lib.valid_key(response, "2XX")

result := {
"documentId": doc.id,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"swagger": "2.0",
"info": {
"title": "Simple API",
"version": "1.0.0"
},
"paths": {
"/item": {
"patch": {
"operationId": "patchItem",
"summary": "patch item",
"responses": {
"2XX": {
"description": "Item patchd successfully"
},
"default": {
"description": "Error"
}
}
}
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
swagger: "2.0"
info:
title: Simple API
version: 1.0.0
paths:
"/item":
patch:
operationId: patchItem
summary: patch item
responses:
"2XX":
description: Item patched successfully
default:
description: Error
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CxPolicy[result] {
not common_lib.valid_key(response, "201")
not common_lib.valid_key(response, "202")
not common_lib.valid_key(response, "204")
not common_lib.valid_key(response, "2XX")

result := {
"documentId": doc.id,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"swagger": "2.0",
"info": {
"title": "Simple API",
"version": "1.0.0"
},
"paths": {
"/item": {
"post": {
"operationId": "postItem",
"summary": "post item",
"responses": {
"2XX": {
"description": "Item posted successfully"
},
"default": {
"description": "Error"
}
}
},
"patch": {
"operationId": "updateItem",
"summary": "Update item",
"responses": {
"default": {
"description": "Error"
}
}
}
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
swagger: "2.0"
info:
title: Simple API
version: 1.0.0
paths:
"/item":
post:
operationId: postItem
summary: post item
responses:
"2XX":
description: Item post successfully
default:
description: Error
patch:
operationId: updateItem
summary: Update item
responses:
default:
description: Error
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CxPolicy[result] {
not common_lib.valid_key(response, "201")
not common_lib.valid_key(response, "202")
not common_lib.valid_key(response, "204")
not common_lib.valid_key(response, "2XX")

result := {
"documentId": doc.id,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"swagger": "2.0",
"info": {
"title": "Simple API",
"version": "1.0.0"
},
"paths": {
"/item": {
"put": {
"operationId": "updateItem",
"summary": "Update item",
"responses": {
"2XX": {
"description": "Item posted successfully"
},
"default": {
"description": "Error"
}
}
},
"patch": {
"operationId": "updateItem",
"summary": "Update item",
"responses": {
"default": {
"description": "Error"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
swagger: "2.0"
info:
title: Simple API
version: 1.0.0
paths:
"/item":
put:
operationId: updateItem
summary: Update item
responses:
"2XX":
description: Item post successfully
default:
description: Error
patch:
operationId: updateItem
summary: Update item
responses:
default:
description: Error

0 comments on commit c5a8011

Please sign in to comment.