Skip to content

How to validate data with only part of my schema #288

Closed
@panSarin

Description

Hello.

I have complex json-schema files. With definitions and links. In link i use targetSchema
like

    "targetSchema": {
        "type": "object",
        "$ref": "/schemata/my_resource#/definitions/my_resource_create_response"
      }

So in my tests i want to use

    schema = JSON.parse(File.read(my_json_path))['definitions'][schema_def_name] # schema_def_name => my_resource_create_response
    JSON::Validator.validate!(schema, response.body, parse_data: false)

But whatever i try to do it it always expects me to give him url as a schema. Can i pass some JSON schema definition as a schema to compare with my response body ?

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