Skip to content
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

HyperSchema does not generate links for nested objects #104

Closed
alexpeelman opened this issue May 10, 2016 · 2 comments
Closed

HyperSchema does not generate links for nested objects #104

alexpeelman opened this issue May 10, 2016 · 2 comments
Milestone

Comments

@alexpeelman
Copy link

Hi, I was expecting that nested objects would be handled as well and that the links property would be added to the schema. I found that somewhere in the recursion path the normal SchemaFactory was used instead of the HyperSchemaFactory.

After digging in the code I pinpointed that HyperSchemaFactoryWrapperFactory only overrides

public SchemaFactoryWrapper getWrapper(SerializerProvider p)  

and should also override

public SchemaFactoryWrapper getWrapper(SerializerProvider  rovider, VisitorContext rvc) 

I guess the following should work

private static class HyperSchemaFactoryWrapperFactory extends WrapperFactory
{
    @Override
    public SchemaFactoryWrapper getWrapper(SerializerProvider p) {
        SchemaFactoryWrapper wrapper = new HyperSchemaFactoryWrapper();
        wrapper.setProvider(p);
        return wrapper;
    };

    @Override
    public SchemaFactoryWrapper getWrapper(SerializerProvider provider, VisitorContext rvc)
    {
        SchemaFactoryWrapper wrapper = new HyperSchemaFactoryWrapper();
        wrapper.setProvider(provider);
        wrapper.setVisitorContext(rvc);
        return wrapper;
    }
};
@cowtowncoder cowtowncoder added this to the 2.7.5 milestone May 10, 2016
@cowtowncoder
Copy link
Member

@alexpeelman Thanks! I agree, fixed as suggested.

@alexpeelman
Copy link
Author

Cool, that was quick ;)

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

No branches or pull requests

2 participants