This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new f77a3ec716f CAMEL-22024: Upgrade to Jackson 2.19.0
f77a3ec716f is described below
commit f77a3ec716f83d3aad80b0ff5d7d5d0ba77a80af
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue May 20 11:41:59 2025 +0200
CAMEL-22024: Upgrade to Jackson 2.19.0
---
.../apache/camel/openapi/RestModelConverters.java | 7 -----
.../apache/camel/openapi/RestOpenApiV3XOfTest.java | 24 +++++++--------
.../openapi/V31SchemaForComplexTypesRequest.json | 36 +++++++++++-----------
...ForComplexTypesRequestWithSchemaAnnotation.json | 36 +++++++++++-----------
.../openapi/V31SchemaForComplexTypesResponse.json | 28 ++++++++---------
...orComplexTypesResponseWithSchemaAnnotation.json | 28 ++++++++---------
6 files changed, 75 insertions(+), 84 deletions(-)
diff --git
a/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestModelConverters.java
b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestModelConverters.java
index f81bceba9f7..8d8a9493b33 100644
---
a/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestModelConverters.java
+++
b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestModelConverters.java
@@ -52,13 +52,6 @@ public class RestModelConverters {
MODEL30_CONVERTERS.addConverter(new
ClassNameExtensionModelResolver(new FqnModelResolver()));
}
- private static final ModelConverters MODEL20_CONVERTERS;
-
- static {
- MODEL20_CONVERTERS = ModelConverters.getInstance();
- MODEL20_CONVERTERS.addConverter(new ClassNameExtensionModelResolver());
- }
-
private final boolean openapi31;
public RestModelConverters(boolean openapi31) {
diff --git
a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiV3XOfTest.java
b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiV3XOfTest.java
index 6a3950fce76..101ad23a6ac 100644
---
a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiV3XOfTest.java
+++
b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiV3XOfTest.java
@@ -117,10 +117,12 @@ public class RestOpenApiV3XOfTest extends
CamelTestSupport {
LOG.info(json);
json = json.replace("\n", " ").replaceAll("\\s+", " ");
- assertTrue(json.contains(
- "\"XOfFormA\" : { \"type\" : \"object\", \"properties\" : {
\"code\" : { \"type\" : \"string\" }, \"a\" : { \"type\" : \"string\" }, \"b\"
: { \"type\" : \"integer\", \"format\" : \"int32\" } },"));
- assertTrue(json.contains(
- "\"XOfFormB\" : { \"type\" : \"object\", \"properties\" : {
\"code\" : { \"type\" : \"string\" }, \"x\" : { \"type\" : \"integer\",
\"format\" : \"int32\" }, \"y\" : { \"type\" : \"string\" } },"));
+ if (config.isOpenApi30()) {
+ assertTrue(json.contains(
+ "\"XOfFormA\" : { \"type\" : \"object\", \"properties\" :
{ \"code\" : { \"type\" : \"string\" }, \"a\" : { \"type\" : \"string\" },
\"b\" : { \"type\" : \"integer\", \"format\" : \"int32\" } },"));
+ assertTrue(json.contains(
+ "\"XOfFormB\" : { \"type\" : \"object\", \"properties\" :
{ \"code\" : { \"type\" : \"string\" }, \"x\" : { \"type\" : \"integer\",
\"format\" : \"int32\" }, \"y\" : { \"type\" : \"string\" } },"));
+ }
if (config.isOpenApi30()) {
assertTrue(json.contains(
@@ -129,12 +131,6 @@ public class RestOpenApiV3XOfTest extends CamelTestSupport
{
assertTrue(json.contains(
"\"OneOfFormWrapper\" : { \"type\" : \"object\",
\"properties\" : { \"formType\" : { \"type\" : \"string\" }, \"form\" : {
\"discriminator\" : { \"propertyName\" : \"code\", \"mapping\" : { \"a-123\" :
\"#/components/schemas/org.apache.camel.openapi.model.XOfFormA\", \"b-456\" :
\"#/components/schemas/org.apache.camel.openapi.model.XOfFormB\" } }, \"oneOf\"
: [ { \"$ref\" : \"#/components/schemas/XOfFormA\" }, { \"$ref\" :
\"#/components/schemas/XOfFormB\" } ], \"x-cl [...]
}
- assertTrue(json.contains(
- "\"OneOfForm\" : { \"type\" : \"object\", " +
- "\"discriminator\" : { \"propertyName\" :
\"code\", \"mapping\" : " +
- "{ \"a-123\" :
\"#/components/schemas/org.apache.camel.openapi.model.XOfFormA\", " +
- "\"b-456\" :
\"#/components/schemas/org.apache.camel.openapi.model.XOfFormB\" } }, " +
- "\"oneOf\" : [ { \"$ref\" :
\"#/components/schemas/XOfFormA\" }, { \"$ref\" :
\"#/components/schemas/XOfFormB\" } ],"));
context.stop();
}
@@ -162,8 +158,10 @@ public class RestOpenApiV3XOfTest extends CamelTestSupport
{
assertTrue(json.contains(
"\"AllOfFormWrapper\" : { \"type\" : \"object\",
\"properties\" : { \"fullForm\" : { \"$ref\" :
\"#/components/schemas/AllOfForm\" } },"));
- assertTrue(json.contains(
- "\"allOf\" : [ { \"$ref\" : \"#/components/schemas/XOfFormA\"
}, { \"$ref\" : \"#/components/schemas/XOfFormB\" } ]"));
+ if (config.isOpenApi31()) {
+ assertTrue(json.contains(
+ "\"allOf\" : [ { \"$ref\" :
\"#/components/schemas/XOfFormA\" }, { \"$ref\" :
\"#/components/schemas/XOfFormB\" } ]"));
+ }
context.stop();
}
@@ -191,7 +189,7 @@ public class RestOpenApiV3XOfTest extends CamelTestSupport {
json = json.replace("\n", " ").replaceAll("\\s+", " ");
assertTrue(json.contains(
- "\"AnyOfFormWrapper\" : { \"type\" : \"object\",
\"properties\" : { \"formElements\" : { \"$ref\" :
\"#/components/schemas/AnyOfForm\" } },"));
+ "{ \"formElements\" : { \"$ref\" :
\"#/components/schemas/AnyOfForm\" } }"));
assertTrue(json.contains(
"\"anyOf\" : [ { \"$ref\" : \"#/components/schemas/XOfFormA\"
}, { \"$ref\" : \"#/components/schemas/XOfFormB\" } ]"));
diff --git
a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V31SchemaForComplexTypesRequest.json
b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V31SchemaForComplexTypesRequest.json
index 98b98a87a64..ba05d860ead 100644
---
a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V31SchemaForComplexTypesRequest.json
+++
b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V31SchemaForComplexTypesRequest.json
@@ -38,31 +38,35 @@
"schemas" : {
"SampleComplexResponseType_InnerClass" : {
"type" : "object",
+ "x-className" : {
+ "format" :
"org.apache.camel.openapi.model.SampleComplexResponseType$InnerClass",
+ "type" : "string"
+ },
"properties" : {
"doubleField" : {
"type" : "number",
"format" : "double"
}
- },
- "x-className" : {
- "format" :
"org.apache.camel.openapi.model.SampleComplexResponseType$InnerClass",
- "type" : "string"
}
},
"CustomData" : {
"type" : "object",
+ "x-className" : {
+ "format" : "org.apache.camel.openapi.model.CustomData",
+ "type" : "string"
+ },
"properties" : {
"customDataField" : {
"type" : "string"
}
- },
- "x-className" : {
- "format" : "org.apache.camel.openapi.model.CustomData",
- "type" : "string"
}
},
"SampleComplexRequestType" : {
"type" : "object",
+ "x-className" : {
+ "format" : "org.apache.camel.openapi.model.SampleComplexRequestType",
+ "type" : "string"
+ },
"properties" : {
"data" : {
"$ref" : "#/components/schemas/CustomData"
@@ -129,23 +133,19 @@
"$ref" : "#/components/schemas/SampleComplexRequestType_InnerClass"
}
},
- "required" : [ "mapOfStrings", "requestField1" ],
- "x-className" : {
- "format" : "org.apache.camel.openapi.model.SampleComplexRequestType",
- "type" : "string"
- }
+ "required" : [ "mapOfStrings", "requestField1" ]
},
"SampleComplexRequestType_InnerClass" : {
"type" : "object",
+ "x-className" : {
+ "format" :
"org.apache.camel.openapi.model.SampleComplexRequestType$InnerClass",
+ "type" : "string"
+ },
"properties" : {
"longField" : {
"type" : "integer",
"format" : "int64"
}
- },
- "x-className" : {
- "format" :
"org.apache.camel.openapi.model.SampleComplexRequestType$InnerClass",
- "type" : "string"
}
}
},
@@ -164,4 +164,4 @@
}
}
}
-}
+}
\ No newline at end of file
diff --git
a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V31SchemaForComplexTypesRequestWithSchemaAnnotation.json
b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V31SchemaForComplexTypesRequestWithSchemaAnnotation.json
index 957c6c8fdf9..79ec7e02c2d 100644
---
a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V31SchemaForComplexTypesRequestWithSchemaAnnotation.json
+++
b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V31SchemaForComplexTypesRequestWithSchemaAnnotation.json
@@ -38,19 +38,23 @@
"schemas" : {
"requestInner" : {
"type" : "object",
+ "x-className" : {
+ "format" :
"org.apache.camel.openapi.model.SampleComplexRequestTypeWithSchemaAnnotation$InnerClass",
+ "type" : "string"
+ },
"properties" : {
"longField" : {
"type" : "integer",
"format" : "int64"
}
- },
- "x-className" : {
- "format" :
"org.apache.camel.openapi.model.SampleComplexRequestTypeWithSchemaAnnotation$InnerClass",
- "type" : "string"
}
},
"sampleRequestWithSchema" : {
"type" : "object",
+ "x-className" : {
+ "format" :
"org.apache.camel.openapi.model.SampleComplexRequestTypeWithSchemaAnnotation",
+ "type" : "string"
+ },
"properties" : {
"data" : {
"$ref" : "#/components/schemas/customData"
@@ -117,35 +121,31 @@
"$ref" : "#/components/schemas/requestInner"
}
},
- "required" : [ "mapOfStrings", "requestField1" ],
- "x-className" : {
- "format" :
"org.apache.camel.openapi.model.SampleComplexRequestTypeWithSchemaAnnotation",
- "type" : "string"
- }
+ "required" : [ "mapOfStrings", "requestField1" ]
},
"customData" : {
"type" : "object",
+ "x-className" : {
+ "format" :
"org.apache.camel.openapi.model.CustomDataWithSchemaAnnotation",
+ "type" : "string"
+ },
"properties" : {
"customDataField" : {
"type" : "string"
}
- },
- "x-className" : {
- "format" :
"org.apache.camel.openapi.model.CustomDataWithSchemaAnnotation",
- "type" : "string"
}
},
"responseInner" : {
"type" : "object",
+ "x-className" : {
+ "format" :
"org.apache.camel.openapi.model.SampleComplexResponseTypeWithSchemaAnnotation$InnerClass",
+ "type" : "string"
+ },
"properties" : {
"doubleField" : {
"type" : "number",
"format" : "double"
}
- },
- "x-className" : {
- "format" :
"org.apache.camel.openapi.model.SampleComplexResponseTypeWithSchemaAnnotation$InnerClass",
- "type" : "string"
}
}
},
@@ -164,4 +164,4 @@
}
}
}
-}
+}
\ No newline at end of file
diff --git
a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V31SchemaForComplexTypesResponse.json
b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V31SchemaForComplexTypesResponse.json
index 70cc0e6c23f..91c6665426f 100644
---
a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V31SchemaForComplexTypesResponse.json
+++
b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V31SchemaForComplexTypesResponse.json
@@ -38,19 +38,23 @@
"schemas" : {
"SampleComplexResponseType_InnerClass" : {
"type" : "object",
+ "x-className" : {
+ "format" :
"org.apache.camel.openapi.model.SampleComplexResponseType$InnerClass",
+ "type" : "string"
+ },
"properties" : {
"doubleField" : {
"type" : "number",
"format" : "double"
}
- },
- "x-className" : {
- "format" :
"org.apache.camel.openapi.model.SampleComplexResponseType$InnerClass",
- "type" : "string"
}
},
"SampleComplexResponseType" : {
"type" : "object",
+ "x-className" : {
+ "format" :
"org.apache.camel.openapi.model.SampleComplexResponseType",
+ "type" : "string"
+ },
"properties" : {
"responseField1" : {
"type" : "string"
@@ -72,23 +76,19 @@
"$ref" :
"#/components/schemas/SampleComplexResponseType_InnerClass"
}
},
- "required" : [ "arrayOfStrings", "responseField1" ],
- "x-className" : {
- "format" :
"org.apache.camel.openapi.model.SampleComplexResponseType",
- "type" : "string"
- }
+ "required" : [ "arrayOfStrings", "responseField1" ]
},
"SampleComplexRequestType_InnerClass" : {
"type" : "object",
+ "x-className" : {
+ "format" :
"org.apache.camel.openapi.model.SampleComplexRequestType$InnerClass",
+ "type" : "string"
+ },
"properties" : {
"longField" : {
"type" : "integer",
"format" : "int64"
}
- },
- "x-className" : {
- "format" :
"org.apache.camel.openapi.model.SampleComplexRequestType$InnerClass",
- "type" : "string"
}
}
},
@@ -107,4 +107,4 @@
}
}
}
-}
+}
\ No newline at end of file
diff --git
a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V31SchemaForComplexTypesResponseWithSchemaAnnotation.json
b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V31SchemaForComplexTypesResponseWithSchemaAnnotation.json
index ef9c2863a0d..87dd099edf7 100644
---
a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V31SchemaForComplexTypesResponseWithSchemaAnnotation.json
+++
b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V31SchemaForComplexTypesResponseWithSchemaAnnotation.json
@@ -38,6 +38,10 @@
"schemas" : {
"sampleResponseWithSchema" : {
"type" : "object",
+ "x-className" : {
+ "format" :
"org.apache.camel.openapi.model.SampleComplexResponseTypeWithSchemaAnnotation",
+ "type" : "string"
+ },
"properties" : {
"responseField1" : {
"type" : "string"
@@ -59,36 +63,32 @@
"$ref" : "#/components/schemas/responseInner"
}
},
- "required" : [ "arrayOfStrings", "responseField1" ],
- "x-className" : {
- "format" :
"org.apache.camel.openapi.model.SampleComplexResponseTypeWithSchemaAnnotation",
- "type" : "string"
- }
+ "required" : [ "arrayOfStrings", "responseField1" ]
},
"responseInner" : {
"type" : "object",
+ "x-className" : {
+ "format" :
"org.apache.camel.openapi.model.SampleComplexResponseTypeWithSchemaAnnotation$InnerClass",
+ "type" : "string"
+ },
"properties" : {
"doubleField" : {
"type" : "number",
"format" : "double"
}
- },
- "x-className" : {
- "format" :
"org.apache.camel.openapi.model.SampleComplexResponseTypeWithSchemaAnnotation$InnerClass",
- "type" : "string"
}
},
"SampleComplexRequestType_InnerClass" : {
"type" : "object",
+ "x-className" : {
+ "format" :
"org.apache.camel.openapi.model.SampleComplexRequestType$InnerClass",
+ "type" : "string"
+ },
"properties" : {
"longField" : {
"type" : "integer",
"format" : "int64"
}
- },
- "x-className" : {
- "format" :
"org.apache.camel.openapi.model.SampleComplexRequestType$InnerClass",
- "type" : "string"
}
}
},
@@ -107,4 +107,4 @@
}
}
}
-}
+}
\ No newline at end of file