Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to put comments on swagger documentation in spring boot

@ApiOperation(value = "Get a product by id", notes = "Returns a product as per the id")
@ApiResponses(value = {
  @ApiResponse(code = 200, message = "Successfully retrieved"),
  @ApiResponse(code = 404, message = "Not found - The product was not found")
})
@GetMapping("/products/{id}")
public ResponseEntity<Product> getProduct(@PathVariable("id") @ApiParam(name = "id", value = "Product id", example = "1") Long id) {
    //retrieval logic
    return ResponseEntity.ok(new Product(1, "Product 1", "$21.99"));
}
Comment

how to put comments on swagger documentation in spring boot

@ApiModelProperty(notes = "Product ID", example = "1", required = true) 
private Long id; 
@ApiModelProperty(notes = "Product name", example = "Product 1", required = false) 
private String name; 
@ApiModelProperty(notes = "Product price", example = "$100.00", required = true) 
private String price;
Comment

PREVIOUS NEXT
Code Example
Java :: governmental transparency 
Java :: reversing an integer with overflow handled 
Java :: jakarta allow cross origins 
Java :: What Is Spring Boot and What Are Its Main Features? 
Java :: how to generate randome number in desired range java 
Java :: how to get the length of a jagged array java 
Java :: data input stream using while loop 
Java :: firemonkey android ini file 
Java :: get time until start of next hour in java 
Java :: exception(string message throwable cause) 
Java :: if en une seul ligne java 
Java :: java random number generator 6 
Java :: for each loop summation 
Java :: Java Program to Print Spiral Pattern of Numbers 
Java :: how to reinstall nginuity 
Java :: UserRedirectRequiredException: A redirect is required to get the users approval spring boot 5 security 
Java :: java tostring methode überschreiben 
Java :: make form items vertica 
Java :: java instanciar objeto File 
Java :: Converting data in java 
Java :: javafx change application title 
Java :: create generator hibernate 
Java :: request.iter_content(1024 * 1024) 
Java :: ava program to add two numbers taking input from user 
Java :: You may test the newly compiled and packaged JAR in maven 
Java :: How to Register a Custom Auto-Configuration? 
Java :: Add items to ArrayList Using add() function 
Java :: springboot body 
Java :: change the default port in spring boot codegrepper 
Java :: java trim unicode u200b 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =