Bird
0
0

You added Springdoc to your Spring Boot app but the API docs page shows no endpoints. What is the most likely cause?

medium📝 Debug Q14 of 15
Spring Boot - API Documentation
You added Springdoc to your Spring Boot app but the API docs page shows no endpoints. What is the most likely cause?
AYou forgot to add @RestController to your controller classes.
BYou wrote your endpoints in XML configuration.
CYou used @Controller instead of @RestController without @ResponseBody.
DYou did not start the Spring Boot application.
Step-by-Step Solution
Solution:
  1. Step 1: Understand Springdoc endpoint detection

    Springdoc detects REST endpoints typically annotated with @RestController or @Controller + @ResponseBody.
  2. Step 2: Identify missing @ResponseBody effect

    If you use @Controller without @ResponseBody, Springdoc may not detect endpoints as REST APIs, so docs show empty.
  3. Final Answer:

    You used @Controller instead of @RestController without @ResponseBody. -> Option C
  4. Quick Check:

    Missing @ResponseBody means no REST endpoints detected [OK]
Quick Trick: Use @RestController or @Controller + @ResponseBody for docs [OK]
Common Mistakes:
  • Assuming @Controller alone is enough for REST docs
  • Forgetting to run the app before checking docs
  • Thinking XML config affects Springdoc detection

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes