All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.swagger.jaxrs2.ext.OpenAPIExtensions Maven / Gradle / Ivy

The newest version!
package io.swagger.jaxrs2.ext;

import io.swagger.jaxrs2.DefaultParameterExtension;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.ServiceLoader;

public class OpenAPIExtensions {
    private static Logger LOGGER = LoggerFactory.getLogger(OpenAPIExtensions.class);

    private static List extensions = null;

    public static List getExtensions() {
        return extensions;
    }

    public static void setExtensions(List ext) {
        extensions = ext;
    }

    public static Iterator chain() {
        return extensions.iterator();
    }

    static {
        extensions = new ArrayList<>();
        ServiceLoader loader = ServiceLoader.load(OpenAPIExtension.class);
        for (OpenAPIExtension ext : loader) {
            LOGGER.debug("adding extension " + ext);
            extensions.add(ext);
        }
        extensions.add(new DefaultParameterExtension());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy