use of org.wildfly.swarm.microprofile.openapi.api.models.servers.ServerImpl in project wildfly-swarm by wildfly-swarm.
the class ServersUtil method configureServers.
/**
* Configures the servers for a PathItem.
* @param config
* @param pathName
* @param pathItem
*/
protected static void configureServers(OpenApiConfig config, String pathName, PathItem pathItem) {
if (pathItem == null) {
return;
}
Set<String> pathServers = config.pathServers(pathName);
if (pathServers != null && !pathServers.isEmpty()) {
pathItem.servers(new ArrayList<>());
for (String pathServer : pathServers) {
Server server = new ServerImpl();
server.setUrl(pathServer);
pathItem.addServer(server);
}
}
configureServers(config, pathItem.getGET());
configureServers(config, pathItem.getPUT());
configureServers(config, pathItem.getPOST());
configureServers(config, pathItem.getDELETE());
configureServers(config, pathItem.getHEAD());
configureServers(config, pathItem.getOPTIONS());
configureServers(config, pathItem.getPATCH());
configureServers(config, pathItem.getTRACE());
}
Aggregations