Package com.dottydingo.hyperion.module.swagger.jackson

Source Code of com.dottydingo.hyperion.module.swagger.jackson.FilteringObjectVisitor

package com.dottydingo.hyperion.module.swagger.jackson;

import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable;
import com.fasterxml.jackson.module.jsonSchema.JsonSchema;
import com.fasterxml.jackson.module.jsonSchema.factories.ObjectVisitor;
import com.fasterxml.jackson.module.jsonSchema.types.AnySchema;
import com.fasterxml.jackson.module.jsonSchema.types.ObjectSchema;

import java.util.Map;

/**
*/
public class FilteringObjectVisitor extends ObjectVisitor
{

    public FilteringObjectVisitor(SerializerProvider provider, ObjectSchema schema)
    {
        super(provider, schema);
    }

    @Override
    protected JsonSchema propertySchema(BeanProperty writer) throws JsonMappingException
    {
        if(writer.getAnnotation(com.dottydingo.hyperion.module.swagger.AnySchema.class) != null)
            return new AnySchema();

        return super.propertySchema(writer);
    }

}
TOP

Related Classes of com.dottydingo.hyperion.module.swagger.jackson.FilteringObjectVisitor

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.