-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6f84d5
commit 6646b1e
Showing
3 changed files
with
25 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,20 +14,19 @@ rules: | |
# match: "object" | ||
|
||
##### Root Element ##### | ||
# https://atlassian.spscommerce.com/browse/DPE-286 | ||
# sps-collection-missing-results-array: | ||
# description: "Response bodies must have a root element called results and is an array of objects." | ||
# severity: error | ||
# given: $.paths[?([email protected](/.*\/\{[^}]+\}$/))].get.responses['200'].content.application/json.schema.properties.results | ||
# then: | ||
# - field: type | ||
# function: pattern | ||
# functionOptions: | ||
# match: "array" | ||
# - field: items.type | ||
# function: pattern | ||
# functionOptions: | ||
# match: "object" | ||
sps-collection-missing-results-array: | ||
description: "Response bodies must have a root element called results and is an array of objects." | ||
severity: error | ||
given: $.paths[?([email protected](/.*\/\{[^}]+\}$/))].get.responses['200'].content.application/json.schema.properties.results | ||
then: | ||
- field: type | ||
function: pattern | ||
functionOptions: | ||
match: "array" | ||
- field: items.type | ||
function: pattern | ||
functionOptions: | ||
match: "object" | ||
|
||
##### Pagination ##### | ||
sps-missing-pagination-query-parameters: | ||
|
@@ -66,16 +65,15 @@ rules: | |
in: | ||
const: query | ||
|
||
# sps-post-request-body-missing-paging-object: | ||
# See https://atlassian.spscommerce.com/browse/DPE-286 | ||
# description: "POST collection endpoints MUST have a request body schema that includes paging parameters." | ||
# severity: error | ||
# given: $.paths[?([email protected](/.*\/\{[^}]+\}$/))].post.requestBody.content.application/json.schema.properties.paging | ||
# then: | ||
# field: "type" | ||
# function: pattern | ||
# functionOptions: | ||
# match: "object" | ||
sps-post-request-body-missing-paging-object: | ||
description: "POST collection endpoints MUST have a request body schema that includes paging parameters." | ||
severity: error | ||
given: $.paths[?([email protected](/.*\/\{[^}]+\}$/))].post.requestBody.content.application/json.schema.properties.paging | ||
then: | ||
field: "type" | ||
function: pattern | ||
functionOptions: | ||
match: "object" | ||
|
||
##### FILTERING ##### | ||
sps-disallow-resource-identifier-filtering: | ||
|
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
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