File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed
tools/spectral/ipa/rulesets Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 4141 - Validation applies to List methods for resource collections only
4242 - Validation applies to json response content only
4343 - Validation ignores responses without schema and non-paginated responses
44+ - A response is considered paginated if it contains an array property named `results`
4445 - Validation ignores resources without a Get method
4546 - Paths with `x-xgen-IPA-exception` for this rule are excluded from validation
4647 message : ' {{error}} http://go/ipa-spectral#IPA-105'
Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ Validation checks that the List method response contains items property with ref
117117 - Validation applies to List methods for resource collections only
118118 - Validation applies to json response content only
119119 - Validation ignores responses without schema and non-paginated responses
120+ - A response is considered paginated if it contains an array property named ` results `
120121 - Validation ignores resources without a Get method
121122 - Paths with ` x-xgen-IPA-exception ` for this rule are excluded from validation
122123
Original file line number Diff line number Diff line change 55 */
66export function schemaIsPaginated ( schema ) {
77 const fields = Object . keys ( schema ) ;
8- return fields . includes ( 'properties' ) && Object . keys ( schema [ 'properties' ] ) . includes ( 'results' ) ;
8+ return (
9+ fields . includes ( 'properties' ) &&
10+ Object . keys ( schema [ 'properties' ] ) . includes ( 'results' ) &&
11+ schema . properties . results . type === 'array'
12+ ) ;
913}
1014
1115/**
You can’t perform that action at this time.
0 commit comments