Skip to content

Resolving inner definitions on $ref's #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

stoiev
Copy link

@stoiev stoiev commented Sep 12, 2014

Trying to resolve issue #93

@justinrainbow
Copy link
Collaborator

Thanks for the PR @stoiev. Could you add a unit test showing #93 was fixed?

@stoiev
Copy link
Author

stoiev commented Oct 20, 2014

Hi!
I didn't found a proper location to put this test. It's something between RefResolverTest and Draft4Test (it's a validation test using RefResolver), so I've put on an standalone test on Draft4Test.php for now.
I don't think that it is a proper way to deal with the problem, this commit resolves the problem partially:

{
    "type": "object",
    "additionalProperties":false,
    "properties": {
        "person": { "$ref": "#/definitions/persondef" },  #  this one works 
        "personname": { "$ref": "#/definitions/persondef/name" }  # this one not
    },
    "definitions": {
        "persondef": {
            "type": "object",
            "additionalProperties":false,
            "properties": {
                "name": {
                    "type": "string"
                },
                "age": {
                    "type" : "integer"
                }
            }
        }
    }
}

since it's implemented only on RefResolver (and RefResolver depends on UriResolver to resolver more complex JSON paths). But it resolved my case, and probably the majority of cases using local definitions.

@sraka1
Copy link

sraka1 commented Nov 23, 2014

Please merge this into master! :)

@bighappyface
Copy link
Collaborator

Closing in favor of #182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants