Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<!-- Spring Swagger -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.3.0</version>
</dependency>

</dependencies>

Expand Down
23 changes: 23 additions & 0 deletions src/main/java/com/courseapp/config/OpenApiConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.courseapp.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;

@Configuration
public class OpenApiConfig {

@Bean
OpenAPI customOpenAPI() {
return new OpenAPI()
.info(new Info()
.title("CourseApp API REST")
.version("v1")
.description("Course application developed using Java Spring Boot. This app lets students sign up" +
" and enrol in industry ready courses.")
.termsOfService("https://github.com/anmol111pal/Courses-App")
);
}
}
3 changes: 2 additions & 1 deletion src/test/java/com/courseapp/CourseAppApplicationTests.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.courseapp;

import com.courseapp.config.OpenApiConfig;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
@SpringBootTest(classes = {OpenApiConfig.class})
class CourseAppApplicationTests {

@Test
Expand Down