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

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

There is a newer version: 2.2.23
Show newest version
package io.swagger.v3.jaxrs2.ext;

import io.swagger.v3.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 final 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