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);
}
}
}
Aggregations