Created
November 14, 2022 10:52
-
-
Save glaforge/67dcb8a9cea40fa192233daa497e30ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Controller("/product") | |
public class ProductController { | |
@Get | |
@Status(HttpStatus.OK) | |
public void index() { | |
throw Problem.builder() | |
.withType(URI.create("https://example.org/out-of-stock")) | |
.withTitle("Out of Stock") | |
.withStatus(new HttpStatusType(HttpStatus.BAD_REQUEST)) | |
.withDetail("Item B00027Y5QG is no longer available") | |
.with("product", "B00027Y5QG") | |
.build(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment