Bird
0
0

Which dependency is required to add Swagger UI support using springdoc-openapi in a Spring Boot Maven project?

easy📝 Syntax Q3 of 15
Spring Boot - API Documentation
Which dependency is required to add Swagger UI support using springdoc-openapi in a Spring Boot Maven project?
A<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> <version>3.0.0</version> </dependency>
B<dependency> <groupId>io.swagger</groupId> <artifactId>swagger-core</artifactId> <version>1.5.0</version> </dependency>
C<dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> <version>2.1.0</version> </dependency>
D<dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>5.6.0.Final</version> </dependency>
Step-by-Step Solution
Solution:
  1. Step 1: Identify springdoc-openapi UI starter dependency

    org.springdoc springdoc-openapi-starter-webmvc-ui 2.1.0 shows the correct Maven dependency for springdoc-openapi UI integration.
  2. Step 2: Verify other dependencies

    Options B, C, and D are unrelated to Swagger UI integration in Spring Boot.
  3. Final Answer:

    springdoc-openapi-starter-webmvc-ui dependency -> Option C
  4. Quick Check:

    Swagger UI dependency = springdoc-openapi-starter-webmvc-ui [OK]
Quick Trick: Add springdoc-openapi-starter-webmvc-ui for Swagger UI [OK]
Common Mistakes:
  • Using old swagger-core instead of springdoc-openapi
  • Adding unrelated JPA or Hibernate dependencies
  • Missing version or wrong artifactId

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes