Skip to content

Commit

Permalink
perf: improve paths lookup (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
P0lip authored and Phil Sturgeon committed Jul 31, 2019
1 parent 87411e1 commit 6c11f16
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/rulesets/oas/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Operation must have at least one `2xx` response.",
"recommended": true,
"type": "style",
"given": "$..paths.*[?( @property === 'get' || @property === 'put' || @property === 'post' || @property === 'delete' || @property === 'options' || @property === 'head' || @property === 'patch' || @property === 'trace' )]",
"given": "$.paths.*[?( @property === 'get' || @property === 'put' || @property === 'post' || @property === 'delete' || @property === 'options' || @property === 'head' || @property === 'patch' || @property === 'trace' )]",
"then": {
"field": "responses",
"function": "oasOp2xxResponse"
Expand All @@ -17,7 +17,7 @@
"description": "Operations with an `in: formData` parameter must include `application/x-www-form-urlencoded` or `multipart/form-data` in their `consumes` property.",
"recommended": true,
"type": "validation",
"given": "$..paths.*[?( @property === 'get' || @property === 'put' || @property === 'post' || @property === 'delete' || @property === 'options' || @property === 'head' || @property === 'patch' || @property === 'trace' )]",
"given": "$.paths.*[?( @property === 'get' || @property === 'put' || @property === 'post' || @property === 'delete' || @property === 'options' || @property === 'head' || @property === 'patch' || @property === 'trace' )]",
"then": {
"function": "oasOpFormDataConsumeCheck"
},
Expand Down Expand Up @@ -246,7 +246,7 @@
"description": "Operations must have a default response.",
"recommended": false,
"type": "style",
"given": "$..paths.*.*.responses",
"given": "$.paths.*.*.responses",
"then": {
"field": "default",
"function": "truthy"
Expand All @@ -259,7 +259,7 @@
"description": "Operation `description` must be present and non-empty string.",
"recommended": true,
"type": "style",
"given": "$..paths.*[?( @property === 'get' || @property === 'put' || @property === 'post' || @property === 'delete' || @property === 'options' || @property === 'head' || @property === 'patch' || @property === 'trace' )]",
"given": "$.paths.*[?( @property === 'get' || @property === 'put' || @property === 'post' || @property === 'delete' || @property === 'options' || @property === 'head' || @property === 'patch' || @property === 'trace' )]",
"then": {
"field": "description",
"function": "truthy"
Expand All @@ -272,7 +272,7 @@
"description": "Operation should have an `operationId`.",
"recommended": true,
"type": "style",
"given": "$..paths.*[?( @property === 'get' || @property === 'put' || @property === 'post' || @property === 'delete' || @property === 'options' || @property === 'head' || @property === 'patch' || @property === 'trace' )]",
"given": "$.paths.*[?( @property === 'get' || @property === 'put' || @property === 'post' || @property === 'delete' || @property === 'options' || @property === 'head' || @property === 'patch' || @property === 'trace' )]",
"then": {
"field": "operationId",
"function": "truthy"
Expand All @@ -285,7 +285,7 @@
"description": "operationId may only use characters that are valid when used in a URL.",
"recommended": true,
"type": "validation",
"given": "$..paths.*[?( @property === 'get' || @property === 'put' || @property === 'post' || @property === 'delete' || @property === 'options' || @property === 'head' || @property === 'patch' || @property === 'trace' )]",
"given": "$.paths.*[?( @property === 'get' || @property === 'put' || @property === 'post' || @property === 'delete' || @property === 'options' || @property === 'head' || @property === 'patch' || @property === 'trace' )]",
"then": {
"field": "operationId",
"function": "pattern",
Expand All @@ -301,7 +301,7 @@
"description": "Operation may only have one tag.",
"recommended": false,
"type": "style",
"given": "$..paths.*[?( @property === 'get' || @property === 'put' || @property === 'post' || @property === 'delete' || @property === 'options' || @property === 'head' || @property === 'patch' || @property === 'trace' )]",
"given": "$.paths.*[?( @property === 'get' || @property === 'put' || @property === 'post' || @property === 'delete' || @property === 'options' || @property === 'head' || @property === 'patch' || @property === 'trace' )]",
"then": {
"field": "tags",
"function": "length",
Expand All @@ -317,7 +317,7 @@
"description": "Operation `summary` should start with upper case and end with a dot.",
"recommended": false,
"type": "style",
"given": "$..paths.*[?( @property === 'get' || @property === 'put' || @property === 'post' || @property === 'delete' || @property === 'options' || @property === 'head' || @property === 'patch' || @property === 'trace' )]",
"given": "$.paths.*[?( @property === 'get' || @property === 'put' || @property === 'post' || @property === 'delete' || @property === 'options' || @property === 'head' || @property === 'patch' || @property === 'trace' )]",
"then": {
"field": "summary",
"function": "pattern",
Expand All @@ -333,7 +333,7 @@
"description": "Operation should have non-empty `tags` array.",
"recommended": true,
"type": "style",
"given": "$..paths.*[?( @property === 'get' || @property === 'put' || @property === 'post' || @property === 'delete' || @property === 'options' || @property === 'head' || @property === 'patch' || @property === 'trace' )]",
"given": "$.paths.*[?( @property === 'get' || @property === 'put' || @property === 'post' || @property === 'delete' || @property === 'options' || @property === 'head' || @property === 'patch' || @property === 'trace' )]",
"then": {
"field": "tags",
"function": "truthy"
Expand Down Expand Up @@ -363,7 +363,7 @@
"description": "given declarations cannot be empty, ex.`/given/{}` is invalid.",
"recommended": true,
"type": "style",
"given": "$..paths",
"given": "$.paths",
"then": {
"field": "@key",
"function": "pattern",
Expand All @@ -379,7 +379,7 @@
"description": "given keys should not end with a slash.",
"recommended": true,
"type": "style",
"given": "$..paths",
"given": "$.paths",
"then": {
"field": "@key",
"function": "pattern",
Expand All @@ -395,7 +395,7 @@
"description": "given keys should not include a query string.",
"recommended": true,
"type": "style",
"given": "$..paths",
"given": "$.paths",
"then": {
"field": "@key",
"function": "pattern",
Expand Down

0 comments on commit 6c11f16

Please sign in to comment.