You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
5.5.0 introduces an optional rule jsonpath optimizer: nimma. It seems to not properly parse some paths.
To Reproduce
ruleset:
rules:
read-scope-prefix-on-get:
type: validationseverity: warnrecommended: trueformats: ["oas3"]description: Scope should start with somethingmessage: Scope should start with somethinggiven: "$.paths.*[?(@property === 'get' || @property === 'options')].security.*.my_auth.*"then:
function: patternfunctionOptions:
match: "^urn:"no-404-response:
type: validationseverity: inforecommended: trueformats: ["oas3"]description: Operation must not define a 404 response when no ressource identifier.message: The request must not define a 404 response.given: "$.paths[?(!@property.includes('_id}'))][?(@property === 'get' || @property === 'post' || @property === 'delete' || @property === 'options' || @property === 'patch' )].responses"then:
field: "404"function: falsy
document:
openapi: 3.0.0paths:
/any/resources/{resource}:
get:
responses:
"200":
description: All is good"404":
description: All is nowhere"/resources:
get: &dummy-endpointresponses:
"200":
description: All is goodsecurity:
- my_auth:
- urn:somethingpatch:
<<: *dummy-endpointsecurity:
- my_auth:
- Urn:wrong-but-should-go-unnoticed
without nimma:
$ node -r ts-node/register -r tsconfig-paths/register src/cli/index.ts lint -r ./repro/nimma.ruleset.yaml ./repro/nimma.openapi.yaml
Missing baseUrl in compilerOptions. tsconfig-paths will be skipped
OpenAPI 3.x detected
c:/spectral/repro/nimma.openapi.yaml
9:15 information no-404-response The request must not define a 404 response.
✖ 1 problem (0 errors, 0 warnings, 1 info, 0 hints)
activating nimma:
$ node -r ts-node/register -r tsconfig-paths/register src/cli/index.ts lint -r ./repro/nimma.ruleset.yaml ./repro/nimma.openapi.yaml
Missing baseUrl in compilerOptions. tsconfig-paths will be skipped
OpenAPI 3.x detected
c:/_work/spectral/repro/nimma.openapi.yaml
23:15 warning read-scope-prefix-on-get Scope should start with something
✖ 1 problem (0 errors, 1 warning, 0 infos, 0 hints)
Expected behavior
Using nimma or not should not change the return results.
Environment (remove any that are not applicable):
Library version: develop branch
OS: Win10
Browser: N/A
The text was updated successfully, but these errors were encountered:
Awesome, thanks for adding the repro.
I'll try to cover these in nimma.
FWIW, I'm thinking of adding a kind of allowslist that prevent nimma from being used for paths we are not certain about.
I expected certain inconsistences, so we could potentially cover most of oas rules for now, as they are thourughly tested, while all custom rules would not be covered.
I haven't had much time lately to work on nimma, but hopefully I find some time after I return from Holidays (after 08th of July).
Describe the bug
5.5.0 introduces an optional rule jsonpath optimizer: nimma. It seems to not properly parse some paths.
To Reproduce
ruleset:
document:
without nimma:
$ node -r ts-node/register -r tsconfig-paths/register src/cli/index.ts lint -r ./repro/nimma.ruleset.yaml ./repro/nimma.openapi.yaml Missing baseUrl in compilerOptions. tsconfig-paths will be skipped OpenAPI 3.x detected c:/spectral/repro/nimma.openapi.yaml 9:15 information no-404-response The request must not define a 404 response. ✖ 1 problem (0 errors, 0 warnings, 1 info, 0 hints)
activating nimma:
$ node -r ts-node/register -r tsconfig-paths/register src/cli/index.ts lint -r ./repro/nimma.ruleset.yaml ./repro/nimma.openapi.yaml Missing baseUrl in compilerOptions. tsconfig-paths will be skipped OpenAPI 3.x detected c:/_work/spectral/repro/nimma.openapi.yaml 23:15 warning read-scope-prefix-on-get Scope should start with something ✖ 1 problem (0 errors, 1 warning, 0 infos, 0 hints)
Expected behavior
Using nimma or not should not change the return results.
Environment (remove any that are not applicable):
The text was updated successfully, but these errors were encountered: