Replies: 1 comment
-
@asatarov rules:
test:
given: $.definitions[*].properties[?(@property ~= "@")]
severity: error
then:
field: "@key"
function: falsy
Spectral uses nimma under the hood for a JSON Path engine. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I’m trying to create rule for model properties with ‘@’ symbols in name. I use
given: $.definitions.*.properties[?(@property.match(/@/))]~
but it doesn’t work. It works for some other regexps but not for all. For me it is not clear how it works. And may be ‘@’ symbol has some special meaning here.
Could someone give me some hints how to use it in a right way and is it possible to debug it somehow?
And I use https://extendsclass.com/jsonpath-tester.html for testing.
And may be there is a better tool for test json path ?
Example spec:
Beta Was this translation helpful? Give feedback.
All reactions