Complete the code to add a description to a method parameter using @Parameter annotation.
@Parameter(description = "[1]") public void getUser(String userId) {}
The @Parameter annotation's description attribute is used to describe the parameter. Here, "User identifier" clearly describes the purpose of the parameter.
Complete the code to specify the example value for a schema using @Schema annotation.
@Schema(example = "[1]") private String status;
The example attribute in @Schema provides a sample value for the field. "active" is a meaningful example for a status field.
Fix the error in the annotation to correctly mark a parameter as required using @Parameter.
@Parameter(required = [1])
public void updateUser(String userId) {}The required attribute expects a boolean value without quotes. Using true (lowercase) is correct.
Fill both blanks to define a schema with a description and a minimum value.
@Schema(description = "[1]", minimum = "[2]") private int age;
The description explains the field, and minimum sets the lowest allowed value. "User age" and "18" are appropriate here.
Fill all three blanks to create a parameter annotation with a name, description, and required flag.
@Parameter(name = "[1]", description = "[2]", required = [3]) public void deleteUser(String id) {}
The name attribute names the parameter, description explains it, and required marks it as mandatory. "userId", "The ID of the user to delete", and true are correct.