Skip to content

HyperSchema does not generate links for nested objects #104

Closed
@alexpeelman

Description

@alexpeelman

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;
    }
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions