Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: improve paths lookup #413

Merged
merged 1 commit into from
Jul 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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