-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from WSE-research/fixSwaggerUI
Fix swagger UI
- Loading branch information
Showing
4 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/com/wse/qanaryexplanationservice/QanaryExplanationServiceApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,42 @@ | ||
package com.wse.qanaryexplanationservice; | ||
|
||
import io.swagger.v3.oas.models.OpenAPI; | ||
import io.swagger.v3.oas.models.info.Info; | ||
import io.swagger.v3.oas.models.info.License; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.core.env.Environment; | ||
|
||
@SpringBootApplication | ||
public class QanaryExplanationServiceApplication { | ||
|
||
private Environment env; | ||
|
||
public QanaryExplanationServiceApplication(@Autowired Environment env) { | ||
this.env = env; | ||
} | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(QanaryExplanationServiceApplication.class, args); | ||
} | ||
|
||
|
||
|
||
@Bean | ||
public OpenAPI customOpenAPI( | ||
@Value("${springdoc.version}") String appVersion, // | ||
@Value("${spring.application.name}") String appName // | ||
) { | ||
return new OpenAPI().info(new Info() | ||
.title(appName) // | ||
.version(appVersion) // | ||
.description( | ||
"OpenAPI 3 with Spring Boot provided this API documentation.") | ||
.termsOfService("http://swagger.io/terms/") // | ||
.license(new License().name("Apache 2.0").url("http://springdoc.org")) // | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
spring.application.name=Qanary explanation service | ||
server.port=4000 | ||
sparqlEndpoint=http://demos.swe.htwk-leipzig.de:40111/sparql | ||
# swagger-ui custom path | ||
springdoc.swagger-ui.path=/swagger-ui.html | ||
# api-docs custom path | ||
springdoc.api-docs.path=/api-docs | ||
springdoc.version=2.1.0 |