Skip to content

Commit

Permalink
use concrete path for given json path to speed up
Browse files Browse the repository at this point in the history
  • Loading branch information
coliu19 committed Dec 1, 2022
1 parent f888767 commit 6012f91
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions completeness.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ export default {
'message': '{{description}}; {{error}}',
'severity': 'error',
'given': [
'$..headers..[?(@ && @.schema)].schema',
'$..parameters..[?(@ && @.schema)].schema',
'$..content..[?(@ && @.schema)].schema',
'$..responses..[?(@ && @.schema)].schema',
'$.paths.*.*.*.*.content[?(@ && @.schema)].schema',
'$.paths.*.*.*.content[?(@ && @.schema)].schema',
'$.paths.*.*.responses[*].headers[?(@ && @.schema)].schema',
'$.paths.*.*.parameters[?(@ && @.schema)].schema',
'$.paths.*.*.responses[?(@ && @.schema)].schema',
"$.paths.*.*.parameters[?(@ && @.schema && @.in === 'body')].schema",
],
'then': [
{
Expand Down Expand Up @@ -203,12 +205,12 @@ export default {
'message': '{{description}}; {{error}}',
'severity': 'warn',
'given': [
'$.paths.*.*.*.*.content[?(@.schema)]',
'$.paths.*.*.*.content[?(@.schema)]',
'$.paths.*.*.responses[*].headers[?(@.schema)]',
'$.paths.*.*.parameters[?(@.schema)]',
'$.paths.*.*.responses[?(@.schema)]',
"$.paths.*.*.parameters[?(@.schema && @.in === 'body')]",
'$.paths.*.*.*.*.content[?(@ && @.schema)]',
'$.paths.*.*.*.content[?(@ && @.schema)]',
'$.paths.*.*.responses[*].headers[?(@ && @.schema)]',
'$.paths.*.*.parameters[?(@ && @.schema)]',
'$.paths.*.*.responses[?(@ && @.schema)]',
"$.paths.*.*.parameters[?(@ && @.schema && @.in === 'body')]",
],
'then': {
'function': ensureExamples,
Expand Down

0 comments on commit 6012f91

Please sign in to comment.