MRE

Steps to repro:

  1. Unzip the MRE
  2. mvn clean install
  3. mvn spring-boot:run

Expected

application to launch and start listening for requests. It should pickup the PetApiController for example.


@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-04-09T11:01:32.253705-07:00[America/Los_Angeles]")
@Controller
@RequestMapping("${openapi.swaggerPetstore.base-path:/v2}")
public class PetApiController implements PetApi {
...

Observed

application starts but exits. it does not listen for requests. no controllers are "picked up" or "wired".

[main] INFO com.baeldung.openapi.OpenApiApplication - Starting OpenApiApplication using Java 21.0.1 with PID 33251 (/Users/xxx/code/openapi-mre/target/classes started by xxx in /Users/xxx/code/openapi-mre)
[main] INFO com.baeldung.openapi.OpenApiApplication - No active profile set, falling back to 1 default profile: "default"
[main] WARN org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration - Cannot find template location: classpath:/templates/ (please add some templates, check your Mustache configuration, or set spring.mustache.check-template-location=false)
[main] INFO com.baeldung.openapi.OpenApiApplication - Started OpenApiApplication in 0.39 seconds (process running for 0.506)

Additional Info

the project has been structured as per official documentation

  tree target/classes
target/classes
├── api.yaml
├── com
│   └── baeldung
│       └── openapi
│           ├── OpenApiApplication.class
│           ├── api
│           │   ├── ApiUtil.class
│           │   ├── PetApi$1.class
│           │   ├── PetApi.class
│           │   ├── PetApiController$1.class
│           │   ├── PetApiController.class
│           │   ├── PetApiDelegate.class
│           │   ├── StoreApi$1.class
│           │   ├── StoreApi.class
│           │   ├── StoreApiController$1.class
│           │   ├── StoreApiController.class
│           │   ├── StoreApiDelegate.class
│           │   ├── UserApi$1.class
│           │   ├── UserApi.class
│           │   ├── UserApiController$1.class
│           │   ├── UserApiController.class
│           │   └── UserApiDelegate.class
│           └── model
│               ├── Category.class
│               ├── ModelApiResponse.class
│               ├── Order$StatusEnum.class
│               ├── Order.class
│               ├── Pet$StatusEnum.class
│               ├── Pet.class
│               ├── Tag.class
│               └── User.class
└── org
    └── openapitools
        └── configuration

9 directories, 26 files

Comment From: wilkinsona

There's no web server on the classpath. One is typically provided by a dependency on spring-boot-starter-web.

If you have any further questions, please follow up on Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.