-
Notifications
You must be signed in to change notification settings - Fork 354
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
Using jsonpath in refResolver... #279
Comments
not as far as i know. i haven't seen anything related to filters while working with our JsonPointer implementation. up to |
Is this still an issue? |
For this schema I still get it if I try to resolve
|
Found the issue - my side, and I guess it might be for others. |
@cheeryfella since #277 the For reference the code I used for reproduction can be found below. I've tweaked the JSONPointer part of the schema to be valid. This however pins the index of the parameters which can cause issues when shifting parameter order. In an attempt to cleanup this repo we are trying to filter the issues and see which ones might be closed. Is it safe to assume this is a rather old issue, which sadly was left unanswered, and can be closed? Feel free to close it yourself with some comments if helpful. Schema: {
"paths": {
"/token": {},
"/token/{token}": {},
"{uuid}": {},
"/": {
"post": {
"parameters": [
{},
{
"name": "body",
"in": "body",
"schema": {}
},
{}
]
}
}
}
} Code: <?php
require_once '../../vendor/autoload.php';
$data = (object) [];
$validator = new JsonSchema\Validator;
$result = $validator->validate($data, (object)['$ref' => 'file://' . realpath('schema.json') . '#/paths/~1/post/parameters/1/schema']);
var_dump($result); |
I am attempting to validate a request body against jsonschema.
Schema is swagger 2.0 generated from stoplight...
salient json:
This is my attempt to load the schema
$schema = $refResolver->resolve('file://' . realpath(SPEC_ROOT . '/svc.json') . '#/paths/~1/post/parameters[?(@.name=="body")]/schema');
only response I get
JsonSchema\Exception\UnresolvableJsonPointerException: File: file:///code/specification/svc.json is found, but could not resolve fragment: #/paths/~1/post/parameters[?(@.name=="body")]/schema in /code/vendor/justinrainbow/json-schema/src/JsonSchema/RefResolver.php:108
Are jsonpath filters supported and if so what am I overlooking?
The text was updated successfully, but these errors were encountered: