Bird
0
0

Given the method annotated as:

medium📝 component behavior Q4 of 15
Spring Boot - API Documentation
Given the method annotated as:
@Operation(summary = "Create user", description = "Creates a new user in the system")
public User createUser(User user) { ... }

What will be shown in the generated OpenAPI documentation for this method?
ANo summary or description shown
BSummary: null; Description: Creates a new user in the system
CSummary: Create user; Description: null
DSummary: Create user; Description: Creates a new user in the system
Step-by-Step Solution
Solution:
  1. Step 1: Understand @Operation usage

    The summary and description attributes provide text for the API docs.
  2. Step 2: Check given values

    Both summary and description are set, so both appear in the documentation.
  3. Final Answer:

    Summary: Create user; Description: Creates a new user in the system -> Option D
  4. Quick Check:

    @Operation summary and description appear in docs [OK]
Quick Trick: Both summary and description show if provided [OK]
Common Mistakes:
  • Assuming missing summary or description
  • Thinking only one attribute shows
  • Confusing null with empty string

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes