package com.yaoyuan.jiscuss.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * SpringDoc OpenAPI 2.x configuration.
 *
 * <p>Replaces discontinued springfox-swagger2 (incompatible with Spring Boot 3).
 * UI is available at /swagger-ui/index.html
 */
@Configuration
public class SwaggerConfiguration {

    @Bean
    public OpenAPI jiscussOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("Jiscuss REST APIs")
                        .description("Jiscuss forum system API documentation")
                        .version("1.0")
                        .contact(new Contact()
                                .name("Jiscuss Team")
                                .email("developer@mail.com")));
    }
}
