Skip to content

Is the RefResolver intentionally not being used? #8

@graste

Description

@graste

Thanks for this library. I'm using it and now that I'm trying to use references in schemas I'm asking myself whether you not resolve references on purpose? See this gist for an example. Without doing the reference resolution the schema contains

    "properties": {
        "billing_address": {
            "$ref": "#/definitions/address"
        },
        "shipping_address": {
            "$ref": "#/definitions/address"
        }
    },

instead of

"properties": {
        "billing_address": {
            "type": "object",
            "properties": {
                "street_address": {
                    "type": "string"
                },
                "city": {
                    "type": "string"
                },
                "state": {
                    "type": "string"
                }
            },
            "required": [
                "street_address",
                "city",
                "state"
            ],
            "id": "file:///srv/www/json-schema/schema-address.json#/definitions/address"
        },
        "shipping_address": {
            "type": "object",
            "properties": {
                "street_address": {
                    "type": "string"
                },
                "city": {
                    "type": "string"
                },
                "state": {
                    "type": "string"
                }
            },
            "required": [
                "street_address",
                "city",
                "state"
            ],
            "id": "file:///srv/www/json-schema/schema-address.json#/definitions/address"
        }
    }

Apart from the underlying library not supporting all cases of definitions and $ref usage I just wanted to make sure whether you're deviating intentionally from the README example of justinrainbow/json-schema.

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