Search in sources :

Example 6 with ServerImpl

use of io.smallrye.openapi.api.models.servers.ServerImpl in project smallrye-open-api by smallrye.

the class ConfigUtil method configureServers.

/**
 * Configures the servers for an Operation.
 *
 * @param config OpenApiConfig
 * @param operation Operation
 */
protected static void configureServers(OpenApiConfig config, Operation operation) {
    if (operation == null) {
        return;
    }
    if (operation.getOperationId() == null) {
        return;
    }
    Set<String> operationServers = config.operationServers(operation.getOperationId());
    if (operationServers != null && !operationServers.isEmpty()) {
        operation.servers(new ArrayList<>());
        for (String operationServer : operationServers) {
            Server server = new ServerImpl();
            server.setUrl(operationServer);
            operation.addServer(server);
        }
    }
}
Also used : Server(org.eclipse.microprofile.openapi.models.servers.Server) ServerImpl(io.smallrye.openapi.api.models.servers.ServerImpl)

Aggregations

ServerImpl (io.smallrye.openapi.api.models.servers.ServerImpl)6 Server (org.eclipse.microprofile.openapi.models.servers.Server)6 NotesContext (com.ibm.domino.xsp.module.nsf.NotesContext)1 OpenApiConfig (io.smallrye.openapi.api.OpenApiConfig)1 OpenApiProcessor (io.smallrye.openapi.runtime.OpenApiProcessor)1 URI (java.net.URI)1 HashSet (java.util.HashSet)1 Database (lotus.domino.Database)1 Config (org.eclipse.microprofile.config.Config)1 OpenAPI (org.eclipse.microprofile.openapi.models.OpenAPI)1 PathItem (org.eclipse.microprofile.openapi.models.PathItem)1 Info (org.eclipse.microprofile.openapi.models.info.Info)1 Index (org.jboss.jandex.Index)1 DelegatingClassLoader (org.openntf.xsp.jakartaee.DelegatingClassLoader)1