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

io.openapitools.swagger.config.SwaggerComponents Maven / Gradle / Ivy

The newest version!
package io.openapitools.swagger.config;

import java.util.Map;

import org.apache.maven.plugins.annotations.Parameter;

import io.swagger.v3.oas.models.Components;

public class SwaggerComponents {

    /**
     * Security schemes (under Comtonents)
     */
    @Parameter
    private Map securitySchemes;

    // TODO: implement schemas, responses, ... from
    // https://github.com/OAI/OpenAPI-Specification/blob/3.0.1/versions/3.0.1.md#componentsObject

    public Components createComponentsModel() {
        Components components = new Components();

        if (securitySchemes != null && !securitySchemes.isEmpty()) {
            securitySchemes.entrySet().forEach(s -> components.addSecuritySchemes(s.getKey(), s.getValue().createSecuritySchemaModel()));
        }

        return components;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy