This is an automated email from the ASF dual-hosted git repository.
apkhmv pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 30c9ed40fd IGNITE-23714 Fix problem json media type (#4756)
30c9ed40fd is described below
commit 30c9ed40fd1ad7f24d3daea75c393cb096f0594c
Author: Mikhail <[email protected]>
AuthorDate: Mon Dec 2 17:47:41 2024 +0300
IGNITE-23714 Fix problem json media type (#4756)
---
.../org/apache/ignite/internal/rest/problem/HttpProblemResponse.java | 4 ++--
.../org/apache/ignite/internal/rest/problem/ProblemJsonMediaType.java | 2 +-
.../ignite/internal/rest/problem/ProblemJsonMediaTypeCodec.java | 2 +-
.../ignite/internal/rest/matcher/MicronautHttpResponseMatcher.java | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git
a/modules/rest-api/src/main/java/org/apache/ignite/internal/rest/problem/HttpProblemResponse.java
b/modules/rest-api/src/main/java/org/apache/ignite/internal/rest/problem/HttpProblemResponse.java
index dfeb436d51..59f6c7c107 100644
---
a/modules/rest-api/src/main/java/org/apache/ignite/internal/rest/problem/HttpProblemResponse.java
+++
b/modules/rest-api/src/main/java/org/apache/ignite/internal/rest/problem/HttpProblemResponse.java
@@ -17,7 +17,7 @@
package org.apache.ignite.internal.rest.problem;
-import static
org.apache.ignite.internal.rest.problem.ProblemJsonMediaType.APPLICATION_JSON_PROBLEM_TYPE;
+import static
org.apache.ignite.internal.rest.problem.ProblemJsonMediaType.APPLICATION_PROBLEM_JSON_TYPE;
import io.micronaut.http.HttpResponseFactory;
import io.micronaut.http.HttpStatus;
@@ -38,7 +38,7 @@ public final class HttpProblemResponse {
public static MutableHttpResponse<Problem> from(Problem problem) {
return HttpResponseFactory.INSTANCE
.status(HttpStatus.valueOf(problem.status()))
- .contentType(APPLICATION_JSON_PROBLEM_TYPE)
+ .contentType(APPLICATION_PROBLEM_JSON_TYPE)
.body(problem);
}
diff --git
a/modules/rest-api/src/main/java/org/apache/ignite/internal/rest/problem/ProblemJsonMediaType.java
b/modules/rest-api/src/main/java/org/apache/ignite/internal/rest/problem/ProblemJsonMediaType.java
index f1ec5ce5da..62524bef5f 100644
---
a/modules/rest-api/src/main/java/org/apache/ignite/internal/rest/problem/ProblemJsonMediaType.java
+++
b/modules/rest-api/src/main/java/org/apache/ignite/internal/rest/problem/ProblemJsonMediaType.java
@@ -26,7 +26,7 @@ public final class ProblemJsonMediaType extends MediaType {
/**
* Media type for problem json.
*/
- public static final ProblemJsonMediaType APPLICATION_JSON_PROBLEM_TYPE =
new ProblemJsonMediaType("application/json+problem");
+ public static final ProblemJsonMediaType APPLICATION_PROBLEM_JSON_TYPE =
new ProblemJsonMediaType("application/problem+json");
private ProblemJsonMediaType(String name) {
super(name);
diff --git
a/modules/rest-api/src/main/java/org/apache/ignite/internal/rest/problem/ProblemJsonMediaTypeCodec.java
b/modules/rest-api/src/main/java/org/apache/ignite/internal/rest/problem/ProblemJsonMediaTypeCodec.java
index 791a9ed72a..ee485ee36b 100644
---
a/modules/rest-api/src/main/java/org/apache/ignite/internal/rest/problem/ProblemJsonMediaTypeCodec.java
+++
b/modules/rest-api/src/main/java/org/apache/ignite/internal/rest/problem/ProblemJsonMediaTypeCodec.java
@@ -39,7 +39,7 @@ public class ProblemJsonMediaTypeCodec implements
MediaTypeCodec {
@Override
public Collection<MediaType> getMediaTypes() {
- return List.of(ProblemJsonMediaType.APPLICATION_JSON_PROBLEM_TYPE);
+ return List.of(ProblemJsonMediaType.APPLICATION_PROBLEM_JSON_TYPE);
}
@Override
diff --git
a/modules/rest-api/src/testFixtures/java/org/apache/ignite/internal/rest/matcher/MicronautHttpResponseMatcher.java
b/modules/rest-api/src/testFixtures/java/org/apache/ignite/internal/rest/matcher/MicronautHttpResponseMatcher.java
index e6825e4140..0eb726b5d2 100644
---
a/modules/rest-api/src/testFixtures/java/org/apache/ignite/internal/rest/matcher/MicronautHttpResponseMatcher.java
+++
b/modules/rest-api/src/testFixtures/java/org/apache/ignite/internal/rest/matcher/MicronautHttpResponseMatcher.java
@@ -17,7 +17,7 @@
package org.apache.ignite.internal.rest.matcher;
-import static
org.apache.ignite.internal.rest.problem.ProblemJsonMediaType.APPLICATION_JSON_PROBLEM_TYPE;
+import static
org.apache.ignite.internal.rest.problem.ProblemJsonMediaType.APPLICATION_PROBLEM_JSON_TYPE;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
@@ -74,7 +74,7 @@ public class MicronautHttpResponseMatcher<T> extends
TypeSafeMatcher<HttpRespons
*/
public static MicronautHttpResponseMatcher<Problem>
isProblemResponse(HttpStatus status, ProblemMatcher problemMatcher) {
return MicronautHttpResponseMatcher.<Problem>hasStatus(status)
- .withMediaType(APPLICATION_JSON_PROBLEM_TYPE)
+ .withMediaType(APPLICATION_PROBLEM_JSON_TYPE)
.withBody(problemMatcher.withStatus(status.getCode()),
Problem.class);
}