Skip to content

Using jsonpath in refResolver... #279

Closed
@cheeryfella

Description

@cheeryfella

I am attempting to validate a request body against jsonschema.

Schema is swagger 2.0 generated from stoplight...

salient json:

{
  "paths": {
    "/token": {...},
    "/token/{token}": {...},
    "{uuid}": {...}
    "/": {
      "post": {
        "parameters": [
          {...},
          {
            "name": "body",
            "in": "body",
            "schema":
            ....
          },
          {...}
        ]
      }
    } 
  }

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions