Skip to content

Commit b4a8304

Browse files
authored
Merge pull request eugenp#5719 from eugenp/BAEL-1781-v2
simplify swagger ex, fix start
2 parents 6465696 + 9ec41d9 commit b4a8304

7 files changed

Lines changed: 4 additions & 85 deletions

File tree

‎spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Application.java‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.SpringBootApplication;
5-
import org.springframework.context.annotation.ComponentScan;
65

76
@SpringBootApplication
8-
@ComponentScan(basePackages = {"com.baeldung"})
97
public class Application {
108

119
public static void main(String[] args) {

‎spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/Constants.java‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/configuration/SpringFoxConfig.java‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.baeldung.swaggerboot.configuration;
22

3-
import com.fasterxml.classmate.TypeResolver;
4-
import org.springframework.beans.factory.annotation.Autowired;
53
import org.springframework.context.annotation.Bean;
64
import org.springframework.context.annotation.ComponentScan;
75
import org.springframework.context.annotation.Configuration;
@@ -21,9 +19,6 @@
2119
@ComponentScan("com.baeldung.swaggerboot.controller")
2220
public class SpringFoxConfig {
2321

24-
@Autowired
25-
private TypeResolver typeResolver;
26-
2722
private ApiInfo apiInfo() {
2823
return new ApiInfo(
2924
"My REST API",
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
package com.baeldung.swaggerboot.controller;
22

3-
import com.baeldung.swaggerboot.services.RegularWebService;
4-
import com.baeldung.swaggerboot.transfer.CustomResponse;
5-
import org.springframework.beans.factory.annotation.Autowired;
63
import org.springframework.web.bind.annotation.GetMapping;
74
import org.springframework.web.bind.annotation.RestController;
85

9-
import static com.baeldung.swaggerboot.Constants.REGULAR_REST_URL;
10-
116
@RestController
127
public class RegularRestController {
138

14-
@Autowired
15-
RegularWebService regularWebService;
16-
17-
@GetMapping(REGULAR_REST_URL)
18-
public CustomResponse getSession() {
19-
return regularWebService.example();
9+
@GetMapping("home")
10+
public String getSession() {
11+
return "Hello";
2012
}
2113

2214
}

‎spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/services/RegularWebService.java‎

Lines changed: 0 additions & 20 deletions
This file was deleted.

‎spring-boot-mvc/src/main/java/com/baeldung/swaggerboot/transfer/CustomResponse.java‎

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
spring.main.allow-bean-definition-overriding=true

0 commit comments

Comments
 (0)