com.brihaspathee.zeus.config.OperAPIConfig Maven / Gradle / Ivy
package com.brihaspathee.zeus.config;
import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.servers.Server;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import java.util.ArrayList;
import java.util.List;
/**
* Created in Intellij IDEA
* User: Balaji Varadharajan
* Date: 06, March 2022
* Time: 8:19 AM
* Project: Zeus
* Package Name: com.brihaspathee.zeus.config
* To change this template use File | Settings | File and Code Template
*/
@Configuration
@Profile({"local", "clean"})
public class OperAPIConfig {
@Bean
public OpenAPI customOpenAPI(@Value("${zeus-file-storage.api.version}") String apiVersion){
List servers = new ArrayList<>();
servers.add(new Server()
.url("http://localhost:8083")
.description("Development Server"));
return new OpenAPI()
.components(new Components())
.info(new Info()
.title("Zeus File Storage Service API")
.version(apiVersion)
.contact(new Contact()
.name("Balaji Varadharajan")
.url("http://www.zeus.com")
.email("[email protected]"))
.license(new License()
.name("Apache 2.0")
.url("https://www.apache.org/licenses/License-2.0.html"))
)
.servers(servers);
}
}