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

JavaSpring.openapiDocumentationConfig.mustache Maven / Gradle / Ivy

package {{configPackage}};

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import org.springframework.web.util.UriComponentsBuilder;
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;

{{#useOptional}}
import java.util.Optional;
{{/useOptional}}
import javax.servlet.ServletContext;

{{>generatedAnnotation}}
@Configuration
public class OpenAPIDocumentationConfig {

@Bean
public OpenAPI customOpenAPI() {
        return new OpenAPI()
            .components(new Components())
            .info(new Info()
                .title("{{appName}}")
                .description("{{{appDescription}}}")
                .license(new License()
                    .name("{{licenseInfo}}")
                    .url("{{licenseUrl}}"))
                .termsOfService("{{infoUrl}}")
                .version("{{appVersion}}")
                .contact(new Contact()
                    .email("{{infoEmail}}")));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy