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
Given an OAS document with paths defined that contain placeholders in this shape: ('{localId}').
We define a rule that evaluates response objects defined in such paths.
The result of the messages in case if some response object do not adhere to the define rule does not contain the correct path to the response object. Instead, only the paths property is shown in the path of the message.
Expected behavior
Expected the message to contain the correct path to the object where the violation of the rule happened.
However, the message only contains path: ["paths"] instead the full path to the object.
Environment (remove any that are not applicable):
Library version: 6.6.0
The text was updated successfully, but these errors were encountered:
Note: the JSONPath itself seems to be working and the check works, it's only that Spectral returns the wrong path in the response, also wrong line number.
I can confirm it's a bug.
Long story short - it's lodash.topath converting $['paths']['/Dogs('{localId}')']['get']['responses'][200]['content']['application/json']['schema'] into
['$','paths',"'/Dogs('{localId}')'",// note the extra single quotes here'get','responses','200','content','application/json','schema']
However, to be fair it's worth pointing out that the path provided by jsonpath-plus tho isn't escaped quite correctly since the actual input should like something as follows $['paths']['/Dogs(\'{localId}\')']['get']['responses'][200]['content']`.
Describe the bug
Given an OAS document with paths defined that contain placeholders in this shape:
('{localId}')
.We define a rule that evaluates response objects defined in such paths.
The result of the messages in case if some response object do not adhere to the define rule does not contain the correct path to the response object. Instead, only the
paths
property is shown in the path of the message.To Reproduce
Example to run:
https://github.com/ductaily/spectral-odata-placeholder
Rule:
Expected behavior
Expected the message to contain the correct path to the object where the violation of the rule happened.
However, the message only contains
path: ["paths"]
instead the full path to the object.Environment (remove any that are not applicable):
The text was updated successfully, but these errors were encountered: