Complete the code to add a tag to the API using Swagger annotations.
@Tag(name = "[1]") @RestController public class UserController { // API methods }
The @Tag annotation groups APIs under the given name in Swagger UI.
Complete the code to add a tag description for better API grouping.
@Tag(name = "User Management", description = "[1]") @RestController public class UserController { // API methods }
The description attribute in @Tag provides a clear explanation of the API group.
Fix the error in the tag annotation to correctly group APIs.
@Tag(name = "User Management", description = [1]) @RestController public class UserController { // API methods }
The description value must be a string literal enclosed in double quotes in Java annotations.
Fill both blanks to tag multiple APIs in different controllers.
@Tag(name = "[1]") @RestController public class ProductController { // Product APIs } @Tag(name = "[2]") @RestController public class OrderController { // Order APIs }
Each controller should have a tag that groups its APIs logically by their domain.
Fill all three blanks to add tags with names and descriptions to APIs.
@Tag(name = "[1]", description = "[2]") @RestController public class CustomerController { // Customer APIs } @Tag(name = "[3]") @RestController public class InvoiceController { // Invoice APIs }
Tags group APIs by name and can include descriptions for clarity. The InvoiceController tag here has only a name.