diff --git a/noti-service/build.gradle b/noti-service/build.gradle index 6ec52452..15cb6425 100644 --- a/noti-service/build.gradle +++ b/noti-service/build.gradle @@ -2,6 +2,7 @@ plugins { id 'java' id 'org.springframework.boot' version '3.2.3' id 'io.spring.dependency-management' version '1.1.4' + id "org.springdoc.openapi-gradle-plugin" version '1.8.0' } group = 'com.waither' @@ -48,14 +49,26 @@ dependencies { //Redis implementation 'org.springframework.boot:spring-boot-starter-data-redis' - //Swagger + //Springdoc implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.1.0' + //implementation 'org.springdoc:springdoc-openapi-gradle-plugin:1.8.0' //JUnit + AssertJ testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2' testImplementation 'org.assertj:assertj-core:3.23.1' } +openApi { + apiDocsUrl.set("http://localhost:80") // Document URL + outputDir.set(file("$rootDir/build/docs")) // Build Result Path + outputFileName.set("noti.json") // Build Result File Name + groupedApiMappings.set(Map.of("http://localhost:8082/noti/api-docs", "noti.json")) + waitTimeInSeconds.set(60) // Timeout + customBootRun { + args.add("--spring.profiles.active=dev") + } +} + dependencyManagement { imports { mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" diff --git a/noti-service/src/main/resources/bootstrap.yml b/noti-service/src/main/resources/bootstrap.yml index a2f1e679..8b8a5d64 100644 --- a/noti-service/src/main/resources/bootstrap.yml +++ b/noti-service/src/main/resources/bootstrap.yml @@ -9,7 +9,7 @@ spring: cloud: config: uri: http://localhost:8888 - name: database-noti,redis + name: database-noti,redis,apiDocs-noti kafka: bootstrap-servers: "localhost:9092" @@ -19,4 +19,4 @@ eureka: register-with-eureka: true # register to eureka server fetch-registry: true # Getting instances' information from eureka server service-url: - defaultZone : http://127.0.0.1:8761/eureka #Eureka Server's address \ No newline at end of file + defaultZone : http://127.0.0.1:8761/eureka #Eureka Server's address