package rd.configure;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Getter
@Component
@Configuration
public class OpenAPIConfigure {
    private String serverUrl;

    @Value("${wusthelper.docs.server-url:/}")
    public void setServerUrl(String serverUrl) {
        this.serverUrl = serverUrl;
    }

    @Bean
    public OpenAPI openAPI() {
        var info = new Info()
                .title("rd")
                .description("rd api")
                .version("v1");

        return new OpenAPI()
                .info(info);
    }
}
