Skip to content

Commit

Permalink
Merge pull request #3 from jamilxt/issues/swagger-cors
Browse files Browse the repository at this point in the history
Fix Swagger CORS issue
  • Loading branch information
jamilxt authored Apr 26, 2023
2 parents 71bb831 + a0a18d0 commit 21b3760
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.swagger.v3.oas.models.OpenAPI;
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.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

Expand All @@ -12,7 +13,9 @@ public class SwaggerApiDocConfig {
public OpenAPI customOpenAPI() {
final Info info = new Info().title("Java Trainees 2023").version("1.0.0")
.license(new License().name("© Brain Station 23 Ltd.").url("https://brainstation-23.com"));
final OpenAPI openAPI = new OpenAPI().info(info);
final OpenAPI openAPI = new OpenAPI()
.addServersItem(new Server().url("/"))
.info(info);
return openAPI;
}
}

0 comments on commit 21b3760

Please sign in to comment.