Add API Documentation Service and enhance existing services with OpenAPI support
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package com.labfusion.config;
|
||||
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
import io.swagger.v3.oas.models.info.Contact;
|
||||
import io.swagger.v3.oas.models.info.License;
|
||||
import io.swagger.v3.oas.models.servers.Server;
|
||||
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import io.swagger.v3.oas.models.Components;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
public class OpenApiConfig {
|
||||
|
||||
@Bean
|
||||
public OpenAPI customOpenAPI() {
|
||||
return new OpenAPI()
|
||||
.info(new Info()
|
||||
.title("LabFusion API Gateway")
|
||||
.description("Core API gateway for LabFusion homelab dashboard. Provides authentication, dashboard management, and data storage.")
|
||||
.version("1.0.0")
|
||||
.contact(new Contact()
|
||||
.name("LabFusion Team")
|
||||
.url("https://github.com/labfusion/labfusion")
|
||||
.email("team@labfusion.dev"))
|
||||
.license(new License()
|
||||
.name("MIT License")
|
||||
.url("https://opensource.org/licenses/MIT")))
|
||||
.servers(List.of(
|
||||
new Server()
|
||||
.url("http://localhost:8080")
|
||||
.description("Development Server"),
|
||||
new Server()
|
||||
.url("https://api.labfusion.dev")
|
||||
.description("Production Server")
|
||||
))
|
||||
.addSecurityItem(new SecurityRequirement().addList("bearerAuth"))
|
||||
.components(new Components()
|
||||
.addSecuritySchemes("bearerAuth", new SecurityScheme()
|
||||
.type(SecurityScheme.Type.HTTP)
|
||||
.scheme("bearer")
|
||||
.bearerFormat("JWT")
|
||||
.description("JWT token authentication")));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user