Merge branch '2.0.x'

This commit is contained in:
Andy Wilkinson
2022-01-12 12:36:42 +00:00
22 changed files with 665 additions and 208 deletions

View File

@@ -36,7 +36,6 @@ class ErrorController {
Map<String, Object> body = Map.of("status", httpStatus.value(),
"error", httpStatus.getReasonPhrase(),
"path", request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI),
"message", request.getAttribute(RequestDispatcher.ERROR_MESSAGE),
"timestamp", Instant.now().toEpochMilli());
ResponseEntity<Map<String, Object>> response = new ResponseEntity<>(body, httpStatus);
return response;

View File

@@ -1,5 +1,9 @@
/*
<<<<<<< HEAD
* Copyright 2014-2021 the original author or authors.
=======
* Copyright 2014-2022 the original author or authors.
>>>>>>> 2.0.x
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -101,7 +105,6 @@ public class ApiDocumentation {
.andDo(document("error-example",
responseFields(
fieldWithPath("error").description("The HTTP error that occurred, e.g. `Bad Request`"),
fieldWithPath("message").description("A description of the cause of the error"),
fieldWithPath("path").description("The path to which the request was made"),
fieldWithPath("status").description("The HTTP status code, e.g. `400`"),
fieldWithPath("timestamp").description("The time, in milliseconds, at which the error occurred"))));