Skip to content

Support JSON schema with references? #10

Description

@SvenRtbg

I've looked at this library and would say that it is the most sophisticated of the ones I found. But it still has some features missing. One of them is the (for me) unexpected limitation to YAML format, combined with the inability to resolve references ($ref) in a JSON-formatted schema.

You are using justinrainbow/jsonschema already. I tried to make it work for schema loading and monkey-patched something that works for me. Are you interested in integrating this change upstream? I would prepare a PR then. It looks like a relatively small change: The SchemaLoader has to be changed to accept JSON, and SchemaToClass has to recursively resolve references once they are encontered.

I don't know if this change will allow to keep YAML support, as the schema reading uses the justinrainbow library now, which is expecting JSON.

Let me know what you think!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions