Skip to content

Unable to reference a json schema from an external file. #836

@Agent-Hellboy

Description

@Agent-Hellboy

├── init.py
├── common
│   └── common_schema.json
├── main1_schema.json
├── main2_schema.json

I am not able to reference common_schema from main1_schema and main2_schema.

I tried with file:common_schema.json#/common_data but it is not working
I am getting the following error
jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '/snr_info_def_schema.json'>

when I tried with file://common_schema.json#/common_data
I am getting the following error
jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: ''>

is it because I am working inside a package?--->As I have to use pkg_resources to load the schema

This is a small package for schema validation having an internal API to load JSON schema files and a public API which will take JSON data and validate it with the loaded JSON schema.

Is it possible to use "$ref" inside a package having static files inside it(In this case JSON files)?
can I get some insights on how ref is implemented?

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