Skip to content
New issue

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

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

Already on GitHub? # to your account

Handling local references on jsonschema2pojo.org #183

Closed
okrosa opened this issue May 16, 2014 · 3 comments
Closed

Handling local references on jsonschema2pojo.org #183

okrosa opened this issue May 16, 2014 · 3 comments
Milestone

Comments

@okrosa
Copy link

okrosa commented May 16, 2014

The following schema fails with an URI is not absolute error (based on my java validator, the reference should be good like this):

{
    "type": "object",
    "definitions": 
    {
        "location": 
        {
            "type": "object",
            "properties": 
            {
                "lat": 
                {
                    "type": "number"
                },

                "lon": 
                {
                    "type": "number"
                }
            }
        }
    },

    "properties": 
    {
        "location": 
        {
            "$ref": "#/definitions/location"
        }
    }
}
@joelittlejohn joelittlejohn added this to the 0.4.3 milestone May 19, 2014
@joelittlejohn
Copy link
Owner

Thanks for reporting this. If you use this tool as a Maven plugin, Gradle plugin, Ant task, etc then local references will work. The online version (jsonschema2pojo.org) doesn't create a parent file to resolve local references against, so local refs don't work there. This isn't intentional, just a quirk of the way the web tool works.

We should be able to make a tweak to the way refs are resolved and fix this.

@joelittlejohn joelittlejohn changed the title Handling local references Handling local references on jsonschema2pojo.org May 22, 2014
@joelittlejohn
Copy link
Owner

Reopening until jsonschema2pojo.org is updated.

@joelittlejohn
Copy link
Owner

Fixed by updating jsonschema2pojo-core past 0.4.3 for jsonschema2pojo.org.

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

No branches or pull requests

2 participants