Recall & Review
beginner
What is the purpose of the @Parameter annotation in Spring Boot?
The @Parameter annotation is used to describe and document parameters of API endpoints, helping tools like Swagger generate clear API documentation.
Click to reveal answer
beginner
How does the @Schema annotation help in API development?
The @Schema annotation defines metadata for model properties, such as descriptions, example values, and data types, improving API documentation clarity.
Click to reveal answer
beginner
Which annotation would you use to add a description to a query parameter in a REST API?
You would use the @Parameter annotation to add a description to a query parameter.
Click to reveal answer
intermediate
Can @Schema be used on method parameters or only on model fields?
While @Schema is mainly used on model fields to describe data properties, it can also be used on method parameters to provide schema details.
Click to reveal answer
intermediate
What is the benefit of using @Parameter and @Schema annotations together in Spring Boot APIs?
Using both annotations together improves API documentation by clearly describing parameters and data models, making APIs easier to understand and use.
Click to reveal answer
What does the @Parameter annotation primarily describe?
✗ Incorrect
The @Parameter annotation is used to describe parameters of API endpoints.
Which annotation helps define example values for API model properties?
✗ Incorrect
@Schema allows setting example values and descriptions for model properties.
Where would you typically place the @Schema annotation?
✗ Incorrect
@Schema is usually placed on model fields to describe data properties.
Which annotation improves generated Swagger UI documentation for parameters?
✗ Incorrect
@Parameter enhances Swagger UI by describing API parameters.
Can @Parameter be used to describe header parameters in an API?
✗ Incorrect
@Parameter can describe any API parameter including headers.
Explain how @Parameter and @Schema annotations help improve API documentation in Spring Boot.
Think about how these annotations add descriptions and examples.
You got /3 concepts.
Describe a scenario where you would use both @Parameter and @Schema annotations together in a Spring Boot REST controller.
Consider an endpoint with query parameters and a JSON response body.
You got /3 concepts.