You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by kl...@apache.org on 2023/05/11 14:00:13 UTC

[camel] branch main updated: CAMEL-18963: upgrade openapi components to latest swagger versions (#10066)

This is an automated email from the ASF dual-hosted git repository.

klease 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 e2ad230d86f CAMEL-18963: upgrade openapi components to latest swagger versions (#10066)
e2ad230d86f is described below

commit e2ad230d86fcbbc1e3c4ad5a9daf01aa3127eb42
Author: klease <38...@users.noreply.github.com>
AuthorDate: Thu May 11 16:00:05 2023 +0200

    CAMEL-18963: upgrade openapi components to latest swagger versions (#10066)
    
    * CAMEL-18963: upgrade openapi components to latest swagger versions
    This allows support of all OpenAPI specification versions including OpenAPI 3.1.x
    in the components camel-openapi-java and camel-rest-openapi.
    The swagger.io dependencies are upgraded to the latest versions and the
    apicurio dependency is dropped.
    Due to this change, in camel-openapi-java, the return type of the public method
    org.apache.camel.openapi.RestOpenApiReader.read() is now io.swagger.v3.oas.models.OpenAPI.
    When an OpenAPI 2.0 (swagger) specification is parsed, it is automatically upgraded
    to OpenAPI 3.0.x by the swagger parser.
    In order to support the property openapi.version=2.0 in the openapi-java component, an OpenAPI3to2
    converter has been added.
    Tests are upgraded except RestOpenApiEndpointTest in camel-rest-openapi which tested apicurio-specific
    classes.
    A new test for OpenAPI 3.1 specifications is added.
---
 camel-dependencies/pom.xml                         |    7 +-
 components/camel-openapi-java/pom.xml              |   24 +-
 .../java/org/apache/camel/openapi/BeanConfig.java  |   48 +-
 .../java/org/apache/camel/openapi/OpenAPI3to2.java |  590 +++++++++
 .../org/apache/camel/openapi/OpenApiHelper.java    |   98 +-
 .../camel/openapi/OpenApiRestProducerFactory.java  |  124 +-
 .../apache/camel/openapi/RestModelConverters.java  |  215 +--
 .../apache/camel/openapi/RestOpenApiReader.java    | 1374 +++++++-------------
 .../apache/camel/openapi/RestOpenApiSupport.java   |  274 ++--
 .../org/apache/camel/openapi/ComplexTypesTest.java |   16 +-
 .../openapi/OpenApiRestProducerFactoryTest.java    |    6 +-
 .../RestOpenApiDefaultProducesConsumesTest.java    |    8 +
 ...estOpenApiModelApiSecurityRequirementsTest.java |   25 +-
 .../camel/openapi/RestOpenApiProcessorTest.java    |    8 +-
 .../RestOpenApiReaderApiDocsOverrideTest.java      |   24 +-
 .../openapi/RestOpenApiReaderApiDocsTest.java      |   24 +-
 .../openapi/RestOpenApiReaderContextPathTest.java  |   42 +-
 .../openapi/RestOpenApiReaderDayOfWeekTest.java    |   23 +-
 .../openapi/RestOpenApiReaderDisabledTest.java     |   42 +-
 ...RestOpenApiReaderEnableVendorExtensionTest.java |   22 +-
 .../RestOpenApiReaderFileResponseModelTest.java    |   34 +-
 .../RestOpenApiReaderModelApiSecurityTest.java     |   25 +-
 .../RestOpenApiReaderModelBookOrderTest.java       |   24 +-
 .../camel/openapi/RestOpenApiReaderModelTest.java  |   23 +-
 .../RestOpenApiReaderOverrideHostApiDocsTest.java  |   23 +-
 .../RestOpenApiReaderPropertyPlaceholderTest.java  |   15 +-
 .../camel/openapi/RestOpenApiReaderTest.java       |   62 +-
 .../camel/openapi/RestOpenApiSupportTest.java      |   93 +-
 .../openapi/RestOpenApiV2SecuritySchemesTest.java  |   26 +-
 .../openapi/RestOpenApiV3SecuritySchemesTest.java  |   36 +-
 .../apache/camel/openapi/RestOpenApiV3XOfTest.java |   48 +-
 ...pringRestOpenApiReaderModelApiSecurityTest.java |   23 +-
 .../openapi/V2SchemaForComplexTypesRequest.json    |  118 +-
 ...ForComplexTypesRequestWithSchemaAnnotation.json |  118 +-
 .../openapi/V2SchemaForComplexTypesResponse.json   |   70 +-
 ...orComplexTypesResponseWithSchemaAnnotation.json |   88 +-
 .../openapi/V3SchemaForComplexTypesRequest.json    |   46 +-
 ...ForComplexTypesRequestWithSchemaAnnotation.json |   48 +-
 .../openapi/V3SchemaForComplexTypesResponse.json   |   36 +-
 ...orComplexTypesResponseWithSchemaAnnotation.json |   68 +-
 components/camel-rest-openapi/pom.xml              |   22 +-
 .../rest/openapi/RestOpenApiEndpoint.java          |  413 +++---
 .../camel/component/rest/openapi/HttpsV3Test.java  |   22 +-
 .../rest/openapi/RestOpenApiComponentTest.java     |    4 +-
 .../rest/openapi/RestOpenApiComponentYamlTest.java |    4 +-
 .../rest/openapi/RestOpenApiEndpointTest.java      |  439 -------
 .../rest/openapi/RestOpenApiEndpointV3Test.java    |  141 +-
 .../openapi/RestOpenApiGlobalHttpsV31Test.java     |   54 +
 .../src/test/resources/openapi-v3.json             | 1261 +++++++++++++++++-
 .../src/test/resources/petstore-3.1.yaml           |  144 ++
 parent/pom.xml                                     |    7 +-
 51 files changed, 3422 insertions(+), 3107 deletions(-)

diff --git a/camel-dependencies/pom.xml b/camel-dependencies/pom.xml
index a3a9fb49897..1729e60619e 100644
--- a/camel-dependencies/pom.xml
+++ b/camel-dependencies/pom.xml
@@ -470,9 +470,10 @@
         <squareup-okio-version>1.17.2</squareup-okio-version>
         <sshd-version>2.9.2</sshd-version>
         <stompjms-version>1.19</stompjms-version>
-        <swagger-java-version>1.6.4</swagger-java-version>
-        <swagger-openapi3-version>2.2.8</swagger-openapi3-version>
-        <swagger-java-parser-version>1.0.62</swagger-java-parser-version>
+        <swagger-java-version>1.6.10</swagger-java-version>
+        <swagger-openapi3-version>2.2.9</swagger-openapi3-version>
+        <swagger-java-parser-version>1.0.65</swagger-java-parser-version>
+        <swagger-openapi3-java-parser-version>2.1.13</swagger-openapi3-java-parser-version>
         <stax-api-version>1.0.1</stax-api-version>
         <stringtemplate-version>4.3.4</stringtemplate-version>
         <templating-maven-plugin-version>1.0.0</templating-maven-plugin-version>
diff --git a/components/camel-openapi-java/pom.xml b/components/camel-openapi-java/pom.xml
index 093de535108..58295ed1510 100644
--- a/components/camel-openapi-java/pom.xml
+++ b/components/camel-openapi-java/pom.xml
@@ -78,17 +78,33 @@
             <artifactId>jackson-jakarta-rs-json-provider</artifactId>
             <version>${jackson2-version}</version>
         </dependency>
-
         <dependency>
-            <groupId>io.apicurio</groupId>
-            <artifactId>apicurio-data-models</artifactId>
-            <version>${apicurio-version}</version>
+            <groupId>io.swagger.core.v3</groupId>
+            <artifactId>swagger-models</artifactId>
+            <version>${swagger-openapi3-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>io.swagger.parser.v3</groupId>
+            <artifactId>swagger-parser</artifactId>
+            <version>${swagger-openapi3-java-parser-version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>io.swagger.core.v3</groupId>
+                <artifactId>swagger-core</artifactId>
+                </exclusion>
+            </exclusions>        
         </dependency>
 
         <dependency>
             <groupId>io.swagger.core.v3</groupId>
             <artifactId>swagger-core-jakarta</artifactId>
             <version>${swagger-openapi3-version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>io.swagger.core.v3</groupId>
+                <artifactId>swagger-models-jakarta</artifactId>
+                </exclusion>
+            </exclusions>  
         </dependency>
 
 
diff --git a/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/BeanConfig.java b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/BeanConfig.java
index a1d03684667..e17d88d4ca0 100644
--- a/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/BeanConfig.java
+++ b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/BeanConfig.java
@@ -16,14 +16,9 @@
  */
 package org.apache.camel.openapi;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import io.apicurio.datamodels.core.models.common.Info;
-import io.apicurio.datamodels.core.models.common.Server;
-import io.apicurio.datamodels.openapi.models.OasDocument;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Document;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Document;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.info.Info;
+import io.swagger.v3.oas.models.servers.Server;
 
 public class BeanConfig {
     public static final String DEFAULT_MEDIA_TYPE = "application/json";
@@ -126,40 +121,15 @@ public class BeanConfig {
         this.defaultProduces = defaultProduces;
     }
 
-    public OasDocument configure(OasDocument openApi) {
-        if (openApi instanceof Oas20Document) {
-            configureOas20((Oas20Document) openApi);
-        } else if (openApi instanceof Oas30Document) {
-            configureOas30((Oas30Document) openApi);
-        }
-        return openApi;
-    }
-
-    private void configureOas30(Oas30Document openApi) {
+    public OpenAPI configure(OpenAPI openApi) {
         if (info != null) {
-            openApi.info = info;
-            info._ownerDocument = openApi;
-            info._parent = openApi;
+            openApi.setInfo(info);
         }
-        Server server = openApi.createServer();
-        server.url = this.schemes[0] + "://" + this.host + this.basePath;
-        openApi.addServer(server);
-    }
-
-    private void configureOas20(Oas20Document openApi) {
-        if (schemes != null) {
-            if (openApi.schemes == null) {
-                openApi.schemes = new ArrayList<String>();
-            }
-            openApi.schemes.addAll(Arrays.asList(schemes));
+        for (String scheme : this.schemes) {
+            Server server = new Server().url(scheme + "://" + this.host + this.basePath);
+            openApi.addServersItem(server);
         }
-        if (info != null) {
-            openApi.info = info;
-            info._ownerDocument = openApi;
-            info._parent = openApi;
-        }
-        openApi.host = host;
-        openApi.basePath = basePath;
+        return openApi;
     }
 
     public boolean isOpenApi3() {
diff --git a/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/OpenAPI3to2.java b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/OpenAPI3to2.java
new file mode 100644
index 00000000000..a4e438c1074
--- /dev/null
+++ b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/OpenAPI3to2.java
@@ -0,0 +1,590 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.openapi;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import io.swagger.models.ArrayModel;
+import io.swagger.models.Contact;
+import io.swagger.models.Info;
+import io.swagger.models.License;
+import io.swagger.models.Model;
+import io.swagger.models.ModelImpl;
+import io.swagger.models.Operation;
+import io.swagger.models.Path;
+import io.swagger.models.RefModel;
+import io.swagger.models.Response;
+import io.swagger.models.Scheme;
+import io.swagger.models.Swagger;
+import io.swagger.models.Tag;
+import io.swagger.models.auth.ApiKeyAuthDefinition;
+import io.swagger.models.auth.BasicAuthDefinition;
+import io.swagger.models.auth.In;
+import io.swagger.models.auth.OAuth2Definition;
+import io.swagger.models.auth.SecuritySchemeDefinition;
+import io.swagger.models.parameters.AbstractSerializableParameter;
+import io.swagger.models.parameters.BodyParameter;
+import io.swagger.models.parameters.CookieParameter;
+import io.swagger.models.parameters.HeaderParameter;
+import io.swagger.models.parameters.Parameter;
+import io.swagger.models.parameters.PathParameter;
+import io.swagger.models.parameters.QueryParameter;
+import io.swagger.models.properties.IntegerProperty;
+import io.swagger.models.properties.Property;
+import io.swagger.models.properties.PropertyBuilder;
+import io.swagger.models.properties.RefProperty;
+import io.swagger.models.properties.StringProperty;
+import io.swagger.util.Json;
+import io.swagger.util.Yaml;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.PathItem;
+import io.swagger.v3.oas.models.Paths;
+import io.swagger.v3.oas.models.examples.Example;
+import io.swagger.v3.oas.models.headers.Header;
+import io.swagger.v3.oas.models.media.ArraySchema;
+import io.swagger.v3.oas.models.media.BinarySchema;
+import io.swagger.v3.oas.models.media.ByteArraySchema;
+import io.swagger.v3.oas.models.media.DateSchema;
+import io.swagger.v3.oas.models.media.DateTimeSchema;
+import io.swagger.v3.oas.models.media.FileSchema;
+import io.swagger.v3.oas.models.media.IntegerSchema;
+import io.swagger.v3.oas.models.media.MapSchema;
+import io.swagger.v3.oas.models.media.MediaType;
+import io.swagger.v3.oas.models.media.NumberSchema;
+import io.swagger.v3.oas.models.media.PasswordSchema;
+import io.swagger.v3.oas.models.media.Schema;
+import io.swagger.v3.oas.models.media.StringSchema;
+import io.swagger.v3.oas.models.parameters.Parameter.StyleEnum;
+import io.swagger.v3.oas.models.parameters.RequestBody;
+import io.swagger.v3.oas.models.responses.ApiResponse;
+import io.swagger.v3.oas.models.security.OAuthFlows;
+import io.swagger.v3.oas.models.security.Scopes;
+import io.swagger.v3.oas.models.security.SecurityRequirement;
+import io.swagger.v3.oas.models.security.SecurityScheme;
+import io.swagger.v3.oas.models.servers.Server;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class OpenAPI3to2 {
+
+    private Swagger openApi2;
+    private Logger log = LoggerFactory.getLogger(getClass());
+
+    public void convertOpenAPI3to2(OpenAPI openApi3) {
+        openApi2 = new Swagger()
+                .info(convertInfo(openApi3.getInfo()))
+                .tags(getTags(openApi3.getTags()))
+                .paths(getPaths(openApi3.getPaths()));
+        setServerInfo(openApi2, openApi3.getServers());
+        if (openApi3.getComponents() != null && openApi3.getComponents().getSchemas() != null) {
+            for (Map.Entry<String, Schema> entry : openApi3.getComponents().getSchemas().entrySet()) {
+                openApi2.addDefinition(entry.getKey(), convertSchema(entry.getValue()));
+            }
+        }
+        if (openApi3.getComponents() != null && openApi3.getComponents().getSecuritySchemes() != null) {
+            convertSecurityDefinitions(openApi2, openApi3.getComponents().getSecuritySchemes());
+        }
+        if (openApi3.getSecurity() != null) {
+            for (SecurityRequirement sr : openApi3.getSecurity()) {
+                openApi2.addSecurity(convertSecurityRequirement(sr));
+            }
+        }
+    }
+
+    private io.swagger.models.SecurityRequirement convertSecurityRequirement(SecurityRequirement sr) {
+        io.swagger.models.SecurityRequirement sreq = new io.swagger.models.SecurityRequirement();
+        for (Map.Entry<String, List<String>> reqMap : sr.entrySet()) {
+            sreq.requirement(reqMap.getKey(), reqMap.getValue());
+        }
+        return sreq;
+    }
+
+    private void convertSecurityDefinitions(Swagger openApi22, Map<String, SecurityScheme> securitySchemes) {
+        for (Map.Entry<String, SecurityScheme> entry : securitySchemes.entrySet()) {
+            openApi2.addSecurityDefinition(entry.getKey(), convertSecurityScheme(entry.getValue()));
+        }
+    }
+
+    private SecuritySchemeDefinition convertSecurityScheme(SecurityScheme securityScheme) {
+        SecuritySchemeDefinition swaggerScheme = null;
+        switch (securityScheme.getType()) {
+            case HTTP:
+                if ("basic".equals(securityScheme.getName())) {
+                    swaggerScheme = new BasicAuthDefinition();
+                } else {
+                    throw new IllegalStateException("OpenAPI 2.0 does not support bearer token security schemes.");
+                }
+                break;
+            case APIKEY:
+                if (securityScheme.getIn() == SecurityScheme.In.COOKIE) {
+                    throw new IllegalStateException("Invalid 'in' value for API Key security scheme");
+                } else {
+                    swaggerScheme
+                            = new ApiKeyAuthDefinition(securityScheme.getName(), In.forValue(securityScheme.getIn().name()));
+                }
+                break;
+            case OAUTH2:
+                OAuth2Definition oauth2 = new OAuth2Definition();
+                OAuthFlows flows = securityScheme.getFlows();
+                Scopes scopes = null;
+                if (flows.getImplicit() != null) {
+                    oauth2.implicit(flows.getImplicit().getAuthorizationUrl());
+                    scopes = flows.getImplicit().getScopes();
+                } else if (flows.getPassword() != null) {
+                    oauth2.password(flows.getPassword().getTokenUrl());
+                    scopes = flows.getPassword().getScopes();
+                } else if (flows.getClientCredentials() != null) {
+                    oauth2.application(flows.getClientCredentials().getTokenUrl());
+                    scopes = flows.getClientCredentials().getScopes();
+                } else if (flows.getAuthorizationCode() != null) {
+                    oauth2.accessCode(flows.getAuthorizationCode().getAuthorizationUrl(),
+                            flows.getAuthorizationCode().getTokenUrl());
+                    scopes = flows.getAuthorizationCode().getScopes();
+                } else {
+                    // TODO: handle other
+                }
+                if (scopes != null) {
+                    for (Map.Entry<String, String> entry : scopes.entrySet()) {
+                        oauth2.addScope(entry.getKey(), entry.getValue());
+                    }
+                }
+
+                swaggerScheme = oauth2;
+                break;
+            default:
+                throw new IllegalStateException(
+                        "Security scheme " + securityScheme.getType().toString()
+                                                + "is not supported in OpenAPI 2");
+        }
+        if (swaggerScheme != null && securityScheme.getDescription() != null) {
+            swaggerScheme.setDescription(securityScheme.getDescription());
+        }
+        return swaggerScheme;
+    }
+
+    private void setServerInfo(Swagger openApi2, List<Server> servers) {
+        // set host, basePath & schemas
+        for (Server server : servers) {
+            String serverUrl = server.getUrl();
+            if (serverUrl != null && !serverUrl.isEmpty()) {
+                try {
+                    URL url = new URL(serverUrl);
+                    openApi2.setHost(url.getHost() + ":" + url.getPort());
+                    openApi2.setBasePath(url.getPath());
+                    Scheme scheme = Scheme.forValue(url.getProtocol());
+                    if (scheme != null) {
+                        openApi2.addScheme(scheme);
+                    }
+                } catch (MalformedURLException e) {
+                    log.warn("Malformed URL in configuration: {}", serverUrl);
+                    int basePathIndex = serverUrl.lastIndexOf('/');
+                    if (basePathIndex > 0) {
+                        openApi2.setBasePath(serverUrl.substring(basePathIndex));
+                    } else {
+                        basePathIndex = serverUrl.length() - 1;
+                    }
+                    int protIndex = serverUrl.indexOf("://");
+                    if (protIndex > 0) {
+                        String protocol = serverUrl.substring(0, protIndex);
+                        Scheme scheme = Scheme.forValue(protocol);
+                        if (scheme != null) {
+                            openApi2.addScheme(scheme);
+                        }
+                        openApi2.setHost(serverUrl.substring(protIndex + 3, basePathIndex));
+                    } else {
+                        openApi2.setHost(serverUrl.substring(0, basePathIndex));
+                    }
+                }
+            }
+        }
+
+    }
+
+    public byte[] getSwaggerAsJson() {
+        ObjectMapper mapper = Json.mapper();
+        mapper.enable(SerializationFeature.INDENT_OUTPUT);
+        //        mapper.setSerializationInclusion(.Include.NON_NULL);
+        try {
+            return mapper.writeValueAsBytes(openApi2);
+        } catch (JsonProcessingException e) {
+            // TODO Auto-generated catch block
+            return new byte[0];
+        }
+    }
+
+    public byte[] getSwaggerAsYaml() {
+        ObjectMapper mapper = Json.mapper();
+        try {
+            JsonNode node = mapper.readTree(getSwaggerAsJson());
+            return Yaml.mapper().writerWithDefaultPrettyPrinter().writeValueAsBytes(node);
+        } catch (IOException e) {
+            // TODO Auto-generated catch block
+            return new byte[0];
+        }
+    }
+
+    private Map<String, Path> getPaths(Paths paths) {
+        Map<String, Path> swaggerPaths = new java.util.HashMap<>();
+        for (Map.Entry<String, PathItem> pathItem : paths.entrySet()) {
+            swaggerPaths.put(pathItem.getKey(), convertPathItem(pathItem.getValue()));
+        }
+        return swaggerPaths;
+    }
+
+    private Path convertPathItem(PathItem pathItem) {
+        Path path = new Path();
+        for (Map.Entry<PathItem.HttpMethod, io.swagger.v3.oas.models.Operation> op : pathItem.readOperationsMap().entrySet()) {
+            path.set(op.getKey().name().toLowerCase(), convertOperation(op.getValue()));
+        }
+        return path;
+    }
+
+    private Operation convertOperation(io.swagger.v3.oas.models.Operation openApiOp) {
+        Operation swaggerOp = new Operation().operationId(openApiOp.getOperationId());
+        if (openApiOp.getTags() != null) {
+            swaggerOp.setTags(openApiOp.getTags());
+        }
+        if (openApiOp.getExtensions() != null) {
+            swaggerOp.setVendorExtensions(openApiOp.getExtensions());
+        }
+        swaggerOp.setSummary(openApiOp.getSummary());
+        swaggerOp.setDeprecated(openApiOp.getDeprecated());
+        if (openApiOp.getSecurity() != null) {
+            for (SecurityRequirement srs : openApiOp.getSecurity()) {
+                for (Map.Entry<String, List<String>> sr : srs.entrySet()) {
+                    swaggerOp.addSecurity(sr.getKey(), sr.getValue());
+                }
+            }
+        }
+        if (openApiOp.getParameters() != null) {
+            for (io.swagger.v3.oas.models.parameters.Parameter param : openApiOp.getParameters()) {
+                swaggerOp.addParameter(convertParameter(param));
+            }
+        }
+        if (openApiOp.getRequestBody() != null) {
+            swaggerOp.addParameter(convertRequestBodyToParameter(openApiOp.getRequestBody()));
+            swaggerOp.setConsumes(getConsumers(openApiOp.getRequestBody()));
+        }
+        if (openApiOp.getResponses() != null) {
+            for (Entry<String, ApiResponse> resp : openApiOp.getResponses().entrySet()) {
+                swaggerOp.addResponse(resp.getKey(), convertResponse(resp.getValue()));
+            }
+            swaggerOp.setProduces(getProducers(openApiOp.getResponses().values()));
+        }
+
+        return swaggerOp;
+    }
+
+    private List<String> getProducers(Collection<ApiResponse> apiResponses) {
+        List<String> producers = new java.util.ArrayList<>();
+        for (ApiResponse response : apiResponses) {
+            if (response.getContent() != null) {
+                producers.addAll(response.getContent().keySet());
+            }
+        }
+        return producers;
+    }
+
+    private Response convertResponse(ApiResponse apiResponse) {
+        Response response = new Response().description(apiResponse.getDescription());
+        Map<String, Object> examples = new java.util.HashMap<>();
+        if (apiResponse.getContent() != null) {
+            for (MediaType contentType : apiResponse.getContent().values()) {
+                if (contentType.getSchema() != null) {
+                    response.setResponseSchema(convertSchema(contentType.getSchema()));
+                    if (contentType.getExamples() != null) {
+                        for (Map.Entry<String, Example> ex : contentType.getExamples().entrySet()) {
+                            examples.put(ex.getKey(), ex.getValue().getValue());
+                        }
+                    }
+                    break;
+                }
+            }
+        }
+        if (!examples.isEmpty()) {
+            response.setExamples(examples);
+        }
+        if (apiResponse.getHeaders() != null) {
+            for (Map.Entry<String, Header> hdr : apiResponse.getHeaders().entrySet()) {
+                Property headerProp = convertHeaderToProperty(hdr.getValue());
+                if (headerProp != null) {
+                    response.addHeader(hdr.getKey(), headerProp);
+                }
+            }
+        }
+        return response;
+    }
+
+    private Property convertHeaderToProperty(Header header) {
+        if (header.getSchema() != null) {
+            Property headerProp = convertSchemaToProperty(header.getSchema());
+            if (header.getDescription() != null) {
+                headerProp.setDescription(header.getDescription());
+            }
+            return headerProp;
+        } else {
+            log.warn("Missing schema for Header {}", header.toString());
+            return null;
+        }
+    }
+
+    private List<String> getConsumers(RequestBody requestBody) {
+        // set consumes for the op to all keys of contentTypes
+        if (requestBody.getContent() != null) {
+            return new java.util.ArrayList<String>(requestBody.getContent().keySet());
+        } else {
+            return Collections.emptyList();
+        }
+    }
+
+    private Parameter convertRequestBodyToParameter(RequestBody requestBody) {
+        BodyParameter bodyParam = new BodyParameter().name("body");
+        if (requestBody.getRequired()) {
+            bodyParam.setRequired(requestBody.getRequired());
+        }
+        if (requestBody.getDescription() != null && !requestBody.getDescription().isEmpty()) {
+            bodyParam.setDescription(requestBody.getDescription());
+        }
+        if (requestBody.getContent() != null) {
+            for (MediaType contentType : requestBody.getContent().values()) {
+                if (contentType.getSchema() != null) {
+                    bodyParam.setSchema(convertSchema(contentType.getSchema()));
+                    break;
+                }
+            }
+            for (Entry<String, MediaType> contentType : requestBody.getContent().entrySet()) {
+                if (contentType.getValue().getExample() != null) {
+                    bodyParam.addExample(contentType.getKey(), contentType.getValue().getExample().toString());
+                }
+            }
+
+        }
+        return bodyParam;
+    }
+
+    private Model convertSchema(Schema schema) {
+        Model model = null;
+        if (schema instanceof FileSchema) {
+            // Special case
+            return new ModelImpl().type("file");
+        }
+        if (schema.get$ref() != null) {
+            return new RefModel(convertRef(schema.get$ref()));
+        } else if (schema.getItems() != null) {
+            model = new ArrayModel().items(convertSchemaToProperty(schema.getItems()));
+        } else {
+            model = new ModelImpl().type(schema.getType()).format(schema.getFormat());
+            //           model = new ModelImpl().type(schema.getType());
+        }
+        if (schema.getProperties() != null) {
+            model.setProperties(convertPropertiesMap(schema.getProperties()));
+        }
+        if (schema.getRequired() != null && model instanceof ModelImpl) {
+            for (Object req : schema.getRequired()) {
+                ((ModelImpl) model).addRequired(req.toString());
+            }
+        }
+        if (schema.getDescription() != null && !schema.getDescription().isEmpty()) {
+            model.setDescription(schema.getDescription());
+        }
+        if (schema.getExtensions() != null) {
+            ((ModelImpl) model).setVendorExtensions(schema.getExtensions());
+        }
+        return model;
+    }
+
+    private Map<String, Property> convertPropertiesMap(Map properties) {
+        Map<String, Property> swaggerProps = new java.util.HashMap<>(properties.size());
+        for (Map.Entry<String, Schema> propEntry : ((Map<String, Schema>) properties).entrySet()) {
+            swaggerProps.put(propEntry.getKey(), convertSchemaToProperty(propEntry.getValue()));
+        }
+        return swaggerProps;
+    }
+
+    private String convertRef(String schemaRef) {
+        return schemaRef.replace("#/components/schemas", "#/definitions");
+    }
+
+    private Parameter convertParameter(io.swagger.v3.oas.models.parameters.Parameter param) {
+        switch (param.getIn()) {
+            case "path":
+                return initParam(new PathParameter(), param);
+            case "query":
+                return initParam(new QueryParameter(), param);
+            case "cookie":
+                return initParam(new CookieParameter(), param);
+            case "header":
+                return initParam(new HeaderParameter(), param);
+            default: // should not happen
+                return null;
+        }
+    }
+
+    private Parameter initParam(
+            AbstractSerializableParameter swaggerParam, io.swagger.v3.oas.models.parameters.Parameter param) {
+        swaggerParam.name(param.getName()).required(param.getRequired());
+        if (param.getDescription() != null) {
+            swaggerParam.setDescription(param.getDescription());
+        }
+        if (param.getStyle() != null) {
+            swaggerParam.setCollectionFormat(convertStyleToCollectionFormat(param.getStyle()));
+        }
+        if (param.getSchema() != null) {
+            swaggerParam.setType(param.getSchema().getType());
+            swaggerParam.setFormat(param.getSchema().getFormat());
+            if (param.getSchema().getDefault() != null) {
+                swaggerParam.setDefault(param.getSchema().getDefault());
+            }
+            if (param.getSchema().getItems() != null) {
+                // Convert items schema to swagger items property
+                swaggerParam.setItems(convertSchemaToProperty(param.getSchema().getItems()));
+            }
+            if (param.getSchema().getEnum() != null) {
+                // Convert enums (ATTENTION, maybe not strings?)
+                swaggerParam.setEnum(param.getSchema().getEnum());
+            }
+        }
+        if (param.getExample() != null) {
+            swaggerParam.setExample(param.getExample().toString());
+        } else if (param.getExamples() != null && !param.getExamples().isEmpty()) {
+            swaggerParam.setExample(param.getExamples().values().iterator().next().getValue().toString());
+        }
+
+        return swaggerParam;
+    }
+
+    private String convertStyleToCollectionFormat(StyleEnum style) {
+        switch (style) {
+            case FORM:
+                return "csv";
+            case SPACEDELIMITED:
+                return "ssv";
+            case PIPEDELIMITED:
+                return "pipes";
+            case DEEPOBJECT:
+                return "multi";
+            default:
+                return "csv";
+        }
+    }
+
+    private Property convertSchemaToProperty(Schema schema) {
+        if (schema.get$ref() != null) {
+            return new RefProperty(convertRef(schema.get$ref()));
+        }
+        if (schema instanceof IntegerSchema) {
+            IntegerProperty prop = new IntegerProperty();
+            prop.setFormat(schema.getFormat());
+            return prop;
+        } else if (schema instanceof NumberSchema) {
+            if ("float".equals(schema.getFormat())) {
+                return new io.swagger.models.properties.FloatProperty();
+            } else if ("double".equals(schema.getFormat())) {
+                return new io.swagger.models.properties.DoubleProperty();
+            } else if ("int64".equals(schema.getFormat())) {
+                return new io.swagger.models.properties.LongProperty();
+            } else {
+                return new io.swagger.models.properties.BaseIntegerProperty(schema.getFormat());
+            }
+        } else if (schema instanceof ByteArraySchema) {
+            return new io.swagger.models.properties.ByteArrayProperty();
+        } else if (schema instanceof BinarySchema) {
+            return new io.swagger.models.properties.BinaryProperty();
+        } else if (schema instanceof DateSchema) {
+            return new io.swagger.models.properties.DateProperty();
+        } else if (schema instanceof DateTimeSchema) {
+            return new io.swagger.models.properties.DateTimeProperty();
+        } else if (schema instanceof PasswordSchema) {
+            return new io.swagger.models.properties.PasswordProperty();
+        } else if (schema instanceof FileSchema) {
+            return new io.swagger.models.properties.FileProperty();
+        } else if (schema instanceof StringSchema) {
+            StringProperty prop = new StringProperty(schema.getFormat());
+            if (schema.getEnum() != null) {
+                prop.setEnum(schema.getEnum());
+            }
+            return prop;
+        } else if (schema instanceof ArraySchema) {
+            return new io.swagger.models.properties.ArrayProperty(convertSchemaToProperty(schema.getItems()));
+        } else if (schema instanceof MapSchema) {
+            if (schema.getAdditionalProperties() != null && schema.getAdditionalProperties() instanceof Schema) {
+                return new io.swagger.models.properties.MapProperty(
+                        convertSchemaToProperty((Schema) schema.getAdditionalProperties()));
+            }
+            if (schema.getAdditionalItems() != null) {
+                return new io.swagger.models.properties.MapProperty(convertSchemaToProperty(schema.getAdditionalItems()));
+            } else {
+                return new io.swagger.models.properties.MapProperty(); // should not happen?
+            }
+        } else {
+            // ???
+            return PropertyBuilder.build(schema.getType(), schema.getFormat(), null);
+        }
+    }
+
+    private List<Tag> getTags(List<io.swagger.v3.oas.models.tags.Tag> tags) {
+        if (tags != null) {
+            List<Tag> swaggerTags = new java.util.ArrayList<>(tags.size());
+            for (io.swagger.v3.oas.models.tags.Tag tag : tags) {
+                swaggerTags.add(new Tag().name(tag.getName()).description(tag.getDescription()));
+            }
+            return swaggerTags;
+        }
+        return null;
+    }
+
+    private Info convertInfo(io.swagger.v3.oas.models.info.Info info) {
+        if (info != null) {
+            return new Info().description(info.getDescription())
+                    .title(info.getTitle())
+                    .termsOfService(info.getTermsOfService())
+                    .version(info.getVersion())
+                    .contact(convertContact(info.getContact()))
+                    .license(convertLicense(info.getLicense()));
+        } else {
+            return null;
+        }
+    }
+
+    private License convertLicense(io.swagger.v3.oas.models.info.License license) {
+        if (license != null) {
+            return new License().name(license.getName()).url(license.getUrl());
+        } else {
+            return null;
+        }
+    }
+
+    private Contact convertContact(io.swagger.v3.oas.models.info.Contact contact) {
+        if (contact != null) {
+            return new Contact().name(contact.getName()).email(contact.getEmail()).url(contact.getUrl());
+        } else {
+            return null;
+        }
+    }
+
+}
diff --git a/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/OpenApiHelper.java b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/OpenApiHelper.java
index 55b767e85a2..aac2b146985 100644
--- a/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/OpenApiHelper.java
+++ b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/OpenApiHelper.java
@@ -16,16 +16,10 @@
  */
 package org.apache.camel.openapi;
 
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import io.apicurio.datamodels.openapi.models.OasDocument;
-import io.apicurio.datamodels.openapi.models.OasOperation;
-import io.apicurio.datamodels.openapi.models.OasPathItem;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Document;
-import io.apicurio.datamodels.openapi.v2.models.Oas20SchemaDefinition;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Document;
-import io.apicurio.datamodels.openapi.v3.models.Oas30SchemaDefinition;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.Operation;
+import io.swagger.v3.oas.models.PathItem;
+import io.swagger.v3.oas.models.media.Schema;
 import org.apache.camel.util.FileUtil;
 
 public final class OpenApiHelper {
@@ -55,79 +49,27 @@ public final class OpenApiHelper {
      * Clears all the vendor extension on the openApi model. This may be needed as some API tooling does not support
      * this.
      */
-    public static void clearVendorExtensions(OasDocument openApi) {
-
-        if (openApi instanceof Oas20Document) {
-            openApi.clearExtensions();
-            if (((Oas20Document) openApi).definitions != null
-                    && ((Oas20Document) openApi).definitions.getDefinitions() != null) {
-                for (Oas20SchemaDefinition schemaDefinition : ((Oas20Document) openApi).definitions.getDefinitions()) {
-                    schemaDefinition.clearExtensions();
-                }
-            }
-            if (openApi.paths != null) {
-                for (OasPathItem path : openApi.paths.getPathItems()) {
-                    path.clearExtensions();
-                    for (OasOperation op : getOperationMap(path).values()) {
-                        op.clearExtensions();
-                    }
-                }
+    public static void clearVendorExtensions(OpenAPI openApi) {
+        if (openApi.getExtensions() != null) {
+            openApi.getExtensions().clear();
+        }
+        if (openApi.getComponents() != null
+                && openApi.getComponents().getSchemas() != null) {
+            for (Schema<?> schemaDefinition : openApi.getComponents().getSchemas().values()) {
+                schemaDefinition.getExtensions().clear();
             }
-        } else if (openApi instanceof Oas30Document) {
-            openApi.clearExtensions();
-            if (((Oas30Document) openApi).components != null
-                    && ((Oas30Document) openApi).components.schemas != null) {
-                for (Oas30SchemaDefinition schemaDefinition : ((Oas30Document) openApi).components.schemas.values()) {
-                    schemaDefinition.clearExtensions();
+        }
+        if (openApi.getPaths() != null) {
+            for (PathItem path : openApi.getPaths().values()) {
+                if (path.getExtensions() != null) {
+                    path.getExtensions().clear();
                 }
-            }
-            if (openApi.paths != null) {
-                for (OasPathItem path : openApi.paths.getPathItems()) {
-                    path.clearExtensions();
-                    for (OasOperation op : getOperationMap(path).values()) {
-                        op.clearExtensions();
+                for (Operation op : path.readOperationsMap().values()) {
+                    if (op.getExtensions() != null) {
+                        op.getExtensions().clear();
                     }
                 }
             }
         }
     }
-
-    private static Map<HttpMethod, OasOperation> getOperationMap(OasPathItem path) {
-        Map<HttpMethod, OasOperation> result = new LinkedHashMap<>();
-
-        if (path.get != null) {
-            result.put(HttpMethod.GET, path.get);
-        }
-        if (path.put != null) {
-            result.put(HttpMethod.PUT, path.put);
-        }
-        if (path.post != null) {
-            result.put(HttpMethod.POST, path.post);
-        }
-        if (path.delete != null) {
-            result.put(HttpMethod.DELETE, path.delete);
-        }
-        if (path.patch != null) {
-            result.put(HttpMethod.PATCH, path.patch);
-        }
-        if (path.head != null) {
-            result.put(HttpMethod.HEAD, path.head);
-        }
-        if (path.options != null) {
-            result.put(HttpMethod.OPTIONS, path.options);
-        }
-
-        return result;
-    }
-
-    enum HttpMethod {
-        POST,
-        GET,
-        PUT,
-        PATCH,
-        DELETE,
-        HEAD,
-        OPTIONS
-    }
-
 }
diff --git a/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/OpenApiRestProducerFactory.java b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/OpenApiRestProducerFactory.java
index 48a00cda672..3c5dc57c251 100644
--- a/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/OpenApiRestProducerFactory.java
+++ b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/OpenApiRestProducerFactory.java
@@ -16,35 +16,26 @@
  */
 package org.apache.camel.openapi;
 
-import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.StringJoiner;
 
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
-import io.apicurio.datamodels.openapi.models.OasOperation;
-import io.apicurio.datamodels.openapi.models.OasParameter;
-import io.apicurio.datamodels.openapi.models.OasPathItem;
-import io.apicurio.datamodels.openapi.models.OasResponse;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Document;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Operation;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Operation;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Response;
+import io.swagger.parser.OpenAPIParser;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.Operation;
+import io.swagger.v3.oas.models.PathItem;
+import io.swagger.v3.oas.models.parameters.Parameter;
+import io.swagger.v3.oas.models.responses.ApiResponse;
+import io.swagger.v3.parser.core.models.SwaggerParseResult;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Producer;
 import org.apache.camel.spi.RestConfiguration;
 import org.apache.camel.spi.RestProducerFactory;
 import org.apache.camel.support.CamelContextHelper;
-import org.apache.camel.util.IOHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.apache.camel.support.ResourceHelper.resolveMandatoryResourceAsInputStream;
-
 public class OpenApiRestProducerFactory implements RestProducerFactory {
 
     private static final Logger LOG = LoggerFactory.getLogger(OpenApiRestProducerFactory.class);
@@ -68,16 +59,16 @@ public class OpenApiRestProducerFactory implements RestProducerFactory {
             path = "/" + path;
         }
 
-        OasDocument openApi = loadOpenApiModel(camelContext, apiDoc);
-        OasOperation operation = getOpenApiOperation(openApi, verb, path);
+        OpenAPI openApi = loadOpenApiModel(camelContext, apiDoc);
+        Operation operation = getOpenApiOperation(openApi, verb, path);
         if (operation == null) {
             throw new IllegalArgumentException("OpenApi api-doc does not contain operation for " + verb + ":" + path);
         }
 
         // validate if we have the query parameters also
         if (queryParameters != null) {
-            for (OasParameter param : operation.parameters) {
-                if ("query".equals(param.in) && Boolean.TRUE.equals(param.required)) {
+            for (Parameter param : operation.getParameters()) {
+                if ("query".equals(param.getIn()) && Boolean.TRUE.equals(param.getRequired())) {
                     // check if we have the required query parameter defined
                     String key = param.getName();
                     String token = key + "=";
@@ -96,56 +87,44 @@ public class OpenApiRestProducerFactory implements RestProducerFactory {
                 produces, consumes, componentName, parameters);
     }
 
-    OasDocument loadOpenApiModel(CamelContext camelContext, String apiDoc) throws Exception {
-        InputStream is = resolveMandatoryResourceAsInputStream(camelContext, apiDoc);
-        final ObjectMapper mapper = new ObjectMapper();
-        try {
-            final JsonNode node = mapper.readTree(is);
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Loaded openApi api-doc:\n{}", node.toPrettyString());
-            }
-            return (OasDocument) Library.readDocument(node);
+    OpenAPI loadOpenApiModel(CamelContext camelContext, String apiDoc) throws Exception {
+        final OpenAPIParser openApiParser = new OpenAPIParser();
+        final SwaggerParseResult openApi = openApiParser.readLocation(apiDoc, null, null);
 
-        } finally {
-            IOHelper.close(is);
+        if (openApi != null && openApi.getOpenAPI() != null) {
+            //   checkV2specification(openApi.getOpenAPI(), uri);
+            return openApi.getOpenAPI();
         }
 
+        // In theory there should be a message in the parse result but it has disappeared...
+        throw new IllegalArgumentException(
+                "The given OpenApi specification could not be loaded from `" + apiDoc + "`.");
+
     }
 
-    private OasOperation getOpenApiOperation(OasDocument openApi, String verb, String path) {
+    private Operation getOpenApiOperation(OpenAPI openApi, String verb, String path) {
         // path may include base path so skip that
         String basePath = RestOpenApiSupport.getBasePathFromOasDocument(openApi);
         if (basePath != null && path.startsWith(basePath)) {
             path = path.substring(basePath.length());
         }
 
-        OasPathItem modelPath = openApi.paths.getItem(path);
+        PathItem modelPath = openApi.getPaths().get(path);
         if (modelPath == null) {
             return null;
         }
 
         // get,put,post,head,delete,patch,options
-        OasOperation op = null;
-        if ("get".equals(verb)) {
-            op = modelPath.get;
-        } else if ("put".equals(verb)) {
-            op = modelPath.put;
-        } else if ("post".equals(verb)) {
-            op = modelPath.post;
-        } else if ("head".equals(verb)) {
-            op = modelPath.head;
-        } else if ("delete".equals(verb)) {
-            op = modelPath.delete;
-        } else if ("patch".equals(verb)) {
-            op = modelPath.patch;
-        } else if ("options".equals(verb)) {
-            op = modelPath.options;
+        Operation op = null;
+        PathItem.HttpMethod method = PathItem.HttpMethod.valueOf(verb.toUpperCase());
+        if (method != null) {
+            return modelPath.readOperationsMap().get(method);
         }
         return op;
     }
 
     private Producer createHttpProducer(
-            CamelContext camelContext, OasDocument openApi, OasOperation operation,
+            CamelContext camelContext, OpenAPI openApi, Operation operation,
             String host, String verb, String path, String queryParameters,
             String consumes, String produces,
             String componentName, Map<String, Object> parameters)
@@ -161,49 +140,22 @@ public class OpenApiRestProducerFactory implements RestProducerFactory {
             if (produces == null) {
                 StringJoiner producesBuilder = new StringJoiner(",");
                 List<String> list = new ArrayList<>();
-                if (operation instanceof Oas20Operation) {
-                    list = ((Oas20Operation) operation).produces;
-                } else if (operation instanceof Oas30Operation) {
-                    Oas30Operation oas30Operation = (Oas30Operation) operation;
-                    for (OasResponse response : oas30Operation.responses.getResponses()) {
-                        Oas30Response oas30Response = (Oas30Response) response;
-                        list.addAll(oas30Response.content.keySet());
-                    }
-
-                }
-                if (list == null || list.isEmpty()) {
-                    if (openApi instanceof Oas20Document) {
-                        list = ((Oas20Document) openApi).produces;
-                    }
-                }
-                if (list != null) {
-                    for (String s : list) {
-                        producesBuilder.add(s);
+                if (operation.getResponses() != null) {
+                    for (ApiResponse response : operation.getResponses().values()) {
+                        if (response.getContent() != null) {
+                            for (String mediaType : response.getContent().keySet()) {
+                                producesBuilder.add(mediaType);
+                            }
+                        }
                     }
                 }
                 produces = producesBuilder.length() == 0 ? null : producesBuilder.toString();
             }
             if (consumes == null) {
                 StringJoiner consumesBuilder = new StringJoiner(",");
-                List<String> list = new ArrayList<>();
-                if (operation instanceof Oas20Operation) {
-                    list = ((Oas20Operation) operation).consumes;
-                } else if (operation instanceof Oas30Operation) {
-                    Oas30Operation oas30Operation = (Oas30Operation) operation;
-                    if (oas30Operation.requestBody != null
-                            && oas30Operation.requestBody.content != null) {
-                        list.addAll(oas30Operation.requestBody.content.keySet());
-                    }
-
-                }
-                if (list == null || list.isEmpty()) {
-                    if (openApi instanceof Oas20Document) {
-                        list = ((Oas20Document) openApi).consumes;
-                    }
-                }
-                if (list != null) {
-                    for (String s : list) {
-                        consumesBuilder.add(s);
+                if (operation.getRequestBody() != null && operation.getRequestBody().getContent() != null) {
+                    for (String mediaType : operation.getRequestBody().getContent().keySet()) {
+                        consumesBuilder.add(mediaType);
                     }
                 }
                 consumes = consumesBuilder.length() == 0 ? null : consumesBuilder.toString();
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 931d0728c33..2687564f2ce 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
@@ -16,8 +16,6 @@
  */
 package org.apache.camel.openapi;
 
-import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -25,26 +23,12 @@ import java.util.Objects;
 
 import com.fasterxml.jackson.databind.JavaType;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import io.apicurio.datamodels.core.models.Extension;
-import io.apicurio.datamodels.openapi.models.OasDocument;
-import io.apicurio.datamodels.openapi.models.OasSchema;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Document;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Schema;
-import io.apicurio.datamodels.openapi.v2.models.Oas20SchemaDefinition;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Discriminator;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Document;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Schema;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30AnyOfSchema;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Schema.Oas30OneOfSchema;
-import io.apicurio.datamodels.openapi.v3.models.Oas30SchemaDefinition;
 import io.swagger.v3.core.converter.AnnotatedType;
 import io.swagger.v3.core.converter.ModelConverter;
 import io.swagger.v3.core.converter.ModelConverterContext;
 import io.swagger.v3.core.converter.ModelConverters;
 import io.swagger.v3.core.jackson.ModelResolver;
-import io.swagger.v3.oas.models.media.ArraySchema;
-import io.swagger.v3.oas.models.media.ComposedSchema;
-import io.swagger.v3.oas.models.media.Discriminator;
+import io.swagger.v3.oas.models.OpenAPI;
 import io.swagger.v3.oas.models.media.Schema;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -71,205 +55,28 @@ public class RestModelConverters {
         MODEL20_CONVERTERS.addConverter(new ClassNameExtensionModelResolver());
     }
 
-    public List<? extends OasSchema> readClass(OasDocument oasDocument, Class<?> clazz) {
+    public List<? extends Schema> readClass(OpenAPI oasDocument, Class<?> clazz) {
         if (clazz.equals(java.io.File.class)) {
             // File is a special type in OAS2 / OAS3 (no model)
             return null;
-        } else if (oasDocument instanceof Oas20Document) {
-            return readClassOas20((Oas20Document) oasDocument, clazz);
-        } else if (oasDocument instanceof Oas30Document) {
-            return readClassOas30((Oas30Document) oasDocument, clazz);
         } else {
-            return null;
+            return readClassOpenApi3(oasDocument, clazz);
         }
     }
 
-    private List<? extends OasSchema> readClassOas30(Oas30Document oasDocument, Class<?> clazz) {
+    private List<? extends Schema> readClassOpenApi3(OpenAPI oasDocument, Class<?> clazz) {
         String name = clazz.getName();
         if (!name.contains(".")) {
             return null;
         }
 
-        if (oasDocument.components == null) {
-            oasDocument.components = oasDocument.createComponents();
-        }
-
         Map<String, Schema> swaggerModel = MODEL30_CONVERTERS.readAll(clazz);
+        List<Schema> modelSchemas = new java.util.ArrayList<>();
         swaggerModel.forEach((key, schema) -> {
-            Oas30SchemaDefinition model = oasDocument.components.createSchemaDefinition(key);
-            oasDocument.components.addSchemaDefinition(key, model);
-            processSchema(model, schema);
-        });
-
-        return oasDocument.components.getSchemaDefinitions();
-    }
-
-    private List<? extends OasSchema> readClassOas20(Oas20Document oasDocument, Class<?> clazz) {
-        String name = clazz.getName();
-        if (!name.contains(".")) {
-            return null;
-        }
-
-        if (oasDocument.definitions == null) {
-            oasDocument.definitions = oasDocument.createDefinitions();
-        }
-
-        Map<String, Schema> swaggerModel = MODEL20_CONVERTERS.readAll(clazz);
-        swaggerModel.forEach((key, schema) -> {
-            Oas20SchemaDefinition model = oasDocument.definitions.createSchemaDefinition(key);
-            oasDocument.definitions.addDefinition(key, model);
-            processSchema(model, schema);
+            schema.setName(key);
+            modelSchemas.add(schema);
         });
-
-        return oasDocument.definitions.getDefinitions();
-    }
-
-    private void processSchema(OasSchema model, Schema schema) {
-        String type = schema.getType();
-        model.type = type;
-        model.format = schema.getFormat();
-
-        String ref = schema.get$ref();
-        if (ref != null) {
-            if (model instanceof Oas20Schema) {
-                // Change the prefix from 3.x to 2.x
-                model.$ref = RestOpenApiReader.OAS20_SCHEMA_DEFINITION_PREFIX +
-                             ref.substring(RestOpenApiReader.OAS30_SCHEMA_DEFINITION_PREFIX.length());
-            } else {
-                model.$ref = ref;
-            }
-        }
-        Boolean nullable = schema.getNullable();
-        if (nullable != null && model instanceof Oas30Schema) {
-            ((Oas30Schema) model).nullable = nullable;
-        }
-
-        // xxxOf support
-        if (model instanceof Oas30SchemaDefinition && schema instanceof ComposedSchema) {
-            ComposedSchema composedSchema = (ComposedSchema) schema;
-            Oas30SchemaDefinition modelDefinition = (Oas30SchemaDefinition) model;
-
-            // oneOf
-            boolean xOf = false;
-            if (null != composedSchema.getOneOf()) {
-                xOf = true;
-                for (Schema oneOfSchema : composedSchema.getOneOf()) {
-                    if (null != oneOfSchema.get$ref()) {
-                        Oas30OneOfSchema oneOfModel = modelDefinition.createOneOfSchema();
-                        oneOfModel.setReference(oneOfSchema.get$ref());
-                        modelDefinition.addOneOfSchema(oneOfModel);
-                        type = null; // No longer typed
-                        model.type = null;
-                    }
-                }
-            }
-
-            // allOf
-            if (null != composedSchema.getAllOf()) {
-                xOf = true;
-                for (Schema allOfSchema : composedSchema.getAllOf()) {
-                    if (null != allOfSchema.get$ref()) {
-                        OasSchema allOfModel = modelDefinition.createAllOfSchema();
-                        allOfModel.setReference(allOfSchema.get$ref());
-                        modelDefinition.addAllOfSchema(allOfModel);
-                        type = null; // No longer typed
-                        model.type = null;
-                    }
-                }
-            }
-
-            // anyOf
-            if (null != composedSchema.getAnyOf()) {
-                xOf = true;
-                for (Schema anyOfSchema : composedSchema.getAnyOf()) {
-                    if (null != anyOfSchema.get$ref()) {
-                        Oas30AnyOfSchema anyOfModel = modelDefinition.createAnyOfSchema();
-                        anyOfModel.setReference(anyOfSchema.get$ref());
-                        modelDefinition.addAnyOfSchema(anyOfModel);
-                        type = null; // No longer typed
-                        model.type = null;
-                    }
-                }
-            }
-
-            // Discriminator
-            if (xOf && null != composedSchema.getDiscriminator()) {
-                Discriminator discriminator = schema.getDiscriminator();
-                Oas30Discriminator modelDiscriminator = modelDefinition.createDiscriminator();
-                modelDiscriminator.propertyName = discriminator.getPropertyName();
-
-                if (null != discriminator.getMapping()) {
-                    discriminator.getMapping().entrySet().stream()
-                            .forEach(e -> modelDiscriminator.addMapping(e.getKey(), e.getValue()));
-                }
-                modelDefinition.discriminator = modelDiscriminator;
-            }
-        }
-
-        if (type != null) {
-            switch (type) {
-                case "object":
-                    if (schema.getProperties() != null) {
-                        //noinspection unchecked
-                        schema.getProperties().forEach((p, v) -> {
-                            OasSchema property = (OasSchema) model.createPropertySchema((String) p);
-                            model.addProperty((String) p, property);
-                            processSchema(property, (Schema) v);
-                        });
-                    }
-                    break;
-                case "array":
-                    Schema items = ((ArraySchema) schema).getItems();
-                    OasSchema modelItems = model.createItemsSchema();
-                    model.items = modelItems;
-                    processSchema(modelItems, items);
-                    break;
-                case "string":
-                    if (schema.getEnum() != null) {
-                        //noinspection unchecked
-                        model.enum_ = new ArrayList<String>(schema.getEnum());
-                    }
-                    break;
-                case "boolean":
-                case "number":
-                case "integer":
-                    break;
-                default:
-                    LOG.warn("Encountered unexpected type {} in processing schema.", type);
-                    break;
-            }
-        }
-
-        if (schema.getRequired() != null) {
-            //noinspection unchecked
-            model.required = new ArrayList<String>(schema.getRequired());
-        }
-
-        String description = schema.getDescription();
-        if (description != null) {
-            model.description = description;
-        }
-        Object example = schema.getExample();
-        if (example != null) {
-            model.example = example;
-        }
-
-        if (schema.getAdditionalProperties() instanceof Schema) {
-            OasSchema additionalProperties = model.createAdditionalPropertiesSchema();
-            model.additionalProperties = additionalProperties;
-            processSchema(additionalProperties, (Schema) schema.getAdditionalProperties());
-        }
-
-        if (schema.getExtensions() != null) {
-            //noinspection unchecked
-            schema.getExtensions().forEach((key, value) -> {
-                Extension extension = model.createExtension();
-                extension.name = (String) key;
-                extension.value = value;
-
-                model.addExtension((String) key, extension);
-            });
-        }
+        return modelSchemas;
     }
 
     private static class FqnModelResolver extends ModelResolver {
@@ -288,6 +95,7 @@ public class RestModelConverters {
 
         public ClassNameExtensionModelResolver() {
             this(new ModelResolver(new ObjectMapper()));
+            ModelResolver.composedModelPropertiesAsSibling = true;
         }
 
         public ClassNameExtensionModelResolver(ModelResolver delegate) {
@@ -308,11 +116,12 @@ public class RestModelConverters {
                 }
 
                 if (!type.isContainerType()) {
-                    Map<String, String> value = new HashMap<>();
+                    Map<String, String> value = new java.util.HashMap<>();
                     value.put("type", "string");
                     value.put("format", type.getRawClass().getName());
-
                     result.addExtension("x-className", value);
+                    // OpenAPI 3: would it be better to set the classname directly as "format" ?
+                    // result.setFormat(type.getRawClass().getName());
                 }
             }
             return result;
diff --git a/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestOpenApiReader.java b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestOpenApiReader.java
index fef5043faef..96f0dee0af5 100644
--- a/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestOpenApiReader.java
+++ b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestOpenApiReader.java
@@ -20,69 +20,62 @@ import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodType;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Optional;
 import java.util.Set;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.core.models.ExtensibleNode;
-import io.apicurio.datamodels.core.models.Extension;
-import io.apicurio.datamodels.core.models.Node;
-import io.apicurio.datamodels.core.models.common.AuthorizationCodeOAuthFlow;
-import io.apicurio.datamodels.core.models.common.ClientCredentialsOAuthFlow;
-import io.apicurio.datamodels.core.models.common.ImplicitOAuthFlow;
-import io.apicurio.datamodels.core.models.common.OAuthFlow;
-import io.apicurio.datamodels.core.models.common.PasswordOAuthFlow;
-import io.apicurio.datamodels.core.models.common.SecurityRequirement;
-import io.apicurio.datamodels.core.models.common.Tag;
-import io.apicurio.datamodels.core.visitors.TraverserDirection;
-import io.apicurio.datamodels.openapi.models.OasDocument;
-import io.apicurio.datamodels.openapi.models.OasOperation;
-import io.apicurio.datamodels.openapi.models.OasParameter;
-import io.apicurio.datamodels.openapi.models.OasPathItem;
-import io.apicurio.datamodels.openapi.models.OasSchema;
-import io.apicurio.datamodels.openapi.models.OasSecurityRequirement;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Document;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Header;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Items;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Operation;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Parameter;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Response;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Schema;
-import io.apicurio.datamodels.openapi.v2.models.Oas20SchemaDefinition;
-import io.apicurio.datamodels.openapi.v2.models.Oas20SecurityScheme;
-import io.apicurio.datamodels.openapi.v2.visitors.Oas20AllNodeVisitor;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Document;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Header;
-import io.apicurio.datamodels.openapi.v3.models.Oas30MediaType;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Operation;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Parameter;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Response;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Schema;
-import io.apicurio.datamodels.openapi.v3.models.Oas30SchemaDefinition;
-import io.apicurio.datamodels.openapi.v3.models.Oas30SecurityScheme;
-import io.apicurio.datamodels.openapi.v3.visitors.Oas30AllNodeVisitor;
+import io.swagger.v3.core.filter.AbstractSpecFilter;
+import io.swagger.v3.core.filter.SpecFilter;
+import io.swagger.v3.core.model.ApiDescription;
+import io.swagger.v3.oas.models.Components;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.Operation;
+import io.swagger.v3.oas.models.PathItem;
+import io.swagger.v3.oas.models.Paths;
+import io.swagger.v3.oas.models.examples.Example;
+import io.swagger.v3.oas.models.headers.Header;
+import io.swagger.v3.oas.models.media.ArraySchema;
 import io.swagger.v3.oas.models.media.BinarySchema;
 import io.swagger.v3.oas.models.media.ByteArraySchema;
+import io.swagger.v3.oas.models.media.Content;
 import io.swagger.v3.oas.models.media.DateSchema;
 import io.swagger.v3.oas.models.media.DateTimeSchema;
+import io.swagger.v3.oas.models.media.FileSchema;
+import io.swagger.v3.oas.models.media.IntegerSchema;
+import io.swagger.v3.oas.models.media.MediaType;
+import io.swagger.v3.oas.models.media.NumberSchema;
 import io.swagger.v3.oas.models.media.PasswordSchema;
+import io.swagger.v3.oas.models.media.Schema;
+import io.swagger.v3.oas.models.media.StringSchema;
+import io.swagger.v3.oas.models.parameters.Parameter;
+import io.swagger.v3.oas.models.parameters.Parameter.StyleEnum;
+import io.swagger.v3.oas.models.parameters.RequestBody;
+import io.swagger.v3.oas.models.responses.ApiResponse;
+import io.swagger.v3.oas.models.responses.ApiResponses;
+import io.swagger.v3.oas.models.security.OAuthFlow;
+import io.swagger.v3.oas.models.security.OAuthFlows;
+import io.swagger.v3.oas.models.security.Scopes;
+import io.swagger.v3.oas.models.security.SecurityRequirement;
+import io.swagger.v3.oas.models.security.SecurityScheme;
+import io.swagger.v3.oas.models.tags.Tag;
 import org.apache.camel.CamelContext;
 import org.apache.camel.model.rest.ApiKeyDefinition;
 import org.apache.camel.model.rest.BasicAuthDefinition;
 import org.apache.camel.model.rest.BearerTokenDefinition;
+import org.apache.camel.model.rest.CollectionFormat;
 import org.apache.camel.model.rest.MutualTLSDefinition;
 import org.apache.camel.model.rest.OAuth2Definition;
 import org.apache.camel.model.rest.OpenIdConnectDefinition;
@@ -90,7 +83,6 @@ import org.apache.camel.model.rest.ParamDefinition;
 import org.apache.camel.model.rest.ResponseHeaderDefinition;
 import org.apache.camel.model.rest.ResponseMessageDefinition;
 import org.apache.camel.model.rest.RestDefinition;
-import org.apache.camel.model.rest.RestParamType;
 import org.apache.camel.model.rest.RestPropertyDefinition;
 import org.apache.camel.model.rest.RestSecuritiesDefinition;
 import org.apache.camel.model.rest.RestSecurityDefinition;
@@ -101,6 +93,8 @@ import org.apache.camel.spi.NodeIdFactory;
 import org.apache.camel.support.CamelContextHelper;
 import org.apache.camel.support.ObjectHelper;
 import org.apache.camel.util.FileUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import static java.lang.invoke.MethodHandles.publicLookup;
 
@@ -113,6 +107,7 @@ public class RestOpenApiReader {
 
     public static final String OAS20_SCHEMA_DEFINITION_PREFIX = "#/definitions/";
     public static final String OAS30_SCHEMA_DEFINITION_PREFIX = "#/components/schemas/";
+    private static final Logger LOG = LoggerFactory.getLogger(RestOpenApiReader.class);
     // Types that are not allowed in references.
     private static final Set<String> NO_REFERENCE_TYPE_NAMES = new HashSet<>(
             Arrays.asList(
@@ -144,17 +139,12 @@ public class RestOpenApiReader {
      * @param  classResolver          class resolver to use @return the openApi model
      * @throws ClassNotFoundException is thrown if error loading class
      */
-    public OasDocument read(
+    public OpenAPI read(
             CamelContext camelContext, List<RestDefinition> rests, BeanConfig config,
             String camelContextId, ClassResolver classResolver)
             throws ClassNotFoundException {
 
-        OasDocument openApi;
-        if (config.isOpenApi3()) {
-            openApi = new Oas30Document();
-        } else {
-            openApi = new Oas20Document();
-        }
+        OpenAPI openApi = new OpenAPI();
 
         for (RestDefinition rest : rests) {
             Boolean disabled = CamelContextHelper.parseBoolean(camelContext, rest.getDisabled());
@@ -163,34 +153,43 @@ public class RestOpenApiReader {
             }
         }
 
-        shortenClassNames(openApi);
+        openApi = shortenClassNames(openApi);
 
         /*
          * Fixes the problem of not generating the "paths" section when no rest route is defined.
          * A schema with no paths is considered invalid.
          */
-        if (openApi.paths == null) {
-            openApi.paths = openApi.createPaths();
+        if (openApi.getPaths() == null) {
+            openApi.setPaths(new Paths());
         }
 
         /*
          * Fixes the problem of generating duplicated tags which is invalid per the specification
          */
-        if (openApi.tags != null) {
-            openApi.tags = new ArrayList<>(
-                    openApi.tags
+        if (openApi.getTags() != null) {
+            openApi.setTags(new ArrayList<>(
+                    openApi.getTags()
                             .stream()
                             .collect(Collectors.toMap(Tag::getName, Function.identity(), (prev, current) -> prev))
-                            .values());
+                            .values()));
         }
 
         // configure before returning
         openApi = config.configure(openApi);
+        checkCompatOpenApi2(openApi, config);
         return openApi;
     }
 
+    private void checkCompatOpenApi2(OpenAPI openApi, BeanConfig config) {
+        if (!config.isOpenApi3()) {
+            // Verify that the OpenAPI 3 model can be downgraded to OpenApi 2
+            OpenAPI3to2 converter = new OpenAPI3to2();
+            converter.convertOpenAPI3to2(openApi);
+        }
+    }
+
     private void parse(
-            CamelContext camelContext, OasDocument openApi, RestDefinition rest, String camelContextId,
+            CamelContext camelContext, OpenAPI openApi, RestDefinition rest, String camelContextId,
             ClassResolver classResolver, BeanConfig config)
             throws ClassNotFoundException {
 
@@ -214,11 +213,7 @@ public class RestOpenApiReader {
                         ? new String[] { getValue(camelContext, rest.getPath()) }
                 : new String[0];
 
-        if (openApi instanceof Oas20Document) {
-            parseOas20(camelContext, (Oas20Document) openApi, rest, pathAsTags);
-        } else if (openApi instanceof Oas30Document) {
-            parseOas30((Oas30Document) openApi, rest, pathAsTags);
-        }
+        parseOas30(openApi, rest, pathAsTags);
 
         // gather all types in use
         Set<String> types = new LinkedHashSet<>();
@@ -275,210 +270,106 @@ public class RestOpenApiReader {
         // setup root security node if necessary
         List<SecurityDefinition> securityRequirements = rest.getSecurityRequirements();
         securityRequirements.forEach(requirement -> {
-            OasSecurityRequirement oasRequirement = openApi.createSecurityRequirement();
+            SecurityRequirement oasRequirement = new SecurityRequirement();
             List<String> scopes;
             if (requirement.getScopes() == null || requirement.getScopes().trim().isEmpty()) {
                 scopes = Collections.emptyList();
             } else {
                 scopes = Arrays.asList(requirement.getScopes().trim().split("\\s*,\\s*"));
             }
-            oasRequirement.addSecurityRequirementItem(requirement.getKey(), scopes);
-            openApi.addSecurityRequirement(oasRequirement);
+            oasRequirement.addList(requirement.getKey(), scopes);
+            openApi.addSecurityItem(oasRequirement);
         });
     }
 
-    private void parseOas30(Oas30Document openApi, RestDefinition rest, String[] pathAsTags) {
+    private void parseOas30(OpenAPI openApi, RestDefinition rest, String[] pathAsTags) {
         String summary = rest.getDescriptionText();
 
         for (String tag : pathAsTags) {
             // add rest as tag
-            openApi.addTag(tag, summary);
+            openApi.addTagsItem(new Tag().name(tag).description(summary));
         }
 
         // setup security definitions
         RestSecuritiesDefinition sd = rest.getSecurityDefinitions();
-        if (sd != null && !sd.getSecurityDefinitions().isEmpty() && openApi.components == null) {
-            openApi.components = openApi
-                    .createComponents();
+        if (sd != null && !sd.getSecurityDefinitions().isEmpty() && openApi.getComponents() == null) {
+            openApi.setComponents(new Components());
         }
         if (sd != null) {
             for (RestSecurityDefinition def : sd.getSecurityDefinitions()) {
                 if (def instanceof BasicAuthDefinition) {
-                    Oas30SecurityScheme auth = openApi.components
-                            .createSecurityScheme(def.getKey());
-                    auth.type = "http";
-                    auth.scheme = "basic";
-                    auth.description = def.getDescription();
-                    openApi.components.addSecurityScheme(def.getKey(), auth);
+                    SecurityScheme auth = new SecurityScheme().type(SecurityScheme.Type.HTTP)
+                            .name("basic").description(def.getDescription());
+                    openApi.getComponents().addSecuritySchemes(def.getKey(), auth);
                 } else if (def instanceof BearerTokenDefinition) {
-                    Oas30SecurityScheme auth = openApi.components.createSecurityScheme(def.getKey());
-                    auth.type = "http";
-                    auth.scheme = "bearer";
-                    auth.description = def.getDescription();
-                    auth.bearerFormat = ((BearerTokenDefinition) def).getFormat();
-                    openApi.components.addSecurityScheme(def.getKey(), auth);
+                    SecurityScheme auth = new SecurityScheme().type(SecurityScheme.Type.HTTP)
+                            .name("bearer").description(def.getDescription())
+                            .bearerFormat(((BearerTokenDefinition) def).getFormat());
+                    openApi.getComponents().addSecuritySchemes(def.getKey(), auth);
                 } else if (def instanceof ApiKeyDefinition) {
                     ApiKeyDefinition rs = (ApiKeyDefinition) def;
-                    Oas30SecurityScheme auth = openApi.components
-                            .createSecurityScheme(def.getKey());
-                    auth.type = "apiKey";
-                    auth.description = rs.getDescription();
-                    auth.name = rs.getName();
+                    SecurityScheme auth = new SecurityScheme().type(SecurityScheme.Type.APIKEY)
+                            .name(rs.getName()).description(def.getDescription());
+
                     if (rs.getInHeader() != null && Boolean.parseBoolean(rs.getInHeader())) {
-                        auth.in = "header";
+                        auth.setIn(SecurityScheme.In.HEADER);
                     } else if (rs.getInQuery() != null && Boolean.parseBoolean(rs.getInQuery())) {
-                        auth.in = "query";
+                        auth.setIn(SecurityScheme.In.QUERY);
                     } else if (rs.getInCookie() != null && Boolean.parseBoolean(rs.getInCookie())) {
-                        auth.in = "cookie";
+                        auth.setIn(SecurityScheme.In.COOKIE);
                     } else {
                         throw new IllegalStateException("No API Key location specified.");
                     }
-                    openApi.components.addSecurityScheme(def.getKey(), auth);
+                    openApi.getComponents().addSecuritySchemes(def.getKey(), auth);
                 } else if (def instanceof OAuth2Definition) {
                     OAuth2Definition rs = (OAuth2Definition) def;
 
-                    Oas30SecurityScheme auth = openApi.components
-                            .createSecurityScheme(def.getKey());
-                    auth.type = "oauth2";
-                    auth.description = rs.getDescription();
+                    SecurityScheme auth = new SecurityScheme().type(SecurityScheme.Type.OAUTH2)
+                            .description(def.getDescription());
                     String flow = rs.getFlow();
                     if (flow == null) {
                         flow = inferOauthFlow(rs);
                     }
-                    OAuthFlow oauthFlow;
-                    if (auth.flows == null) {
-                        auth.flows = auth.createOAuthFlows();
-                    }
+                    OAuthFlows oauthFlows = new OAuthFlows();
+                    auth.setFlows(oauthFlows);
+                    OAuthFlow oauthFlow = new OAuthFlow();
                     switch (flow) {
                         case "authorizationCode":
                         case "accessCode":
-                            AuthorizationCodeOAuthFlow authorizationCodeOAuthFlow
-                                    = auth.flows.createAuthorizationCodeOAuthFlow();
-                            oauthFlow = authorizationCodeOAuthFlow;
-                            auth.flows.authorizationCode = authorizationCodeOAuthFlow;
+                            oauthFlows.setAuthorizationCode(oauthFlow);
                             break;
                         case "implicit":
-                            ImplicitOAuthFlow implicitOAuthFlow = auth.flows.createImplicitOAuthFlow();
-                            oauthFlow = implicitOAuthFlow;
-                            auth.flows.implicit = implicitOAuthFlow;
+                            oauthFlows.setImplicit(oauthFlow);
                             break;
                         case "clientCredentials":
                         case "application":
-                            ClientCredentialsOAuthFlow clientCredentialsOAuthFlow
-                                    = auth.flows.createClientCredentialsOAuthFlow();
-                            oauthFlow = clientCredentialsOAuthFlow;
-                            auth.flows.clientCredentials = clientCredentialsOAuthFlow;
+                            oauthFlows.setClientCredentials(oauthFlow);
                             break;
                         case "password":
-                            PasswordOAuthFlow passwordOAuthFlow = auth.flows.createPasswordOAuthFlow();
-                            oauthFlow = passwordOAuthFlow;
-                            auth.flows.password = passwordOAuthFlow;
+                            oauthFlows.setPassword(oauthFlow);
                             break;
                         default:
                             throw new IllegalStateException("Invalid OAuth flow '" + flow + "' specified");
                     }
-                    oauthFlow.authorizationUrl = rs.getAuthorizationUrl();
-                    oauthFlow.tokenUrl = rs.getTokenUrl();
-                    oauthFlow.refreshUrl = rs.getRefreshUrl();
-                    for (RestPropertyDefinition scope : rs.getScopes()) {
-                        oauthFlow.addScope(scope.getKey(), scope.getValue());
-                    }
-
-                    openApi.components.addSecurityScheme(def.getKey(), auth);
-                } else if (def instanceof MutualTLSDefinition) {
-                    Oas30SecurityScheme auth = openApi.components.createSecurityScheme(def.getKey());
-                    auth.type = "mutualTLS";
-                    openApi.components.addSecurityScheme(def.getKey(), auth);
-                } else if (def instanceof OpenIdConnectDefinition) {
-                    Oas30SecurityScheme auth = openApi.components.createSecurityScheme(def.getKey());
-                    auth.type = "openIdConnect";
-                    auth.openIdConnectUrl = ((OpenIdConnectDefinition) def).getUrl();
-                    openApi.components.addSecurityScheme(def.getKey(), auth);
-                }
-            }
-        }
-    }
-
-    private void parseOas20(CamelContext camelContext, Oas20Document openApi, RestDefinition rest, String[] pathAsTags) {
-        String summary = getValue(camelContext, rest.getDescriptionText());
-
-        for (String tag : pathAsTags) {
-            // add rest as tag
-            openApi.addTag(tag, summary);
-        }
-
-        // setup security definitions
-        RestSecuritiesDefinition sd = rest.getSecurityDefinitions();
-        if (sd != null && !sd.getSecurityDefinitions().isEmpty() && openApi.securityDefinitions == null) {
-            openApi.securityDefinitions = openApi.createSecurityDefinitions();
-        }
-        if (sd != null) {
-            for (RestSecurityDefinition def : sd.getSecurityDefinitions()) {
-                if (def instanceof BasicAuthDefinition) {
-                    Oas20SecurityScheme auth
-                            = openApi.securityDefinitions.createSecurityScheme(getValue(camelContext, def.getKey()));
-                    auth.type = "basicAuth";
-                    auth.description = getValue(camelContext, def.getDescription());
-                    openApi.securityDefinitions.addSecurityScheme(getValue(camelContext, def.getKey()), auth);
-                } else if (def instanceof BearerTokenDefinition) {
-                    throw new IllegalStateException("OpenAPI 2.0 does not support bearer token security schemes.");
-                } else if (def instanceof ApiKeyDefinition) {
-                    ApiKeyDefinition rs = (ApiKeyDefinition) def;
-                    Oas20SecurityScheme auth
-                            = openApi.securityDefinitions.createSecurityScheme(getValue(camelContext, def.getKey()));
-                    auth.type = "apiKey";
-                    auth.description = getValue(camelContext, rs.getDescription());
-                    auth.name = getValue(camelContext, rs.getName());
-                    if (rs.getInHeader() != null && CamelContextHelper.parseBoolean(camelContext, rs.getInHeader())) {
-                        auth.in = "header";
-                    } else if (rs.getInQuery() != null && CamelContextHelper.parseBoolean(camelContext, rs.getInQuery())) {
-                        auth.in = "query";
-                    } else {
-                        throw new IllegalStateException("Invalid 'in' value for API Key security scheme");
-                    }
-                    openApi.securityDefinitions.addSecurityScheme(getValue(camelContext, def.getKey()), auth);
-                } else if (def instanceof OAuth2Definition) {
-                    OAuth2Definition rs = (OAuth2Definition) def;
-                    Oas20SecurityScheme auth
-                            = openApi.securityDefinitions.createSecurityScheme(getValue(camelContext, def.getKey()));
-                    auth.type = "oauth2";
-                    auth.description = getValue(camelContext, rs.getDescription());
-                    String flow = rs.getFlow();
-                    if (flow == null) {
-                        flow = inferOauthFlow(rs);
-                    }
-                    switch (flow) {
-                        case "accessCode":
-                        case "authorizationCode":
-                            auth.flow = "accessCode";
-                            break;
-                        case "application":
-                        case "clientCredentials":
-                            auth.flow = "application";
-                            break;
-                        case "password":
-                        case "implicit":
-                            auth.flow = flow;
-                            break;
-                        default:
-                            throw new IllegalStateException("Invalid OAuth flow `" + flow + "'");
-                    }
-                    auth.authorizationUrl = getValue(camelContext, rs.getAuthorizationUrl());
-                    auth.tokenUrl = getValue(camelContext, rs.getTokenUrl());
-                    if (!rs.getScopes().isEmpty() && auth.scopes == null) {
-                        auth.scopes = auth.createScopes();
-                    }
-                    for (RestPropertyDefinition scope : rs.getScopes()) {
-                        auth.scopes.addScope(getValue(camelContext, scope.getKey()), getValue(camelContext, scope.getValue()));
-                    }
-                    if (openApi.securityDefinitions == null) {
-                        openApi.securityDefinitions = openApi.createSecurityDefinitions();
+                    oauthFlow.setAuthorizationUrl(rs.getAuthorizationUrl());
+                    oauthFlow.setTokenUrl(rs.getTokenUrl());
+                    oauthFlow.setRefreshUrl(rs.getRefreshUrl());
+                    if (!rs.getScopes().isEmpty()) {
+                        oauthFlow.setScopes(new Scopes());
+                        for (RestPropertyDefinition scope : rs.getScopes()) {
+                            oauthFlow.getScopes().addString(scope.getKey(), scope.getValue());
+                        }
                     }
-                    openApi.securityDefinitions.addSecurityScheme(getValue(camelContext, def.getKey()), auth);
+                    openApi.getComponents().addSecuritySchemes(def.getKey(), auth);
                 } else if (def instanceof MutualTLSDefinition) {
-                    throw new IllegalStateException("Mutual TLS security scheme is not supported");
+                    SecurityScheme auth = new SecurityScheme().type(SecurityScheme.Type.MUTUALTLS)
+                            .description(def.getDescription());
+                    openApi.getComponents().addSecuritySchemes(def.getKey(), auth);
                 } else if (def instanceof OpenIdConnectDefinition) {
-                    throw new IllegalStateException("OpenId Connect security scheme is not supported");
+                    SecurityScheme auth = new SecurityScheme().type(SecurityScheme.Type.OPENIDCONNECT)
+                            .description(def.getDescription());
+                    auth.setOpenIdConnectUrl(((OpenIdConnectDefinition) def).getUrl());
+                    openApi.getComponents().addSecuritySchemes(def.getKey(), auth);
                 }
             }
         }
@@ -495,7 +386,7 @@ public class RestOpenApiReader {
     }
 
     private void doParseVerbs(
-            CamelContext camelContext, OasDocument openApi, RestDefinition rest, String camelContextId,
+            CamelContext camelContext, OpenAPI openApi, RestDefinition rest, String camelContextId,
             List<VerbDefinition> verbs, String[] pathAsTags, BeanConfig config) {
 
         String basePath = buildBasePath(camelContext, rest);
@@ -518,21 +409,18 @@ public class RestOpenApiReader {
             // operation path is a key
             String opPath = OpenApiHelper.buildUrl(basePath, getValue(camelContext, verb.getPath()));
 
-            if (openApi.paths == null) {
-                openApi.paths = openApi.createPaths();
+            if (openApi.getPaths() == null) {
+                openApi.paths(new Paths());
             }
-            OasPathItem path = openApi.paths.getPathItem(opPath);
+            PathItem path = openApi.getPaths().get(opPath);
             if (path == null) {
-                path = openApi.paths.createPathItem(opPath);
+                path = new PathItem();   //openApi.paths.createPathItem(opPath);
             }
 
-            OasOperation op = path.createOperation(method);
+            Operation op = new Operation(); //path.createOperation(method);
             for (String tag : pathAsTags) {
                 // group in the same tag
-                if (op.tags == null) {
-                    op.tags = new ArrayList<>();
-                }
-                op.tags.add(tag);
+                op.addTagsItem(tag);
             }
 
             // favour ids from verb, rest, route
@@ -545,16 +433,12 @@ public class RestOpenApiReader {
                 verb.idOrCreate(camelContext.getCamelContextExtension().getContextPlugin(NodeIdFactory.class));
                 operationId = verb.getId();
             }
-            op.operationId = operationId;
+            op.setOperationId(operationId);
 
             // add id as vendor extensions
-            Extension extension = op.createExtension();
-            extension.name = "x-camelContextId";
-            extension.value = camelContextId;
-            op.addExtension(extension.name, extension);
-            extension = op.createExtension();
-            op.addExtension(extension.name, extension);
-            path = setPathOperation(path, op, method);
+            op.addExtension("x-camelContextId", camelContextId);
+
+            path.operation(PathItem.HttpMethod.valueOf(method.toUpperCase()), op);
 
             String consumes = getValue(camelContext, verb.getConsumes() != null ? verb.getConsumes() : rest.getConsumes());
             if (consumes == null) {
@@ -566,28 +450,24 @@ public class RestOpenApiReader {
                 produces = config.defaultProduces;
             }
 
-            if (openApi instanceof Oas20Document) {
-                doParseVerbOas20(camelContext, (Oas20Document) openApi, verb, (Oas20Operation) op, consumes, produces);
-            } else if (openApi instanceof Oas30Document) {
-                doParseVerbOas30(camelContext, (Oas30Document) openApi, verb, (Oas30Operation) op, consumes, produces);
-            }
+            doParseVerb(camelContext, openApi, verb, op, consumes, produces);
             // enrich with configured response messages from the rest-dsl
             doParseResponseMessages(camelContext, openApi, verb, op, produces);
 
             // add path
-            openApi.paths.addPathItem(opPath, path);
+            openApi.getPaths().addPathItem(opPath, path);
         }
     }
 
-    private void doParseVerbOas30(
-            CamelContext camelContext, Oas30Document openApi, VerbDefinition verb, Oas30Operation op, String consumes,
+    private void doParseVerb(
+            CamelContext camelContext, OpenAPI openApi, VerbDefinition verb, Operation op, String consumes,
             String produces) {
         if (verb.getDescriptionText() != null) {
-            op.summary = getValue(camelContext, verb.getDescriptionText());
+            op.setSummary(getValue(camelContext, verb.getDescriptionText()));
         }
 
         if ("true".equals(verb.getDeprecated())) {
-            op.deprecated = Boolean.TRUE;
+            op.setDeprecated(Boolean.TRUE);
         }
 
         // security
@@ -598,501 +478,238 @@ public class RestOpenApiReader {
                     scopes.add(scope);
                 }
             }
-            SecurityRequirement securityRequirement = op.createSecurityRequirement();
-            securityRequirement.addSecurityRequirementItem(getValue(camelContext, sd.getKey()), scopes);
-            op.addSecurityRequirement(securityRequirement);
+            SecurityRequirement securityRequirement = new SecurityRequirement(); //op.createSecurityRequirement();
+            securityRequirement.addList(getValue(camelContext, sd.getKey()), scopes);
+            op.addSecurityItem(securityRequirement);
         }
 
         for (ParamDefinition param : verb.getParams()) {
-            OasParameter parameter = null;
-            if (param.getType().equals(RestParamType.body)) {
-                parameter = op.createParameter();
-                parameter.in = "body";
-            } else if (param.getType().equals(RestParamType.formData)) {
-                parameter = op.createParameter();
-                parameter.in = "formData";
-            } else if (param.getType().equals(RestParamType.header)) {
-                parameter = op.createParameter();
-                parameter.in = "header";
-            } else if (param.getType().equals(RestParamType.path)) {
-                parameter = op.createParameter();
-                parameter.in = "path";
-            } else if (param.getType().equals(RestParamType.query)) {
-                parameter = op.createParameter();
-                parameter.in = "query";
-            }
+            Parameter parameter = new Parameter().in(param.getType().name());
 
             if (parameter != null) {
-                parameter.name = getValue(camelContext, param.getName());
+                parameter.setName(getValue(camelContext, param.getName()));
                 if (org.apache.camel.util.ObjectHelper.isNotEmpty(param.getDescription())) {
-                    parameter.description = getValue(camelContext, param.getDescription());
+                    parameter.setDescription(getValue(camelContext, param.getDescription()));
                 }
-                parameter.required = param.getRequired();
+                parameter.setRequired(param.getRequired());
 
                 // set type on parameter
-                if (!parameter.in.equals("body")) {
-                    Oas30Parameter parameter30 = (Oas30Parameter) parameter;
-                    Oas30Schema oas30Schema = null;
+                if (!"body".equals(parameter.getIn())) {
+                    Schema schema = new Schema();
                     final boolean isArray = getValue(camelContext, param.getDataType()).equalsIgnoreCase("array");
                     final List<String> allowableValues = getValue(camelContext, param.getAllowableValuesAsStringList());
                     final boolean hasAllowableValues = allowableValues != null && !allowableValues.isEmpty();
                     if (param.getDataType() != null) {
-                        parameter30.schema = parameter30.createSchema();
-                        oas30Schema = (Oas30Schema) parameter30.schema;
-                        oas30Schema.type = getValue(camelContext, param.getDataType());
+                        parameter.setSchema(schema);
+                        schema.setType(getValue(camelContext, param.getDataType()));
                         if (param.getDataFormat() != null) {
-                            oas30Schema.format = getValue(camelContext, param.getDataFormat());
+                            schema.setFormat(getValue(camelContext, param.getDataFormat()));
                         }
                         if (isArray) {
                             String arrayType = getValue(camelContext, param.getArrayType());
                             if (arrayType != null) {
                                 if (arrayType.equalsIgnoreCase("string")) {
-                                    defineSchemas(parameter30, allowableValues, String.class);
+                                    defineSchemas(parameter, allowableValues, String.class);
                                 }
                                 if (arrayType.equalsIgnoreCase("int") || arrayType.equalsIgnoreCase("integer")) {
-                                    defineSchemas(parameter30, allowableValues, Integer.class);
+                                    defineSchemas(parameter, allowableValues, Integer.class);
                                 }
                                 if (arrayType.equalsIgnoreCase("long")) {
-                                    defineSchemas(parameter30, allowableValues, Long.class);
+                                    defineSchemas(parameter, allowableValues, Long.class);
                                 }
                                 if (arrayType.equalsIgnoreCase("float")) {
-                                    defineSchemas(parameter30, allowableValues, Float.class);
+                                    defineSchemas(parameter, allowableValues, Float.class);
                                 }
                                 if (arrayType.equalsIgnoreCase("double")) {
-                                    defineSchemas(parameter30, allowableValues, Double.class);
+                                    defineSchemas(parameter, allowableValues, Double.class);
                                 }
                                 if (arrayType.equalsIgnoreCase("boolean")) {
-                                    defineSchemas(parameter30, allowableValues, Boolean.class);
+                                    defineSchemas(parameter, allowableValues, Boolean.class);
                                 }
                                 if (arrayType.equalsIgnoreCase("byte")) {
-                                    defineSchemas(parameter30, allowableValues, ByteArraySchema.class);
+                                    defineSchemas(parameter, allowableValues, ByteArraySchema.class);
                                 }
                                 if (arrayType.equalsIgnoreCase("binary")) {
-                                    defineSchemas(parameter30, allowableValues, BinarySchema.class);
+                                    defineSchemas(parameter, allowableValues, BinarySchema.class);
                                 }
                                 if (arrayType.equalsIgnoreCase("date")) {
-                                    defineSchemas(parameter30, allowableValues, DateSchema.class);
+                                    defineSchemas(parameter, allowableValues, DateSchema.class);
                                 }
                                 if (arrayType.equalsIgnoreCase("date-time")) {
-                                    defineSchemas(parameter30, allowableValues, DateTimeSchema.class);
+                                    defineSchemas(parameter, allowableValues, DateTimeSchema.class);
                                 }
                                 if (arrayType.equalsIgnoreCase("password")) {
-                                    defineSchemas(parameter30, allowableValues, PasswordSchema.class);
+                                    defineSchemas(parameter, allowableValues, PasswordSchema.class);
                                 }
                             }
                         }
                     }
                     if (param.getCollectionFormat() != null) {
-                        parameter30.style = getValue(camelContext, param.getCollectionFormat().name());
+                        parameter.setStyle(convertToOpenApiStyle(getValue(camelContext, param.getCollectionFormat().name())));
                     }
                     if (hasAllowableValues && !isArray) {
-                        oas30Schema.enum_ = allowableValues;
+                        schema.setEnum(allowableValues);
                     }
 
                     // set default value on parameter
                     if (org.apache.camel.util.ObjectHelper.isNotEmpty(param.getDefaultValue())) {
-                        oas30Schema.default_ = getValue(camelContext, param.getDefaultValue());
+                        schema.setDefault(getValue(camelContext, param.getDefaultValue()));
                     }
                     // add examples
                     if (param.getExamples() != null && !param.getExamples().isEmpty()) {
-                        // we can only set one example on the parameter
-                        Extension exampleExtension = parameter30.createExtension();
-                        boolean emptyKey = param.getExamples().get(0).getKey().length() == 0;
-                        if (emptyKey) {
-                            exampleExtension.name = "x-example";
-                            exampleExtension.value = getValue(camelContext, param.getExamples().get(0).getValue());
-                            parameter30.addExtension("x-example", exampleExtension);
-                        } else {
-                            Map<String, String> exampleValue = new LinkedHashMap<>();
-                            exampleValue.put(getValue(camelContext, param.getExamples().get(0).getKey()),
-                                    getValue(camelContext, param.getExamples().get(0).getValue()));
-                            exampleExtension.name = "x-examples";
-                            exampleExtension.value = exampleValue;
-                            parameter30.addExtension("x-examples", exampleExtension);
+                        // Examples can be added with a key or a single one with no key
+                        for (RestPropertyDefinition example : param.getExamples()) {
+                            if (example.getKey().isEmpty()) {
+                                if (parameter.getExample() != null) {
+                                    LOG.warn("The parameter already has an example with no key!");
+                                }
+                                parameter.setExample(example.getValue());
+                            } else {
+                                parameter.addExample(example.getKey(), new Example().value(example.getValue()));
+                            }
                         }
                     }
+                    op.addParametersItem(parameter);
                 }
 
-                // set schema on body parameter
-                if (parameter.in.equals("body")) {
-                    Oas30Parameter bp = (Oas30Parameter) parameter;
+                // In OpenAPI 3x, body or form parameters are replaced by requestBody
+                if (parameter.getIn().equals("body")) {
+                    RequestBody reqBody = new RequestBody().content(new Content());
+                    reqBody.setRequired(param.getRequired());
+                    reqBody.setDescription(getValue(camelContext, param.getDescription()));
+                    op.setRequestBody(reqBody);
                     String type = getValue(camelContext, param.getDataType() != null ? param.getDataType() : verb.getType());
+                    Schema bodySchema = null;
                     if (type != null) {
                         if (type.endsWith("[]")) {
                             type = type.substring(0, type.length() - 2);
 
-                            OasSchema arrayModel = (Oas30Schema) bp.createSchema();
-                            arrayModel = modelTypeAsProperty(type, openApi, arrayModel);
-                            bp.schema = arrayModel;
+                            //                            Schema arrayModel = (Oas30Schema) bp.createSchema();
+                            bodySchema = modelTypeAsProperty(type, openApi);
 
                         } else {
                             String ref = modelTypeAsRef(type, openApi);
                             if (ref != null) {
-                                Oas30Schema refModel = (Oas30Schema) bp.createSchema();
-                                refModel.$ref = OAS30_SCHEMA_DEFINITION_PREFIX + ref;
-                                bp.schema = refModel;
+                                bodySchema = new Schema().$ref(OAS30_SCHEMA_DEFINITION_PREFIX + ref);
                             } else {
-                                OasSchema model = (Oas30Schema) bp.createSchema();
-                                model = modelTypeAsProperty(type, openApi, model);
-                                bp.schema = model;
+                                bodySchema = modelTypeAsProperty(type, openApi);
                             }
                         }
                     }
 
                     if (consumes != null) {
                         String[] parts = consumes.split(",");
-                        if (op.requestBody == null) {
-                            op.requestBody = op.createRequestBody();
-                            op.requestBody.required = param.getRequired();
-                            op.requestBody.description = getValue(camelContext, param.getDescription());
-                        }
                         for (String part : parts) {
-                            Oas30MediaType mediaType = op.requestBody.createMediaType(part);
-                            mediaType.schema = mediaType.createSchema();
-                            mediaType.schema.$ref = bp.schema.$ref;
-                            op.requestBody.addMediaType(part, mediaType);
-                        }
-                    }
-
-                    // add examples
-                    if (param.getExamples() != null) {
-                        Extension exampleExtension = op.requestBody.createExtension();
-                        boolean emptyKey = param.getExamples().get(0).getKey().length() == 0;
-                        if (emptyKey) {
-                            exampleExtension.name = "x-example";
-                            exampleExtension.value = getValue(camelContext, param.getExamples().get(0).getValue());
-                            op.requestBody.addExtension("x-example", exampleExtension);
-                        } else {
-                            Map<String, String> exampleValue = new LinkedHashMap<>();
-                            exampleValue.put(getValue(camelContext, param.getExamples().get(0).getKey()),
-                                    getValue(camelContext, param.getExamples().get(0).getValue()));
-                            exampleExtension.name = "x-examples";
-                            exampleExtension.value = exampleValue;
-                            op.requestBody.addExtension("x-examples", exampleExtension);
+                            MediaType mediaType = new MediaType().schema(bodySchema);
+                            if (param.getExamples() != null) {
+                                for (RestPropertyDefinition example : param.getExamples()) {
+                                    if (part.equals(example.getKey())) {
+                                        mediaType.setExample(example.getValue());
+                                    }
+                                    // TODO: Check for non-matched or empty key
+                                }
+                            }
+                            reqBody.getContent().addMediaType(part, mediaType);
                         }
                     }
-                    parameter = null;
                 }
 
-                op.addParameter(parameter);
+                //                op.addParameter(parameter);
             }
         }
 
         // clear parameters if its empty
         if (op.getParameters() != null && op.getParameters().isEmpty()) {
-            op.parameters.clear();
+            //            op.parameters.clear();
+            op.setParameters(null); // Is this necessary?
         }
 
         // if we have an out type then set that as response message
         if (verb.getOutType() != null) {
-            if (op.responses == null) {
-                op.responses = op.createResponses();
+            if (op.getResponses() == null) {
+                op.setResponses(new ApiResponses());
             }
-            Oas30Response response = (Oas30Response) op.responses.createResponse("200");
+
             String[] parts;
             if (produces != null) {
                 parts = produces.split(",");
                 for (String produce : parts) {
-                    Oas30MediaType contentType = response.createMediaType(produce);
-                    response.addMediaType(produce, contentType);
-                    OasSchema model = contentType.createSchema();
-                    model = modelTypeAsProperty(getValue(camelContext, verb.getOutType()), openApi, model);
-                    contentType.schema = (Oas30Schema) model;
-                    response.description = "Output type";
-                    op.responses.addResponse("200", response);
+                    ApiResponse response = new ApiResponse().description("Output type"); // ??
+                    Content responseContent = new Content();
+                    MediaType contentType = new MediaType();
+                    responseContent.addMediaType(produce, contentType);
+                    Schema model = modelTypeAsProperty(getValue(camelContext, verb.getOutType()), openApi);
+                    contentType.setSchema(model);
+                    response.setContent(responseContent);
+                    // response.description = "Output type";
+                    //                    op.responses.addResponse("200", response);
+                    op.getResponses().addApiResponse("200", response);
                 }
             }
         }
 
     }
 
-    private void doParseVerbOas20(
-            CamelContext camelContext, Oas20Document openApi, VerbDefinition verb, Oas20Operation op, String consumes,
-            String produces) {
-
-        if ("true".equals(verb.getDeprecated())) {
-            op.deprecated = Boolean.TRUE;
-        }
-
-        if (verb.getDescriptionText() != null) {
-            op.summary = getValue(camelContext, verb.getDescriptionText());
-        }
-
-        // security
-        for (SecurityDefinition sd : verb.getSecurity()) {
-            List<String> scopes = new ArrayList<>();
-            if (sd.getScopes() != null) {
-                for (String scope : ObjectHelper.createIterable(getValue(camelContext, sd.getScopes()))) {
-                    scopes.add(scope);
-                }
-            }
-            SecurityRequirement securityRequirement = op.createSecurityRequirement();
-            securityRequirement.addSecurityRequirementItem(getValue(camelContext, sd.getKey()), scopes);
-            op.addSecurityRequirement(securityRequirement);
-        }
-
-        for (ParamDefinition param : verb.getParams()) {
-            OasParameter parameter = null;
-            if (param.getType().equals(RestParamType.body)) {
-                parameter = op.createParameter();
-                parameter.in = "body";
-            } else if (param.getType().equals(RestParamType.formData)) {
-                parameter = op.createParameter();
-                parameter.in = "formData";
-            } else if (param.getType().equals(RestParamType.header)) {
-                parameter = op.createParameter();
-                parameter.in = "header";
-            } else if (param.getType().equals(RestParamType.path)) {
-                parameter = op.createParameter();
-                parameter.in = "path";
-            } else if (param.getType().equals(RestParamType.query)) {
-                parameter = op.createParameter();
-                parameter.in = "query";
-            }
-
-            if (parameter != null) {
-                parameter.name = getValue(camelContext, param.getName());
-                if (org.apache.camel.util.ObjectHelper.isNotEmpty(param.getDescription())) {
-                    parameter.description = getValue(camelContext, param.getDescription());
-                }
-                parameter.required = param.getRequired();
-
-                // set type on parameter
-                if (!parameter.in.equals("body")) {
-
-                    Oas20Parameter serializableParameter = (Oas20Parameter) parameter;
-                    final boolean isArray = getValue(camelContext, param.getDataType()).equalsIgnoreCase("array");
-                    final List<String> allowableValues = getValue(camelContext, param.getAllowableValuesAsStringList());
-                    final boolean hasAllowableValues = allowableValues != null && !allowableValues.isEmpty();
-                    if (param.getDataType() != null) {
-                        serializableParameter.type = param.getDataType();
-                        if (param.getDataFormat() != null) {
-                            serializableParameter.format = getValue(camelContext, param.getDataFormat());
-                        }
-                        if (isArray) {
-                            if (param.getArrayType() != null) {
-                                String arrayType = getValue(camelContext, param.getArrayType());
-                                if (arrayType.equalsIgnoreCase("string")) {
-                                    defineItems(serializableParameter, allowableValues, new Oas20Items(), String.class);
-                                }
-                                if (arrayType.equalsIgnoreCase("int") || arrayType.equalsIgnoreCase("integer")) {
-                                    defineItems(serializableParameter, allowableValues, new Oas20Items(), Integer.class);
-                                }
-                                if (arrayType.equalsIgnoreCase("long")) {
-                                    defineItems(serializableParameter, allowableValues, new Oas20Items(), Long.class);
-                                }
-                                if (arrayType.equalsIgnoreCase("float")) {
-                                    defineItems(serializableParameter, allowableValues, new Oas20Items(), Float.class);
-                                }
-                                if (arrayType.equalsIgnoreCase("double")) {
-                                    defineItems(serializableParameter, allowableValues, new Oas20Items(), Double.class);
-                                }
-                                if (arrayType.equalsIgnoreCase("boolean")) {
-                                    defineItems(serializableParameter, allowableValues, new Oas20Items(), Boolean.class);
-                                }
-                            }
-                        }
-                    }
-                    if (param.getCollectionFormat() != null) {
-                        serializableParameter.collectionFormat = param.getCollectionFormat().name();
-                    }
-                    if (hasAllowableValues && !isArray) {
-                        serializableParameter.enum_ = allowableValues;
-                    }
-                    // set default value on parameter
-                    if (org.apache.camel.util.ObjectHelper.isNotEmpty(param.getDefaultValue())) {
-                        serializableParameter.default_ = getValue(camelContext, param.getDefaultValue());
-                    }
-                    // add examples
-                    if (param.getExamples() != null && !param.getExamples().isEmpty()) {
-                        // we can only set one example on the parameter
-                        Extension exampleExtension = serializableParameter.createExtension();
-                        boolean emptyKey = param.getExamples().get(0).getKey().length() == 0;
-                        if (emptyKey) {
-                            exampleExtension.name = "x-example";
-                            exampleExtension.value = getValue(camelContext, param.getExamples().get(0).getValue());
-                            serializableParameter.addExtension("x-example", exampleExtension);
-                        } else {
-                            Map<String, String> exampleValue = new LinkedHashMap<>();
-                            exampleValue.put(getValue(camelContext, param.getExamples().get(0).getKey()),
-                                    getValue(camelContext, param.getExamples().get(0).getValue()));
-                            exampleExtension.name = "x-examples";
-                            exampleExtension.value = exampleValue;
-                            serializableParameter.addExtension("x-examples", exampleExtension);
-                        }
-                    }
-                }
-
-                // set schema on body parameter
-                if (parameter.in.equals("body")) {
-                    if (consumes != null) {
-                        String[] parts = consumes.split(",");
-                        if (op.consumes == null) {
-                            op.consumes = new ArrayList<>();
-                        }
-                        op.consumes.addAll(Arrays.asList(parts));
-                    }
-
-                    Oas20Parameter bp = (Oas20Parameter) parameter;
-                    String type = getValue(camelContext, param.getDataType() != null ? param.getDataType() : verb.getType());
-                    if (type != null) {
-                        if (type.endsWith("[]")) {
-                            type = type.substring(0, type.length() - 2);
-                            OasSchema arrayModel = (Oas20Schema) bp.createSchema();
-                            arrayModel = modelTypeAsProperty(type, openApi, arrayModel);
-                            bp.schema = arrayModel;
-                        } else {
-                            String ref = modelTypeAsRef(type, openApi);
-                            if (ref != null) {
-                                Oas20Schema refModel = (Oas20Schema) bp.createSchema();
-                                refModel.$ref = OAS20_SCHEMA_DEFINITION_PREFIX + ref;
-                                bp.schema = refModel;
-                            } else {
-                                OasSchema model = (Oas20Schema) bp.createSchema();
-                                model = modelTypeAsProperty(type, openApi, model);
-                                bp.schema = model;
-                            }
-                        }
-                    }
-
-                    // add examples
-                    if (param.getExamples() != null) {
-                        Extension exampleExtension = bp.createExtension();
-                        boolean emptyKey = param.getExamples().get(0).getKey().length() == 0;
-                        if (emptyKey) {
-                            exampleExtension.name = "x-example";
-                            exampleExtension.value = getValue(camelContext, param.getExamples().get(0).getValue());
-                            bp.addExtension("x-example", exampleExtension);
-                        } else {
-                            Map<String, String> exampleValue = new LinkedHashMap<>();
-                            exampleValue.put(getValue(camelContext, param.getExamples().get(0).getKey()),
-                                    getValue(camelContext, param.getExamples().get(0).getValue()));
-                            exampleExtension.name = "x-examples";
-                            exampleExtension.value = exampleValue;
-                            bp.addExtension("x-examples", exampleExtension);
-                        }
-                    }
-                }
-                op.addParameter(parameter);
-            }
-        }
-
-        // clear parameters if its empty
-        if (op.getParameters() != null && op.getParameters().isEmpty()) {
-            op.parameters.clear();
-        }
-
-        // if we have an out type then set that as response message
-        if (verb.getOutType() != null) {
-            if (produces != null) {
-                String[] parts = produces.split(",");
-                if (op.produces == null) {
-                    op.produces = new ArrayList<>();
-                }
-                op.produces.addAll(Arrays.asList(parts));
-            }
-
-            if (op.responses == null) {
-                op.responses = op.createResponses();
-            }
-            Oas20Response response = (Oas20Response) op.responses.createResponse("200");
-            OasSchema model = response.createSchema();
-            model = modelTypeAsProperty(getValue(camelContext, verb.getOutType()), openApi, model);
-
-            response.schema = (Oas20Schema) model;
-            response.description = "Output type";
-            op.responses.addResponse("200", response);
-        }
-    }
-
-    private OasPathItem setPathOperation(OasPathItem path, OasOperation operation, String method) {
-        if (method.equals("post")) {
-            path.post = operation;
-        } else if (method.equals("get")) {
-            path.get = operation;
-        } else if (method.equals("put")) {
-            path.put = operation;
-        } else if (method.equals("patch")) {
-            path.patch = operation;
-        } else if (method.equals("delete")) {
-            path.delete = operation;
-        } else if (method.equals("head")) {
-            path.head = operation;
-        } else if (method.equals("options")) {
-            path.options = operation;
-        }
-        return path;
-    }
-
-    private static void defineItems(
-            final Oas20Parameter serializableParameter,
-            final List<String> allowableValues, final Oas20Items items,
-            final Class<?> type) {
-        serializableParameter.items = items;
-        if (allowableValues != null && !allowableValues.isEmpty()) {
-            if (String.class.equals(type)) {
-                items.enum_ = allowableValues;
-            } else {
-                convertAndSetItemsEnum(items, allowableValues, type);
-            }
-        } else if (Objects.equals(serializableParameter.type, "array")) {
-            Oas20Items oas20Items = serializableParameter.createItems();
-            oas20Items.type = type.getSimpleName().toLowerCase();
-            serializableParameter.items = oas20Items;
+    private StyleEnum convertToOpenApiStyle(String value) {
+        //Should be a Collection Format name
+        switch (CollectionFormat.valueOf(value)) {
+            case csv:
+                return StyleEnum.FORM;
+            case ssv:
+            case tsv:
+                return StyleEnum.SPACEDELIMITED;
+            case pipes:
+                return StyleEnum.PIPEDELIMITED;
+            case multi:
+                return StyleEnum.DEEPOBJECT;
+            default:
+                return null;
         }
     }
 
     private static void defineSchemas(
-            final Oas30Parameter serializableParameter,
+            final Parameter serializableParameter,
             final List<String> allowableValues,
             final Class<?> type) {
+        Schema parameterSchema = serializableParameter.getSchema();
         if (allowableValues != null && !allowableValues.isEmpty()) {
             if (String.class.equals(type)) {
-                ((Oas30Schema) serializableParameter.schema).enum_ = allowableValues;
+                parameterSchema.setEnum(allowableValues);
             } else {
-                convertAndSetItemsEnum(serializableParameter.schema, allowableValues, type);
+                convertAndSetItemsEnum(parameterSchema, allowableValues, type);
             }
-        } else if (Objects.equals(((Oas30Schema) serializableParameter.schema).type, "array")) {
-            Oas30Schema parameterSchema = (Oas30Schema) serializableParameter.schema;
-            OasSchema itemsSchema = parameterSchema.createItemsSchema();
+        } else if (Objects.equals(parameterSchema.getType(), "array")) {
+
+            Schema<?> itemsSchema = null;
 
             if (Integer.class.equals(type)) {
-                itemsSchema.type = "number";
-                itemsSchema.format = "int32";
+                itemsSchema = new IntegerSchema();
             } else if (Long.class.equals(type)) {
-                itemsSchema.type = "number";
-                itemsSchema.format = "int64";
+                itemsSchema = new IntegerSchema().format("int64");
             } else if (Float.class.equals(type)) {
-                itemsSchema.type = "number";
-                itemsSchema.format = "float";
+                itemsSchema = new NumberSchema().format("float");
             } else if (Double.class.equals(type)) {
-                itemsSchema.type = "number";
-                itemsSchema.format = "double";
+                itemsSchema = new NumberSchema().format("double");
             } else if (ByteArraySchema.class.equals(type)) {
-                itemsSchema.type = "string";
-                itemsSchema.format = "byte";
+                itemsSchema = new ByteArraySchema();
             } else if (BinarySchema.class.equals(type)) {
-                itemsSchema.type = "string";
-                itemsSchema.format = "binary";
+                itemsSchema = new BinarySchema();
             } else if (Date.class.equals(type)) {
-                itemsSchema.type = "string";
-                itemsSchema.format = "date";
+                itemsSchema = new DateSchema();
             } else if (DateTimeSchema.class.equals(type)) {
-                itemsSchema.type = "string";
-                itemsSchema.format = "date-time";
+                itemsSchema = new DateTimeSchema();
             } else if (PasswordSchema.class.equals(type)) {
-                itemsSchema.type = "string";
-                itemsSchema.format = "password";
+                itemsSchema = new PasswordSchema();
             } else {
-                itemsSchema.type = "string";
+                itemsSchema = new StringSchema();
             }
 
-            parameterSchema.items = itemsSchema;
+            parameterSchema.setItems(itemsSchema);
         }
     }
 
     private static void convertAndSetItemsEnum(
-            final ExtensibleNode items, final List<String> allowableValues,
+            final Schema items, final List<String> allowableValues,
             final Class<?> type) {
         try {
             final MethodHandle valueOf = publicLookup().findStatic(type, "valueOf",
@@ -1117,52 +734,46 @@ public class RestOpenApiReader {
     }
 
     private void doParseResponseMessages(
-            CamelContext camelContext, OasDocument openApi, VerbDefinition verb, OasOperation op, String produces) {
-        if (op.responses == null) {
-            op.responses = op.createResponses();
+            CamelContext camelContext, OpenAPI openApi, VerbDefinition verb, Operation op, String produces) {
+        if (op.getResponses() == null) {
+            op.setResponses(new ApiResponses());
         }
         for (ResponseMessageDefinition msg : verb.getResponseMsgs()) {
-            if (openApi instanceof Oas20Document) {
-                doParseResponseOas20(camelContext, (Oas20Document) openApi, (Oas20Operation) op, msg);
-            } else if (openApi instanceof Oas30Document) {
-                doParseResponseOas30(camelContext, (Oas30Document) openApi, (Oas30Operation) op, produces, msg);
-            }
+            doParseResponse(camelContext, openApi, op, produces, msg);
         }
 
         // must include an empty noop response if none exists
-        if (op.responses == null || op.responses.getResponses().isEmpty()) {
-            op.responses.addResponse("200", op.responses.createResponse("200"));
+        if (op.getResponses().isEmpty()) {
+            op.getResponses().setDefault(new ApiResponse());
         }
     }
 
-    private void doParseResponseOas30(
-            CamelContext camelContext, Oas30Document openApi, Oas30Operation op, String produces,
+    private void doParseResponse(
+            CamelContext camelContext, OpenAPI openApi, Operation op, String produces,
             ResponseMessageDefinition msg) {
-        Oas30Response response = null;
+        ApiResponse response = null;
 
         String code = getValue(camelContext, msg.getCode());
-        if (op.responses != null && op.responses.getResponses() != null) {
-            response = (Oas30Response) op.responses.getResponse(code);
-        }
+        response = op.getResponses().get(code);
         if (response == null) {
-            response = (Oas30Response) op.responses.createResponse(code);
-            op.responses.addResponse(code, response);
+            response = new ApiResponse();
+            op.getResponses().addApiResponse(code, response);
         }
+
         if (org.apache.camel.util.ObjectHelper.isNotEmpty(msg.getResponseModel())) {
             String[] parts;
             if (produces != null) {
+                Content respContent = new Content();
                 parts = produces.split(",");
                 for (String produce : parts) {
-                    Oas30MediaType contentType = response.createMediaType(produce);
-                    response.addMediaType(produce, contentType);
-                    OasSchema model = contentType.createSchema();
-                    model = modelTypeAsProperty(getValue(camelContext, msg.getResponseModel()), openApi, model);
-                    contentType.schema = (Oas30Schema) model;
+                    Schema model = modelTypeAsProperty(getValue(camelContext, msg.getResponseModel()), openApi);
+                    respContent.addMediaType(produce, new MediaType().schema(model));
                 }
+                response.setContent(respContent);
             }
         }
         if (org.apache.camel.util.ObjectHelper.isNotEmpty(msg.getMessage())) {
-            response.description = getValue(camelContext, msg.getMessage());
+            response.setDescription(getValue(camelContext, msg.getMessage()));
         }
 
         // add headers
@@ -1174,14 +785,14 @@ public class RestOpenApiReader {
 
                 if ("string".equals(type) || "long".equals(type) || "float".equals(type)
                         || "double".equals(type) || "boolean".equals(type)) {
-                    setResponseHeaderOas30(camelContext, response, header, name, format, type);
+                    setResponseHeader(camelContext, response, header, name, format, type);
                 } else if ("int".equals(type) || "integer".equals(type)) {
-                    setResponseHeaderOas30(camelContext, response, header, name, format, "integer");
+                    setResponseHeader(camelContext, response, header, name, format, "integer");
                 } else if ("array".equals(type)) {
-                    Oas30Header ap = response.createHeader(name);
-
+                    Header ap = new Header();
+                    response.addHeaderObject(name, ap);
                     if (org.apache.camel.util.ObjectHelper.isNotEmpty(header.getDescription())) {
-                        ap.description = getValue(camelContext, header.getDescription());
+                        ap.setDescription(getValue(camelContext, header.getDescription()));
                     }
                     if (header.getArrayType() != null) {
                         String arrayType = getValue(camelContext, header.getArrayType());
@@ -1199,163 +810,42 @@ public class RestOpenApiReader {
                     }
                     // add example
                     if (header.getExample() != null) {
-                        Extension exampleExtension = ap.createExtension();
-                        exampleExtension.name = "x-example";
-                        exampleExtension.value = getValue(camelContext, header.getExample());
-                        ap.getExtensions().add(exampleExtension);
+                        ap.addExample("", new Example().value(getValue(camelContext, header.getExample())));
                     }
-                    response.addHeader(name, ap);
                 }
             }
         }
 
         // add examples
         if (msg.getExamples() != null) {
-            Extension exampleExtension = response.createExtension();
-            exampleExtension.name = "x-examples";
-            Map<String, String> examplesValue = new LinkedHashMap<>();
-            for (RestPropertyDefinition prop : msg.getExamples()) {
-                examplesValue.put(getValue(camelContext, prop.getKey()), getValue(camelContext, prop.getValue()));
-
-            }
-            exampleExtension.value = examplesValue;
-            response.addExtension(exampleExtension.name, exampleExtension);
-        }
-    }
-
-    private void setHeaderSchemaOas30(Oas30Header ap, String arrayType) {
-        Oas30Schema items = ap.createSchema();
-        items.type = arrayType;
-        ap.schema = items;
-    }
-
-    private void setResponseHeaderOas30(
-            CamelContext camelContext, Oas30Response response, ResponseHeaderDefinition header,
-            String name, String format, String type) {
-        Oas30Header ip = response.createHeader(name);
-        response.addHeader(name, ip);
-        Oas30Schema schema = ip.createSchema();
-        ip.schema = schema;
-        schema.type = type;
-        if (format != null) {
-            schema.format = format;
-        }
-        ip.description = getValue(camelContext, header.getDescription());
-
-        List<String> values;
-        if (header.getAllowableValues() != null) {
-            values = new ArrayList<>();
-            for (String text : header.getAllowableValuesAsStringList()) {
-                values.add(getValue(camelContext, text));
-            }
-            schema.enum_ = values;
-        }
-        // add example
-        if (header.getExample() != null) {
-            Extension exampleExtension = ip.createExtension();
-            exampleExtension.name = "x-example";
-            exampleExtension.value = getValue(camelContext, header.getExample());
-            ip.getExtensions().add(exampleExtension);
-        }
-    }
-
-    private void doParseResponseOas20(
-            CamelContext camelContext, Oas20Document openApi, Oas20Operation op,
-            ResponseMessageDefinition msg) {
-        Oas20Response response = null;
-
-        String code = getValue(camelContext, msg.getCode());
-        if (op.responses != null && op.responses.getResponses() != null) {
-            response = (Oas20Response) op.responses.getResponse(code);
-        }
-        if (response == null) {
-            response = (Oas20Response) op.responses.createResponse(code);
-            op.responses.addResponse(code, response);
-        }
-        if (org.apache.camel.util.ObjectHelper.isNotEmpty(msg.getResponseModel())) {
-            OasSchema model = response.createSchema();
-            model = modelTypeAsProperty(getValue(camelContext, msg.getResponseModel()), openApi, model);
-            response.schema = (Oas20Schema) model;
-        }
-        if (org.apache.camel.util.ObjectHelper.isNotEmpty(msg.getMessage())) {
-            response.description = getValue(camelContext, msg.getMessage());
-        }
-
-        // add headers
-        if (msg.getHeaders() != null) {
-            for (ResponseHeaderDefinition header : msg.getHeaders()) {
-                String name = getValue(camelContext, header.getName());
-                String type = getValue(camelContext, header.getDataType());
-                String format = getValue(camelContext, header.getDataFormat());
-                if (response.headers == null) {
-                    response.headers = response.createHeaders();
-                }
-                if ("string".equals(type) || "long".equals(type) || "float".equals(type)
-                        || "double".equals(type) || "boolean".equals(type)) {
-                    setResponseHeaderOas20(camelContext, response, header, name, format, type);
-                } else if ("int".equals(type) || "integer".equals(type)) {
-                    setResponseHeaderOas20(camelContext, response, header, name, format, "integer");
-                } else if ("array".equals(type)) {
-                    Oas20Header ap = response.headers.createHeader(name);
-
-                    if (org.apache.camel.util.ObjectHelper.isNotEmpty(header.getDescription())) {
-                        ap.description = getValue(camelContext, header.getDescription());
-                    }
-                    if (header.getArrayType() != null) {
-                        String arrayType = header.getArrayType();
-                        if (arrayType.equalsIgnoreCase("string")
-                                || arrayType.equalsIgnoreCase("long")
-                                || arrayType.equalsIgnoreCase("float")
-                                || arrayType.equalsIgnoreCase("double")
-                                || arrayType.equalsIgnoreCase("boolean")) {
-                            setHeaderSchemaOas20(ap, arrayType);
-                        } else if (header.getArrayType().equalsIgnoreCase("int")
-                                || header.getArrayType().equalsIgnoreCase("integer")) {
-                            setHeaderSchemaOas20(ap, "integer");
-                        }
-
+            if (response.getContent() != null) {
+                for (MediaType mediaType : response.getContent().values()) {
+                    for (RestPropertyDefinition prop : msg.getExamples()) {
+                        mediaType.addExamples(getValue(camelContext, prop.getKey()), new Example()
+                                .value(getValue(camelContext, prop.getValue())));
                     }
-                    // add example
-                    if (header.getExample() != null) {
-                        Extension exampleExtension = ap.createExtension();
-                        exampleExtension.name = "x-example";
-                        exampleExtension.value = getValue(camelContext, header.getExample());
-                        ap.getExtensions().add(exampleExtension);
-                    }
-                    response.headers.addHeader(name, ap);
                 }
             }
-        }
-
-        // add examples
-        if (msg.getExamples() != null) {
-            Extension exampleExtension = response.createExtension();
-            exampleExtension.name = "examples";
-            Map<String, String> examplesValue = new LinkedHashMap<>();
-            for (RestPropertyDefinition prop : msg.getExamples()) {
-                examplesValue.put(getValue(camelContext, prop.getKey()), getValue(camelContext, prop.getValue()));
-
-            }
-            exampleExtension.value = examplesValue;
-            response.addExtension(exampleExtension.name, exampleExtension);
+            // if no content, can't add examples!
         }
     }
 
-    private void setHeaderSchemaOas20(Oas20Header ap, String arrayType) {
-        Oas20Items items = ap.createItems();
-        items.type = arrayType;
-        ap.items = items;
+    private void setHeaderSchemaOas30(Header ap, String arrayType) {
+        Schema items = new Schema().type(arrayType);
+        ap.setSchema(items);
     }
 
-    private void setResponseHeaderOas20(
-            CamelContext camelContext, Oas20Response response, ResponseHeaderDefinition header,
+    private void setResponseHeader(
+            CamelContext camelContext, ApiResponse response, ResponseHeaderDefinition header,
             String name, String format, String type) {
-        Oas20Header ip = response.headers.createHeader(name);
-        ip.type = type;
+        Header ip = new Header();
+        response.addHeaderObject(name, ip);
+        Schema schema = new Schema().type(type);
+        ip.setSchema(schema);
         if (format != null) {
-            ip.format = format;
+            schema.setFormat(format);
         }
-        ip.description = getValue(camelContext, header.getDescription());
+        ip.setDescription(getValue(camelContext, header.getDescription()));
 
         List<String> values;
         if (header.getAllowableValues() != null) {
@@ -1363,19 +853,15 @@ public class RestOpenApiReader {
             for (String text : header.getAllowableValuesAsStringList()) {
                 values.add(getValue(camelContext, text));
             }
-            ip.enum_ = values;
+            schema.setEnum(values);
         }
         // add example
         if (header.getExample() != null) {
-            Extension exampleExtension = ip.createExtension();
-            exampleExtension.name = "x-example";
-            exampleExtension.value = getValue(camelContext, header.getExample());
-            ip.getExtensions().add(exampleExtension);
+            ip.addExample("", new Example().value(getValue(camelContext, header.getExample())));
         }
-        response.headers.addHeader(name, ip);
     }
 
-    private String modelTypeAsRef(String typeName, OasDocument openApi) {
+    private String modelTypeAsRef(String typeName, OpenAPI openApi) {
         boolean array = typeName.endsWith("[]");
         if (array) {
             typeName = typeName.substring(0, typeName.length() - 2);
@@ -1385,32 +871,30 @@ public class RestOpenApiReader {
             return null;
         }
 
-        if (openApi instanceof Oas20Document) {
-            if (((Oas20Document) openApi).definitions != null) {
-                for (Oas20SchemaDefinition model : ((Oas20Document) openApi).definitions.getDefinitions()) {
-                    @SuppressWarnings("rawtypes")
-                    Map modelType = (Map) model.getExtension("x-className").value;
-                    if (modelType != null && typeName.equals(modelType.get("format"))) {
-                        return model.getName();
-                    }
-                }
-            }
-        } else if (openApi instanceof Oas30Document) {
-            if (((Oas30Document) openApi).components != null
-                    && ((Oas30Document) openApi).components.schemas != null) {
-                for (Oas30SchemaDefinition model : ((Oas30Document) openApi).components.schemas.values()) {
-                    @SuppressWarnings("rawtypes")
-                    Map modelType = (Map) model.getExtension("x-className").value;
-                    if (modelType != null && typeName.equals(modelType.get("format"))) {
-                        return model.getName();
-                    }
+        if (openApi.getComponents() != null
+                && openApi.getComponents().getSchemas() != null) {
+            for (Schema model : openApi.getComponents().getSchemas().values()) {
+                if (typeName.equals(getClassNameExtension(model))) {
+                    return model.getName();
                 }
             }
         }
         return null;
     }
 
-    private OasSchema modelTypeAsProperty(String typeName, OasDocument openApi, OasSchema prop) {
+    private Object getClassNameExtension(Schema model) {
+        Object className = null;
+        if (model.getExtensions() != null) {
+            Object value = model.getExtensions().get("x-className");
+            if (value instanceof Map) {
+                className = ((Map) value).get("format");
+            }
+        }
+        return className;
+    }
+
+    private Schema modelTypeAsProperty(String typeName, OpenAPI openApi) {
+        Schema prop = null;
         boolean array = typeName.endsWith("[]");
         if (array) {
             typeName = typeName.substring(0, typeName.length() - 2);
@@ -1418,58 +902,42 @@ public class RestOpenApiReader {
 
         String ref = modelTypeAsRef(typeName, openApi);
 
-        if (ref != null) {
-            if (openApi instanceof Oas20Document) {
-                prop.$ref = OAS20_SCHEMA_DEFINITION_PREFIX + ref;
-            } else if (openApi instanceof Oas30Document) {
-                prop.$ref = OAS30_SCHEMA_DEFINITION_PREFIX + ref;
-            }
-        } else {
+        if (ref == null) {
+            // No explicit schema reference so handle primitive types
             // special for byte arrays
             if (array && ("byte".equals(typeName) || "java.lang.Byte".equals(typeName))) {
-                prop.format = "byte";
-                prop.type = "number";
+                // Note built-in ByteArraySchema sets type="string" !
+                prop = new Schema<byte[]>().type("number").format("byte");
                 array = false;
             } else if ("string".equalsIgnoreCase(typeName) || "java.lang.String".equals(typeName)) {
-                prop.format = "string";
-                prop.type = "string";
+                prop = new StringSchema();
             } else if ("int".equals(typeName) || "java.lang.Integer".equals(typeName)) {
-                prop.format = "integer";
-                prop.type = "number";
+                prop = new IntegerSchema();
             } else if ("long".equals(typeName) || "java.lang.Long".equals(typeName)) {
-                prop.format = "long";
-                prop.type = "number";
+                prop = new IntegerSchema().format("int64");
             } else if ("float".equals(typeName) || "java.lang.Float".equals(typeName)) {
-                prop.format = "float";
-                prop.type = "number";
+                prop = new NumberSchema().format("float");
             } else if ("double".equals(typeName) || "java.lang.Double".equals(typeName)) {
-                prop.format = "double";
-                prop.type = "number";
+                prop = new NumberSchema().format("double");
             } else if ("boolean".equals(typeName) || "java.lang.Boolean".equals(typeName)) {
-                prop.format = "boolean";
-                prop.type = "number";
+                prop = new NumberSchema().format("boolean");
             } else if ("file".equals(typeName) || "java.io.File".equals(typeName)) {
-                if (openApi instanceof Oas20Document) {
-                    prop.type = "file";
-                } else if (openApi instanceof Oas30Document) {
-                    prop.type = "string";
-                    prop.format = "binary";
-                }
+                prop = new FileSchema();
             } else {
-                prop.type = "string";
+                prop = new StringSchema();
             }
         }
 
         if (array) {
-            OasSchema ret = prop.createItemsSchema();
-            ret.$ref = prop.$ref;
-            prop.$ref = null;
-            prop.items = ret;
-            prop.type = "array";
-            return prop;
-        } else {
-            return prop;
+            Schema items = new Schema();
+            if (ref != null) {
+                items.set$ref(OAS30_SCHEMA_DEFINITION_PREFIX + ref);
+            }
+            prop = new ArraySchema().items(items);
+        } else if (prop == null) {
+            prop = new Schema().$ref(OAS30_SCHEMA_DEFINITION_PREFIX + ref);
         }
+        return prop;
     }
 
     /**
@@ -1479,46 +947,35 @@ public class RestOpenApiReader {
      * @param clazz   the class such as pojo with openApi annotation
      * @param openApi the openApi model
      */
-    private void appendModels(Class<?> clazz, OasDocument openApi) {
+    private void appendModels(Class<?> clazz, OpenAPI openApi) {
         RestModelConverters converters = new RestModelConverters();
-        List<? extends OasSchema> models = converters.readClass(openApi, clazz);
+        List<? extends Schema> models = converters.readClass(openApi, clazz);
         if (models == null) {
             return;
         }
-        for (OasSchema entry : models) {
+        if (openApi.getComponents() == null) {
+            openApi.setComponents(new Components());
+        }
+        for (Schema newSchema : models) {
             // favor keeping any existing model that has the vendor extension in the model
-            if (openApi instanceof Oas20Document) {
-                boolean oldExt = false;
-                if (((Oas20Document) openApi).definitions != null && ((Oas20Document) openApi).definitions
-                        .getDefinition(((Oas20SchemaDefinition) entry).getName()) != null) {
-                    Oas20SchemaDefinition oldModel = ((Oas20Document) openApi).definitions
-                            .getDefinition(((Oas20SchemaDefinition) entry).getName());
-                    if (oldModel.getExtensions() != null && !oldModel.getExtensions().isEmpty()) {
-                        oldExt = oldModel.getExtension("x-className") != null;
+            boolean addSchema = true;
+            if (openApi.getComponents().getSchemas() != null) {
+                Schema existing = openApi.getComponents().getSchemas().get(newSchema.getName());
+                if (existing != null) {
+                    // check classname extension
+                    Object oldClassName = getClassNameExtension(existing);
+                    Object newClassName = getClassNameExtension(newSchema);
+                    if (oldClassName != null) {
+                        // a schema with this name and a classname is already in the model
+                        addSchema = false;
+                        LOG.info("Duplicate schema found for with name {}; classname1={}, classname2={}",
+                                newSchema.getName(), oldClassName.toString(),
+                                newClassName != null ? newClassName.toString() : "none");
                     }
                 }
-
-                if (!oldExt) {
-                    ((Oas20Document) openApi).definitions
-                            .addDefinition(((Oas20SchemaDefinition) entry).getName(),
-                                    (Oas20SchemaDefinition) entry);
-                }
-            } else if (openApi instanceof Oas30Document) {
-                boolean oldExt = false;
-                if (((Oas30Document) openApi).components != null && ((Oas30Document) openApi).components
-                        .getSchemaDefinition(((Oas30SchemaDefinition) entry).getName()) != null) {
-                    Oas30SchemaDefinition oldModel = ((Oas30Document) openApi).components
-                            .getSchemaDefinition(((Oas30SchemaDefinition) entry).getName());
-                    if (oldModel.getExtensions() != null && !oldModel.getExtensions().isEmpty()) {
-                        oldExt = oldModel.getExtension("x-className") != null;
-                    }
-                }
-
-                if (!oldExt) {
-                    ((Oas30Document) openApi).components
-                            .addSchemaDefinition(((Oas30SchemaDefinition) entry).getName(),
-                                    (Oas30SchemaDefinition) entry);
-                }
+            }
+            if (addSchema) {
+                openApi.getComponents().addSchemas(newSchema.getName(), newSchema);
             }
         }
 
@@ -1557,78 +1014,32 @@ public class RestOpenApiReader {
         }
     }
 
-    private void shortenClassNames(OasDocument document) {
-        if (document instanceof Oas30Document) {
-            Oas30Document oas30Document = (Oas30Document) document;
-            if (oas30Document.components == null || oas30Document.components.schemas == null) {
-                return;
-            }
-        } else {
-            Oas20Document oas20Document = (Oas20Document) document;
-            if (oas20Document.definitions == null || oas20Document.definitions.getDefinitions() == null) {
-                return;
-            }
+    private OpenAPI shortenClassNames(OpenAPI document) {
+        if (document.getComponents() == null || document.getComponents().getSchemas() == null) {
+            return document;
         }
 
         // Make a mapping from full name to possibly shortened name.
         Map<String, String> names = new HashMap<>();
-        Stream<String> schemaStream;
-        if (document instanceof Oas30Document) {
-            schemaStream = ((Oas30Document) document).components.schemas.keySet().stream();
-        } else {
-            schemaStream = ((Oas20Document) document).definitions.getDefinitions().stream()
-                    .map(Oas20SchemaDefinition::getName);
-        }
+        Stream<String> schemaStream = document.getComponents().getSchemas().keySet().stream();
+
         schemaStream.forEach(key -> {
             String s = key.replaceAll("[^a-zA-Z0-9.-_]", "_");
             String shortName = s.substring(s.lastIndexOf('.') + 1);
             names.put(key, names.containsValue(shortName) ? s : shortName);
         });
-
-        if (document instanceof Oas30Document) {
-            Library.visitTree(document, new Oas30AllNodeVisitor() {
-                @Override
-                protected void visitNode(Node node) {
-                    if (node instanceof Oas30SchemaDefinition) {
-                        Oas30SchemaDefinition definition = (Oas30SchemaDefinition) node;
-                        definition.rename(fixSchemaReference(definition.getName(), names, OAS30_SCHEMA_DEFINITION_PREFIX));
-                    } else if (node instanceof Oas30Schema) {
-                        Oas30Schema schema = (Oas30Schema) node;
-                        String ref = schema.$ref;
-                        if (ref != null) {
-                            schema.$ref = OAS30_SCHEMA_DEFINITION_PREFIX +
-                                          fixSchemaReference(ref, names, OAS30_SCHEMA_DEFINITION_PREFIX);
-                        }
-                    }
-                }
-            }, TraverserDirection.down);
-        } else {
-            Library.visitTree(document, new Oas20AllNodeVisitor() {
-                @Override
-                protected void visitNode(Node node) {
-                    if (node instanceof Oas20SchemaDefinition) {
-                        Oas20SchemaDefinition definition = (Oas20SchemaDefinition) node;
-                        definition.rename(fixSchemaReference(definition.getName(), names, OAS20_SCHEMA_DEFINITION_PREFIX));
-                    } else if (node instanceof Oas20Schema) {
-                        Oas20Schema schema = (Oas20Schema) node;
-                        String ref = schema.$ref;
-                        if (ref != null) {
-                            schema.$ref = OAS20_SCHEMA_DEFINITION_PREFIX +
-                                          fixSchemaReference(ref, names, OAS20_SCHEMA_DEFINITION_PREFIX);
-                        }
-                    }
-                }
-            }, TraverserDirection.down);
+        // Remap the names
+        for (Map.Entry<String, String> namePair : names.entrySet()) {
+            Schema schema = document.getComponents().getSchemas().get(namePair.getKey());
+            if (schema != null) {
+                document.getComponents().getSchemas().remove(namePair.getKey());
+                document.getComponents().addSchemas(namePair.getValue(), schema);
+            }
         }
-    }
 
-    private String fixSchemaReference(String ref, Map<String, String> names, String prefix) {
-        if (ref.startsWith(prefix)) {
-            ref = ref.substring(prefix.length());
-        }
+        AbstractSpecFilter filter = new SchemaFilter(names);
+        return new SpecFilter().filter(document, filter, null, null, null);
 
-        String name = names.get(ref);
-        return name == null ? ref : name;
     }
 
     private String inferOauthFlow(OAuth2Definition rs) {
@@ -1643,4 +1054,103 @@ public class RestOpenApiReader {
         return flow;
     }
 
+    private static class SchemaFilter extends AbstractSpecFilter {
+        private final Map<String, String> names;
+
+        SchemaFilter(Map<String, String> names) {
+            this.names = names;
+        }
+
+        @Override
+        public Optional<Parameter> filterParameter(
+                Parameter parameter, Operation operation, ApiDescription api,
+                Map<String, List<String>> params, Map<String, String> cookies, Map<String, List<String>> headers) {
+            if (parameter.getContent() != null) {
+                processRefsInContent(parameter.getContent());
+            }
+            return Optional.of(parameter);
+        }
+
+        @Override
+        public Optional<RequestBody> filterRequestBody(
+                RequestBody requestBody, Operation operation, ApiDescription api,
+                Map<String, List<String>> params, Map<String, String> cookies, Map<String, List<String>> headers) {
+            if (requestBody.getContent() != null) {
+                processRefsInContent(requestBody.getContent());
+            }
+            return Optional.of(requestBody);
+        }
+
+        @Override
+        public Optional<ApiResponse> filterResponse(
+                ApiResponse response, Operation operation, ApiDescription api,
+                Map<String, List<String>> params, Map<String, String> cookies, Map<String, List<String>> headers) {
+            if (response.getContent() != null) {
+                processRefsInContent(response.getContent());
+            }
+            return Optional.of(response);
+        }
+
+        @SuppressWarnings("rawtypes")
+        @Override
+        public Optional<Schema> filterSchema(
+                Schema schema,
+                Map<String, List<String>> params, Map<String, String> cookies, Map<String, List<String>> headers) {
+            if (schema.getName() != null) {
+                schema.setName(fixSchemaReference(schema.getName(), OAS30_SCHEMA_DEFINITION_PREFIX));
+            }
+            if (schema.get$ref() != null) {
+                schema.set$ref(fixSchemaReference(schema.get$ref(), OAS30_SCHEMA_DEFINITION_PREFIX));
+            }
+            if (schema.getItems() != null) {
+                filterSchema(schema.getItems(), params, cookies, headers);
+            }
+            if (schema.getProperties() != null) {
+                for (Schema propSchema : (Collection<Schema>) schema.getProperties().values()) {
+                    filterSchema(propSchema, params, cookies, headers);
+                }
+            }
+            if (schema.getAdditionalProperties() != null &&
+                    schema.getAdditionalProperties() instanceof Schema) {
+                filterSchema((Schema) schema.getAdditionalProperties(), params, cookies, headers);
+            }
+            if (schema.getAnyOf() != null) {
+                List<Schema> any = schema.getAnyOf();
+                for (Schema child : any) {
+                    filterSchema(child, params, cookies, headers);
+                }
+            }
+            if (schema.getAllOf() != null) {
+                List<Schema> all = schema.getAllOf();
+                for (Schema child : all) {
+                    filterSchema(child, params, cookies, headers);
+                }
+            }
+            if (schema.getOneOf() != null) {
+                List<Schema> oneOf = schema.getOneOf();
+                for (Schema child : oneOf) {
+                    filterSchema(child, params, cookies, headers);
+                }
+            }
+            return Optional.of(schema);
+        }
+
+        private void processRefsInContent(Content content) {
+            for (MediaType media : content.values()) {
+                if (media.getSchema() != null && media.getSchema().get$ref() != null) {
+                    media.getSchema().set$ref(fixSchemaReference(media.getSchema().get$ref(), OAS30_SCHEMA_DEFINITION_PREFIX));
+                }
+            }
+        }
+
+        private String fixSchemaReference(String ref, String prefix) {
+            if (ref.startsWith(prefix)) {
+                ref = ref.substring(prefix.length());
+            }
+
+            String name = names.get(ref);
+            return name == null ? ref : name;
+        }
+    }
+
 }
diff --git a/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestOpenApiSupport.java b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestOpenApiSupport.java
index 0c32527a496..1364521254a 100644
--- a/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestOpenApiSupport.java
+++ b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestOpenApiSupport.java
@@ -18,7 +18,7 @@ package org.apache.camel.openapi;
 
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.util.ArrayList;
+import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -26,18 +26,13 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.SerializationFeature;
-import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;
-import io.apicurio.datamodels.core.models.common.Contact;
-import io.apicurio.datamodels.core.models.common.License;
-import io.apicurio.datamodels.openapi.models.OasDocument;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Document;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Info;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Document;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Info;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Server;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.info.Contact;
+import io.swagger.v3.oas.models.info.Info;
+import io.swagger.v3.oas.models.info.License;
+import io.swagger.v3.oas.models.servers.Server;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.model.rest.RestDefinition;
@@ -102,137 +97,94 @@ public class RestOpenApiSupport {
         response.setHeader("Access-Control-Max-Age", maxAge);
     }
 
-    static void setupXForwardedHeaders(OasDocument openApi, Map<String, Object> headers) {
+    static void setupXForwardedHeaders(OpenAPI openApi, Map<String, Object> headers) {
 
         String basePath = getBasePathFromOasDocument(openApi);
 
-        if (openApi instanceof Oas20Document) {
-            String host = (String) headers.get(HEADER_HOST);
-            if (ObjectHelper.isNotEmpty(host)) {
-                ((Oas20Document) openApi).host = host;
-            }
-
-            String forwardedPrefix = (String) headers.get(HEADER_X_FORWARDED_PREFIX);
-            if (ObjectHelper.isNotEmpty(forwardedPrefix)) {
-                ((Oas20Document) openApi).basePath = URISupport.joinPaths(forwardedPrefix, basePath);
-            }
-
-            String forwardedHost = (String) headers.get(HEADER_X_FORWARDED_HOST);
-            if (ObjectHelper.isNotEmpty(forwardedHost)) {
-                ((Oas20Document) openApi).host = forwardedHost;
-            }
-
-            String proto = (String) headers.get(HEADER_X_FORWARDED_PROTO);
-            if (ObjectHelper.isNotEmpty(proto)) {
-                String[] schemes = proto.split(",");
-                for (String scheme : schemes) {
-                    String trimmedScheme = scheme.trim();
-                    if (ObjectHelper.isNotEmpty(trimmedScheme)) {
-                        if (((Oas20Document) openApi).schemes == null) {
-                            ((Oas20Document) openApi).schemes = new ArrayList<>();
-                        }
-                        ((Oas20Document) openApi).schemes.add(trimmedScheme.toLowerCase());
-                    }
-                }
-            }
-        } else if (openApi instanceof Oas30Document) {
+        String host = (String) headers.get(HEADER_HOST);
 
-            String host = (String) headers.get(HEADER_HOST);
+        String forwardedPrefix = (String) headers.get(HEADER_X_FORWARDED_PREFIX);
 
-            String forwardedPrefix = (String) headers.get(HEADER_X_FORWARDED_PREFIX);
-
-            if (ObjectHelper.isNotEmpty(forwardedPrefix)) {
-                basePath = URISupport.joinPaths(forwardedPrefix, basePath);
-            }
-
-            String forwardedHost = (String) headers.get(HEADER_X_FORWARDED_HOST);
-            if (ObjectHelper.isNotEmpty(forwardedHost)) {
-                host = forwardedHost;
-            }
+        if (ObjectHelper.isNotEmpty(forwardedPrefix)) {
+            basePath = URISupport.joinPaths(forwardedPrefix, basePath);
+        }
 
-            String proto = (String) headers.get(HEADER_X_FORWARDED_PROTO);
-            if (((Oas30Document) openApi).getServers() != null) {
-                ((Oas30Document) openApi).getServers().clear();
-            }
-            if (ObjectHelper.isNotEmpty(proto)) {
-                String[] schemes = proto.split(",");
-                for (String schema : schemes) {
-                    String trimmedScheme = schema.trim();
-                    String serverUrl = String.format("%s://%s%s", trimmedScheme.toLowerCase(), host, basePath);
-                    ((Oas30Document) openApi).addServer(serverUrl, null);
+        String forwardedHost = (String) headers.get(HEADER_X_FORWARDED_HOST);
+        if (ObjectHelper.isNotEmpty(forwardedHost)) {
+            host = forwardedHost;
+        }
 
-                }
-            } else {
-                ((Oas30Document) openApi).addServer(basePath, null);
+        String proto = (String) headers.get(HEADER_X_FORWARDED_PROTO);
+        if (openApi.getServers() != null) {
+            openApi.getServers().clear();
+        }
+        if (ObjectHelper.isNotEmpty(proto)) {
+            String[] schemes = proto.split(",");
+            for (String schema : schemes) {
+                String trimmedScheme = schema.trim();
+                String serverUrl = String.format("%s://%s%s", trimmedScheme.toLowerCase(), host, basePath);
+                openApi.addServersItem(new Server().url(serverUrl));
             }
-
+        } else {
+            openApi.addServersItem(new Server().url(basePath));
         }
     }
 
-    public static String getHostFromOasDocument(final OasDocument openapi) {
+    public static String getHostFromOasDocument(final OpenAPI openapi) {
         String host = null;
-        if (openapi instanceof Oas20Document) {
-            host = ((Oas20Document) openapi).host;
-        } else if (openapi instanceof Oas30Document) {
-            if (((Oas30Document) openapi).getServers() != null
-                    && ((Oas30Document) openapi).getServers().get(0) != null) {
-                try {
-                    URL serverUrl = new URL(
-                            parseVariables(((Oas30Document) openapi).getServers().get(0).url,
-                                    (Oas30Server) ((Oas30Document) openapi).getServers().get(0)));
-                    host = serverUrl.getHost();
-
-                } catch (MalformedURLException e) {
-                    LOG.info("error when parsing OpenApi 3.0 doc server url", e);
-                }
+        if (openapi.getServers() != null
+                && openapi.getServers().get(0) != null) {
+            try {
+                URL serverUrl = new URL(
+                        parseVariables(openapi.getServers().get(0).getUrl(),
+                                openapi.getServers().get(0)));
+                host = serverUrl.getHost();
+
+            } catch (MalformedURLException e) {
+                LOG.info("error when parsing OpenApi 3.0 doc server url", e);
             }
         }
         return host;
 
     }
 
-    public static String getBasePathFromOasDocument(final OasDocument openapi) {
+    public static String getBasePathFromOasDocument(final OpenAPI openapi) {
         String basePath = null;
-        if (openapi instanceof Oas20Document) {
-            basePath = ((Oas20Document) openapi).basePath;
-        } else if (openapi instanceof Oas30Document) {
-            if (((Oas30Document) openapi).getServers() != null
-                    && ((Oas30Document) openapi).getServers().get(0) != null) {
-                try {
-                    Oas30Server server = (Oas30Server) ((Oas30Document) openapi).getServers().get(0);
-                    if (server.variables != null && server.variables.get("basePath") != null) {
-                        basePath = server.variables.get("basePath").default_;
-                    }
-                    if (basePath == null) {
-                        // parse server url as fallback
-                        URL serverUrl = new URL(
-                                parseVariables(((Oas30Document) openapi).getServers().get(0).url,
-                                        (Oas30Server) ((Oas30Document) openapi).getServers().get(0)));
-                        // strip off the first "/" if double "/" exists
-                        basePath = serverUrl.getPath().replaceAll("//", "/");
-                        if ("/".equals(basePath)) {
-                            basePath = "";
-                        }
+        if (openapi.getServers() != null
+                && openapi.getServers().get(0) != null) {
+            try {
+                Server server = openapi.getServers().get(0);
+                if (server.getVariables() != null && server.getVariables().get("basePath") != null) {
+                    basePath = server.getVariables().get("basePath").getDefault();
+                }
+                if (basePath == null) {
+                    // parse server url as fallback
+                    URL serverUrl = new URL(
+                            parseVariables(openapi.getServers().get(0).getUrl(),
+                                    openapi.getServers().get(0)));
+                    // strip off the first "/" if double "/" exists
+                    basePath = serverUrl.getPath().replaceAll("//", "/");
+                    if ("/".equals(basePath)) {
+                        basePath = "";
                     }
-
-                } catch (MalformedURLException e) {
-                    //not a valid whole url, just the basePath
-                    basePath = ((Oas30Document) openapi).getServers().get(0).url;
                 }
-            }
 
+            } catch (MalformedURLException e) {
+                //not a valid whole url, just the basePath
+                basePath = openapi.getServers().get(0).getUrl();
+            }
         }
 
         return basePath;
     }
 
-    public static String parseVariables(String url, Oas30Server server) {
+    public static String parseVariables(String url, Server server) {
         Pattern p = Pattern.compile("\\{(.*?)}");
         Matcher m = p.matcher(url);
         while (m.find()) {
             String var = m.group(1);
-            if (server != null && server.variables != null && server.variables.get(var) != null) {
-                String varValue = server.variables.get(var).default_;
+            if (server != null && server.getVariables() != null && server.getVariables().get(var) != null) {
+                String varValue = server.getVariables().get(var).getDefault();
                 url = url.replace("{" + var + "}", varValue);
             }
         }
@@ -290,65 +242,24 @@ public class RestOpenApiSupport {
         String contactUrl = (String) config.get("api.contact.url");
         String contactEmail = (String) config.get("api.contact.email");
 
-        if (!openApiConfig.isOpenApi3()) {
-            setInfoOas20(openApiConfig, version, title, description, termsOfService, licenseName, licenseUrl,
-                    contactName, contactUrl, contactEmail);
-        } else {
-            setInfoOas30(openApiConfig, version, title, description, termsOfService, licenseName, licenseUrl,
-                    contactName, contactUrl, contactEmail);
-        }
+        setInfo(openApiConfig, version, title, description, termsOfService, licenseName, licenseUrl,
+                contactName, contactUrl, contactEmail);
     }
 
-    private void setInfoOas30(
+    private void setInfo(
             BeanConfig openApiConfig, String version, String title, String description,
             String termsOfService, String licenseName, String licenseUrl,
             String contactName, String contactUrl, String contactEmail) {
-        Oas30Info info = new Oas30Info();
-        info.version = version;
-        info.title = title;
-        info.description = description;
-        info.termsOfService = termsOfService;
+        Info info = new Info().version(version).title(title).description(description).termsOfService(termsOfService);
 
         if (licenseName != null || licenseUrl != null) {
-            License license = info.createLicense();
-            license.name = licenseName;
-            license.url = licenseUrl;
-            info.license = license;
+            License license = new License().name(licenseName).url(licenseUrl);
+            info.setLicense(license);
         }
 
         if (contactName != null || contactUrl != null || contactEmail != null) {
-            Contact contact = info.createContact();
-            contact.name = contactName;
-            contact.url = contactUrl;
-            contact.email = contactEmail;
-            info.contact = contact;
-        }
-        openApiConfig.setInfo(info);
-    }
-
-    private void setInfoOas20(
-            BeanConfig openApiConfig, String version, String title, String description,
-            String termsOfService, String licenseName, String licenseUrl,
-            String contactName, String contactUrl, String contactEmail) {
-        Oas20Info info = new Oas20Info();
-        info.version = version;
-        info.title = title;
-        info.description = description;
-        info.termsOfService = termsOfService;
-
-        if (licenseName != null || licenseUrl != null) {
-            License license = info.createLicense();
-            license.name = licenseName;
-            license.url = licenseUrl;
-            info.license = license;
-        }
-
-        if (contactName != null || contactUrl != null || contactEmail != null) {
-            Contact contact = info.createContact();
-            contact.name = contactName;
-            contact.url = contactUrl;
-            contact.email = contactEmail;
-            info.contact = contact;
+            Contact contact = new Contact().name(contactName).url(contactUrl).email(contactEmail);
+            info.setContact(contact);
         }
         openApiConfig.setInfo(info);
     }
@@ -400,7 +311,7 @@ public class RestOpenApiSupport {
                         .getOrDefault("api.specification.contentType.json", "application/json"));
 
                 // read the rest-dsl into openApi model
-                OasDocument openApi = reader.read(
+                OpenAPI openApi = reader.read(
                         camelContext, rests, openApiConfig, camelContext.getName(), classResolver);
                 if (configuration.isUseXForwardHeaders()) {
                     setupXForwardedHeaders(openApi, headers);
@@ -409,9 +320,16 @@ public class RestOpenApiSupport {
                 if (!configuration.isApiVendorExtension()) {
                     clearVendorExtensions(openApi);
                 }
-
-                Object dump = io.apicurio.datamodels.Library.writeNode(openApi);
-                byte[] bytes = mapper.writeValueAsBytes(dump);
+                // Serialize to JSON
+                byte[] bytes = null;
+                if (!openApiConfig.isOpenApi3()) {
+                    OpenAPI3to2 converter = new OpenAPI3to2();
+                    converter.convertOpenAPI3to2(openApi);
+                    bytes = converter.getSwaggerAsJson();
+                } else {
+                    String result = io.swagger.v3.core.util.Json31.pretty(openApi);
+                    bytes = result.getBytes(StandardCharsets.UTF_8);
+                }
                 int len = bytes.length;
                 response.setHeader(Exchange.CONTENT_LENGTH, Integer.toString(len));
 
@@ -421,7 +339,7 @@ public class RestOpenApiSupport {
                         .getOrDefault("api.specification.contentType.yaml", "text/yaml"));
 
                 // read the rest-dsl into openApi model
-                OasDocument openApi = reader.read(
+                OpenAPI openApi = reader.read(
                         camelContext, rests, openApiConfig, camelContext.getName(), classResolver);
                 if (configuration.isUseXForwardHeaders()) {
                     setupXForwardedHeaders(openApi, headers);
@@ -430,13 +348,15 @@ public class RestOpenApiSupport {
                 if (!configuration.isApiVendorExtension()) {
                     clearVendorExtensions(openApi);
                 }
-
-                Object dump = io.apicurio.datamodels.Library.writeNode(openApi);
-                byte[] jsonData = mapper.writeValueAsBytes(dump);
-
-                // json to yaml
-                JsonNode node = mapper.readTree(jsonData);
-                byte[] bytes = new YAMLMapper().writeValueAsString(node).getBytes();
+                byte[] bytes = null;
+                if (!openApiConfig.isOpenApi3()) {
+                    OpenAPI3to2 converter = new OpenAPI3to2();
+                    converter.convertOpenAPI3to2(openApi);
+                    bytes = converter.getSwaggerAsYaml();
+                } else {
+                    String result = io.swagger.v3.core.util.Yaml.pretty(openApi);
+                    bytes = result.getBytes();
+                }
 
                 int len = bytes.length;
                 response.setHeader(Exchange.CONTENT_LENGTH, Integer.toString(len));
@@ -448,4 +368,14 @@ public class RestOpenApiSupport {
         }
     }
 
+    public static String getJsonFromOpenAPI(OpenAPI openApi3, BeanConfig openApiConfig) {
+        if (!openApiConfig.isOpenApi3()) {
+            OpenAPI3to2 converter = new OpenAPI3to2();
+            converter.convertOpenAPI3to2(openApi3);
+            return new String(converter.getSwaggerAsJson());
+        } else {
+            return io.swagger.v3.core.util.Json.pretty(openApi3);
+        }
+    }
+
 }
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/ComplexTypesTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/ComplexTypesTest.java
index 7ae71252c85..d7d50fe4ec5 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/ComplexTypesTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/ComplexTypesTest.java
@@ -23,11 +23,7 @@ import java.nio.charset.StandardCharsets;
 import java.util.List;
 import java.util.stream.Collectors;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
+import io.swagger.v3.oas.models.OpenAPI;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
@@ -185,15 +181,9 @@ public class ComplexTypesTest extends CamelTestSupport {
                 .collect(Collectors.toList());
 
         RestOpenApiReader reader = new RestOpenApiReader();
-        OasDocument openApi = reader.read(context, rests, config, context.getName(), new DefaultClassResolver());
+        OpenAPI openApi = reader.read(context, rests, config, context.getName(), new DefaultClassResolver());
         assertNotNull(openApi);
-
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
-
+        String json = RestOpenApiSupport.getJsonFromOpenAPI(openApi, config);
         LOG.info(json);
 
         json = generify(json);
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/OpenApiRestProducerFactoryTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/OpenApiRestProducerFactoryTest.java
index 4229c259c45..18d7f4b315a 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/OpenApiRestProducerFactoryTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/OpenApiRestProducerFactoryTest.java
@@ -19,19 +19,21 @@ package org.apache.camel.openapi;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.junit.jupiter.api.Test;
 
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
 public class OpenApiRestProducerFactoryTest {
 
     @Test
     public void shouldLoadOpenApiPetStoreModel() throws Exception {
         OpenApiRestProducerFactory factory = new OpenApiRestProducerFactory();
 
-        factory.loadOpenApiModel(new DefaultCamelContext(), "petstore.json");
+        assertNotNull(factory.loadOpenApiModel(new DefaultCamelContext(), "petstore.json"));
     }
 
     @Test
     public void shouldLoadOpenApiPetStoreModelV3() throws Exception {
         OpenApiRestProducerFactory factory = new OpenApiRestProducerFactory();
 
-        factory.loadOpenApiModel(new DefaultCamelContext(), "petstore-v3.json");
+        assertNotNull(factory.loadOpenApiModel(new DefaultCamelContext(), "petstore-v3.json"));
     }
 }
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiDefaultProducesConsumesTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiDefaultProducesConsumesTest.java
index e55ba45fe64..7620814e933 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiDefaultProducesConsumesTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiDefaultProducesConsumesTest.java
@@ -29,6 +29,8 @@ import org.apache.camel.spi.RestConfiguration;
 import org.apache.camel.support.DefaultExchange;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.MethodSource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import static org.apache.camel.openapi.BeanConfig.DEFAULT_MEDIA_TYPE;
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -39,6 +41,7 @@ public class RestOpenApiDefaultProducesConsumesTest {
 
     private static final ObjectMapper MAPPER = new ObjectMapper();
     private static final String[] OPENAPI_VERSIONS = { "3.0", "2.0" };
+    private final Logger log = LoggerFactory.getLogger(getClass());
 
     @ParameterizedTest
     @MethodSource("getOpenApiVersions")
@@ -72,6 +75,7 @@ public class RestOpenApiDefaultProducesConsumesTest {
 
         String json = exchange.getMessage().getBody(String.class);
         assertNotNull(json);
+        log.info(json);
 
         JsonNode root = MAPPER.readTree(json);
         assertConsumesMatches(root, openApiVersion, "application/xml");
@@ -105,6 +109,7 @@ public class RestOpenApiDefaultProducesConsumesTest {
 
         String json = exchange.getMessage().getBody(String.class);
         assertNotNull(json);
+        log.info(json);
 
         JsonNode root = MAPPER.readTree(json);
         assertProducesMatches(root, openApiVersion, "application/xml");
@@ -141,6 +146,7 @@ public class RestOpenApiDefaultProducesConsumesTest {
 
         String json = exchange.getMessage().getBody(String.class);
         assertNotNull(json);
+        log.info(json);
 
         JsonNode root = MAPPER.readTree(json);
         if (openApiVersion.equals("3.0")) {
@@ -188,6 +194,7 @@ public class RestOpenApiDefaultProducesConsumesTest {
 
         String json = exchange.getMessage().getBody(String.class);
         assertNotNull(json);
+        log.info(json);
 
         JsonNode root = MAPPER.readTree(json);
         if (openApiVersion.equals("3.0")) {
@@ -235,6 +242,7 @@ public class RestOpenApiDefaultProducesConsumesTest {
 
         String json = exchange.getMessage().getBody(String.class);
         assertNotNull(json);
+        log.info(json);
 
         JsonNode root = MAPPER.readTree(json);
         if (openApiVersion.equals("3.0")) {
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiModelApiSecurityRequirementsTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiModelApiSecurityRequirementsTest.java
index 37ceff3e6e9..d6170cb5b95 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiModelApiSecurityRequirementsTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiModelApiSecurityRequirementsTest.java
@@ -16,11 +16,7 @@
  */
 package org.apache.camel.openapi;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
+import io.swagger.v3.oas.models.OpenAPI;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
 import org.apache.camel.test.junit5.CamelTestSupport;
@@ -66,16 +62,10 @@ public class RestOpenApiModelApiSecurityRequirementsTest extends CamelTestSuppor
         config.setVersion("2.0");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
-
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
-
+        String json = RestOpenApiSupport.getJsonFromOpenAPI(openApi, config);
         log.info(json);
 
         assertTrue(json.contains("\"securityDefinitions\" : {"));
@@ -99,16 +89,11 @@ public class RestOpenApiModelApiSecurityRequirementsTest extends CamelTestSuppor
         config.setLicenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
-
+        String json = io.swagger.v3.core.util.Json.pretty(openApi);
         log.info(json);
 
         assertTrue(json.contains("securitySchemes"));
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiProcessorTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiProcessorTest.java
index 2a69b826e92..2f5c9f03099 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiProcessorTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiProcessorTest.java
@@ -131,8 +131,8 @@ public class RestOpenApiProcessorTest {
         assertEquals("text/yaml", exchange.getMessage().getHeader(Exchange.CONTENT_TYPE));
         assertTrue(yaml.contains("/foo:"));
         assertTrue(yaml.contains("/bar:"));
-        assertTrue(yaml.contains("summary: \"Foo endpoint\""));
-        assertTrue(yaml.contains("summary: \"Bar endpoint\""));
+        assertTrue(yaml.contains("summary: Foo endpoint"));
+        assertTrue(yaml.contains("summary: Bar endpoint"));
     }
 
     @Test
@@ -183,8 +183,8 @@ public class RestOpenApiProcessorTest {
         assertEquals("text/yaml", exchange.getMessage().getHeader(Exchange.CONTENT_TYPE));
         assertTrue(yaml.contains("/foo:"));
         assertTrue(yaml.contains("/bar:"));
-        assertTrue(yaml.contains("summary: \"Foo endpoint\""));
-        assertTrue(yaml.contains("summary: \"Bar endpoint\""));
+        assertTrue(yaml.contains("summary: Foo endpoint"));
+        assertTrue(yaml.contains("summary: Bar endpoint"));
     }
 
 }
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderApiDocsOverrideTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderApiDocsOverrideTest.java
index a7bb384620b..043eff599fc 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderApiDocsOverrideTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderApiDocsOverrideTest.java
@@ -16,11 +16,7 @@
  */
 package org.apache.camel.openapi;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
+import io.swagger.v3.oas.models.OpenAPI;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
@@ -68,17 +64,12 @@ public class RestOpenApiReaderApiDocsOverrideTest extends CamelTestSupport {
         config.setBasePath("/api");
         config.setVersion("2.0");
         RestOpenApiReader reader = new RestOpenApiReader();
-        OasDocument openApi = null;
+        OpenAPI openApi = null;
         openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
 
         assertNotNull(openApi);
-
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = RestOpenApiSupport.getJsonFromOpenAPI(openApi, config);
         log.info(json);
 
         assertFalse(json.contains("\"/hello/bye\""));
@@ -96,17 +87,12 @@ public class RestOpenApiReaderApiDocsOverrideTest extends CamelTestSupport {
         config.setSchemes(new String[] { "http" });
         config.setBasePath("/api");
         RestOpenApiReader reader = new RestOpenApiReader();
-        OasDocument openApi = null;
+        OpenAPI openApi = null;
         openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
 
         assertNotNull(openApi);
-
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = io.swagger.v3.core.util.Json.pretty(openApi);
         log.info(json);
 
         assertFalse(json.contains("\"/hello/bye\""));
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderApiDocsTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderApiDocsTest.java
index 39477fdabc9..0e2fa4aca22 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderApiDocsTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderApiDocsTest.java
@@ -16,11 +16,7 @@
  */
 package org.apache.camel.openapi;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
+import io.swagger.v3.oas.models.OpenAPI;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
@@ -69,16 +65,11 @@ public class RestOpenApiReaderApiDocsTest extends CamelTestSupport {
         config.setVersion("2.0");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
-
+        String json = RestOpenApiSupport.getJsonFromOpenAPI(openApi, config);
         log.info(json);
 
         assertTrue(json.contains("\"host\" : \"localhost:8080\""));
@@ -100,16 +91,11 @@ public class RestOpenApiReaderApiDocsTest extends CamelTestSupport {
         config.setBasePath("/api");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
-
+        String json = io.swagger.v3.core.util.Json.pretty(openApi);
         log.info(json);
 
         assertTrue(json.contains("\"url\" : \"http://localhost:8080/api\""));
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderContextPathTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderContextPathTest.java
index 6caaffa50f0..887b1e70a8d 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderContextPathTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderContextPathTest.java
@@ -16,13 +16,9 @@
  */
 package org.apache.camel.openapi;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Info;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Info;
+import io.swagger.v3.core.util.Json;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.info.Info;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
@@ -72,20 +68,15 @@ public class RestOpenApiReaderContextPathTest extends CamelTestSupport {
         config.setHost("localhost:8080");
         config.setSchemes(new String[] { "http" });
         config.setBasePath("/api");
-        Oas20Info info = new Oas20Info();
-        config.setInfo(info);
+        config.setInfo(new Info());
         config.setVersion("2.0");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = RestOpenApiSupport.getJsonFromOpenAPI(openApi, config);
 
         log.info(json);
 
@@ -114,21 +105,18 @@ public class RestOpenApiReaderContextPathTest extends CamelTestSupport {
         config.setHost("localhost:8080");
         config.setSchemes(new String[] { "http" });
         config.setBasePath("/api");
-        Oas30Info info = new Oas30Info();
+        Info info = new Info();
         config.setInfo(info);
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = Json.pretty(openApi);
 
         log.info(json);
+        json = json.replace("\n", " ").replaceAll("\\s+", " ");
 
         assertTrue(json.contains("\"url\" : \"http://localhost:8080/api\""));
         assertTrue(json.contains("\"/hello/bye\""));
@@ -139,10 +127,12 @@ public class RestOpenApiReaderContextPathTest extends CamelTestSupport {
         assertFalse(json.contains("\"/api/hello/hi/{name}\""));
         assertTrue(json.contains("\"type\" : \"number\""));
         assertTrue(json.contains("\"format\" : \"float\""));
-        assertTrue(json.contains("\"application/xml\" : \"<hello>Hi</hello>\""));
-        assertTrue(json.contains("\"x-example\" : \"Donald Duck\""));
-        assertTrue(json.contains("\"success\" : \"123\""));
-        assertTrue(json.contains("\"error\" : \"-1\""));
+        // The example is under the section for this media type
+        assertTrue(json.contains("\"application/xml\" : {"));
+        assertTrue(json.contains("\"example\" : \"<hello>Hi</hello>\""));
+        assertTrue(json.contains("\"example\" : \"Donald Duck\""));
+        assertTrue(json.contains("\"success\" : { \"value\" : \"123\" }"));
+        assertTrue(json.contains("\"error\" : { \"value\" : \"-1\" }"));
         assertTrue(json.contains("\"type\" : \"array\""));
         assertTrue(json.contains("\"format\" : \"date-time\""));
 
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderDayOfWeekTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderDayOfWeekTest.java
index 098489caa1b..cdf367297be 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderDayOfWeekTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderDayOfWeekTest.java
@@ -16,11 +16,7 @@
  */
 package org.apache.camel.openapi;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
+import io.swagger.v3.oas.models.OpenAPI;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
@@ -71,15 +67,11 @@ public class RestOpenApiReaderDayOfWeekTest extends CamelTestSupport {
         config.setVersion("2.0");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = RestOpenApiSupport.getJsonFromOpenAPI(openApi, config);
 
         log.info(json);
 
@@ -104,18 +96,13 @@ public class RestOpenApiReaderDayOfWeekTest extends CamelTestSupport {
         config.setTitle("Day");
         config.setLicense("Apache 2.0");
         config.setLicenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
-        //config.setVersion("2.0");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = io.swagger.v3.core.util.Json.pretty(openApi);
 
         log.info(json);
 
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderDisabledTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderDisabledTest.java
index 38b16c86903..55279a3f50c 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderDisabledTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderDisabledTest.java
@@ -16,13 +16,9 @@
  */
 package org.apache.camel.openapi;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Info;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Info;
+import io.swagger.v3.core.util.Json;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.info.Info;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
@@ -72,21 +68,15 @@ public class RestOpenApiReaderDisabledTest extends CamelTestSupport {
         config.setHost("localhost:8080");
         config.setSchemes(new String[] { "http" });
         config.setBasePath("/api");
-        Oas20Info info = new Oas20Info();
-        config.setInfo(info);
+        config.setInfo(new Info());
         config.setVersion("2.0");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
-
+        String json = RestOpenApiSupport.getJsonFromOpenAPI(openApi, config);
         log.info(json);
 
         assertTrue(json.contains("\"host\" : \"localhost:8080\""));
@@ -114,20 +104,14 @@ public class RestOpenApiReaderDisabledTest extends CamelTestSupport {
         config.setHost("localhost:8080");
         config.setSchemes(new String[] { "http" });
         config.setBasePath("/api");
-        Oas30Info info = new Oas30Info();
-        config.setInfo(info);
+        config.setInfo(new Info());
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
-
+        String json = io.swagger.v3.core.util.Json.pretty(openApi);
         log.info(json);
 
         assertTrue(json.contains("\"url\" : \"http://localhost:8080/api\""));
@@ -139,10 +123,10 @@ public class RestOpenApiReaderDisabledTest extends CamelTestSupport {
         assertFalse(json.contains("\"/api/hello/hi/{name}\""));
         assertFalse(json.contains("\"type\" : \"number\""));
         assertFalse(json.contains("\"format\" : \"float\""));
-        assertFalse(json.contains("\"application/xml\" : \"<hello>Hi</hello>\""));
-        assertTrue(json.contains("\"x-example\" : \"Donald Duck\""));
-        assertFalse(json.contains("\"success\" : \"123\""));
-        assertFalse(json.contains("\"error\" : \"-1\""));
+        assertFalse(json.contains("\"example\" : \"<hello>Hi</hello>\""));
+        assertTrue(json.contains("\"example\" : \"Donald Duck\""));
+        assertFalse(json.contains("\"success\" : { \"value\" : \"123\" }"));
+        assertFalse(json.contains("\"error\" : { \"value\" : \"-1\" }"));
         assertTrue(json.contains("\"type\" : \"array\""));
 
         context.stop();
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderEnableVendorExtensionTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderEnableVendorExtensionTest.java
index 604f6747f23..7dc20eda442 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderEnableVendorExtensionTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderEnableVendorExtensionTest.java
@@ -16,11 +16,7 @@
  */
 package org.apache.camel.openapi;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
+import io.swagger.v3.oas.models.OpenAPI;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
@@ -84,15 +80,11 @@ public class RestOpenApiReaderEnableVendorExtensionTest extends CamelTestSupport
         config.setLicenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = RestOpenApiSupport.getJsonFromOpenAPI(openApi, config);
 
         log.info(json);
 
@@ -118,15 +110,11 @@ public class RestOpenApiReaderEnableVendorExtensionTest extends CamelTestSupport
         config.setLicenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = io.swagger.v3.core.util.Json.pretty(openApi);
 
         log.info(json);
 
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderFileResponseModelTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderFileResponseModelTest.java
index b4203d4c7b1..9bcf4a801c2 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderFileResponseModelTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderFileResponseModelTest.java
@@ -16,13 +16,9 @@
  */
 package org.apache.camel.openapi;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Info;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Info;
+import io.swagger.v3.core.util.Json;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.info.Info;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
@@ -60,21 +56,15 @@ public class RestOpenApiReaderFileResponseModelTest extends CamelTestSupport {
         config.setHost("localhost:8080");
         config.setSchemes(new String[] { "http" });
         config.setBasePath("/api");
-        Oas20Info info = new Oas20Info();
-        config.setInfo(info);
+        config.setInfo(new Info());
         config.setVersion("2.0");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
-
+        String json = RestOpenApiSupport.getJsonFromOpenAPI(openApi, config);
         LOG.info(json);
         assertTrue(json.contains("\"type\" : \"file\""));
 
@@ -87,20 +77,14 @@ public class RestOpenApiReaderFileResponseModelTest extends CamelTestSupport {
         config.setHost("localhost:8080");
         config.setSchemes(new String[] { "http" });
         config.setBasePath("/api");
-        Oas30Info info = new Oas30Info();
+        Info info = new Info();
         config.setInfo(info);
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
-
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
-
+        String json = Json.pretty(openApi);
         LOG.info(json);
         assertTrue(json.contains("\"format\" : \"binary\""));
         assertTrue(json.contains("\"type\" : \"string\""));
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderModelApiSecurityTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderModelApiSecurityTest.java
index d49b916600d..10fcedbfaa7 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderModelApiSecurityTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderModelApiSecurityTest.java
@@ -16,11 +16,8 @@
  */
 package org.apache.camel.openapi;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
+import io.swagger.v3.core.util.Json;
+import io.swagger.v3.oas.models.OpenAPI;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
@@ -89,15 +86,11 @@ public class RestOpenApiReaderModelApiSecurityTest extends CamelTestSupport {
         config.setVersion("2.0");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = RestOpenApiSupport.getJsonFromOpenAPI(openApi, config);
 
         log.info(json);
 
@@ -113,7 +106,6 @@ public class RestOpenApiReaderModelApiSecurityTest extends CamelTestSupport {
         assertTrue(json.contains("\"api_key\" : [ ]"));
         assertTrue(json.contains("\"description\" : \"The user returned\""));
         assertTrue(json.contains("\"$ref\" : \"#/definitions/User\""));
-        assertTrue(json.contains("\"x-className\""));
         assertTrue(json.contains("\"format\" : \"org.apache.camel.openapi.User\""));
         assertTrue(json.contains("\"type\" : \"string\""));
         assertTrue(json.contains("\"format\" : \"date\""));
@@ -132,15 +124,11 @@ public class RestOpenApiReaderModelApiSecurityTest extends CamelTestSupport {
         config.setLicenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = io.swagger.v3.core.util.Json.pretty(openApi);
 
         log.info(json);
 
@@ -157,7 +145,6 @@ public class RestOpenApiReaderModelApiSecurityTest extends CamelTestSupport {
         assertTrue(json.contains("\"api_key\" : [ ]"));
         assertTrue(json.contains("\"description\" : \"The user returned\""));
         assertTrue(json.contains("\"$ref\" : \"#/components/schemas/User\""));
-        assertTrue(json.contains("\"x-className\""));
         assertTrue(json.contains("\"format\" : \"org.apache.camel.openapi.User\""));
         assertTrue(json.contains("\"type\" : \"string\""));
         assertTrue(json.contains("\"format\" : \"date\""));
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderModelBookOrderTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderModelBookOrderTest.java
index 1e95f6cd3b4..0d0901e307d 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderModelBookOrderTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderModelBookOrderTest.java
@@ -16,11 +16,7 @@
  */
 package org.apache.camel.openapi;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
+import io.swagger.v3.oas.models.OpenAPI;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
@@ -84,15 +80,11 @@ public class RestOpenApiReaderModelBookOrderTest extends CamelTestSupport {
         config.setVersion("2.0");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = RestOpenApiSupport.getJsonFromOpenAPI(openApi, config);
 
         log.info(json);
 
@@ -102,7 +94,6 @@ public class RestOpenApiReaderModelBookOrderTest extends CamelTestSupport {
         assertTrue(json.contains("\"LineItem\""));
         assertTrue(json.contains("\"$ref\" : \"#/definitions/BookOrder\""));
         assertTrue(json.contains("\"$ref\" : \"#/definitions/LineItem\""));
-        assertTrue(json.contains("\"x-className\""));
         assertTrue(json.contains("\"format\" : \"org.apache.camel.openapi.BookOrder\""));
         assertTrue(json.contains("\"format\" : \"org.apache.camel.openapi.LineItem\""));
 
@@ -120,15 +111,11 @@ public class RestOpenApiReaderModelBookOrderTest extends CamelTestSupport {
         config.setLicenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = io.swagger.v3.core.util.Json.pretty(openApi);
 
         log.info(json);
 
@@ -138,7 +125,6 @@ public class RestOpenApiReaderModelBookOrderTest extends CamelTestSupport {
         assertTrue(json.contains("\"LineItem\""));
         assertTrue(json.contains("\"$ref\" : \"#/components/schemas/BookOrder"));
         assertTrue(json.contains("\"$ref\" : \"#/components/schemas/LineItem"));
-        assertTrue(json.contains("\"x-className\""));
         assertTrue(json.contains("\"format\" : \"org.apache.camel.openapi.BookOrder\""));
         assertTrue(json.contains("\"format\" : \"org.apache.camel.openapi.LineItem\""));
 
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderModelTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderModelTest.java
index 8d8c07f482c..e343c16bfb5 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderModelTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderModelTest.java
@@ -16,11 +16,7 @@
  */
 package org.apache.camel.openapi;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
+import io.swagger.v3.oas.models.OpenAPI;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
@@ -82,15 +78,11 @@ public class RestOpenApiReaderModelTest extends CamelTestSupport {
         config.setLicenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = RestOpenApiSupport.getJsonFromOpenAPI(openApi, config);
 
         log.info(json);
 
@@ -116,22 +108,17 @@ public class RestOpenApiReaderModelTest extends CamelTestSupport {
         config.setLicenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = io.swagger.v3.core.util.Json.pretty(openApi);
 
         log.info(json);
 
         assertTrue(json.contains("\"url\" : \"http://localhost:8080/api\""));
         assertTrue(json.contains("\"description\" : \"The user returned\""));
         assertTrue(json.contains("\"$ref\" : \"#/components/schemas/User\""));
-        assertTrue(json.contains("\"x-className\""));
         assertTrue(json.contains("\"format\" : \"org.apache.camel.openapi.User\""));
         assertTrue(json.contains("\"type\" : \"string\""));
         assertTrue(json.contains("\"format\" : \"date\""));
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderOverrideHostApiDocsTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderOverrideHostApiDocsTest.java
index 1be69d7623b..057704a97e3 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderOverrideHostApiDocsTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderOverrideHostApiDocsTest.java
@@ -16,11 +16,8 @@
  */
 package org.apache.camel.openapi;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
+import io.swagger.v3.core.util.Json;
+import io.swagger.v3.oas.models.OpenAPI;
 import org.apache.camel.impl.engine.DefaultClassResolver;
 import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
@@ -45,15 +42,11 @@ public class RestOpenApiReaderOverrideHostApiDocsTest extends RestOpenApiReaderA
         config.setHost("http:mycoolserver:8888/myapi");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = RestOpenApiSupport.getJsonFromOpenAPI(openApi, config);
 
         log.info(json);
 
@@ -78,15 +71,11 @@ public class RestOpenApiReaderOverrideHostApiDocsTest extends RestOpenApiReaderA
         config.setHost("http:mycoolserver:8888/myapi");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = io.swagger.v3.core.util.Json.pretty(openApi);
 
         log.info(json);
 
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderPropertyPlaceholderTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderPropertyPlaceholderTest.java
index 5d34a7c1c6d..385c659b72f 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderPropertyPlaceholderTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderPropertyPlaceholderTest.java
@@ -19,11 +19,7 @@ package org.apache.camel.openapi;
 import java.util.List;
 import java.util.Properties;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
+import io.swagger.v3.oas.models.OpenAPI;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
@@ -93,15 +89,10 @@ public class RestOpenApiReaderPropertyPlaceholderTest extends CamelTestSupport {
         RestOpenApiSupport support = new RestOpenApiSupport();
         List<RestDefinition> rests = support.getRestDefinitions(context);
 
-        OasDocument openApi = reader.read(context, rests, config, context.getName(), new DefaultClassResolver());
+        OpenAPI openApi = reader.read(context, rests, config, context.getName(), new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = RestOpenApiSupport.getJsonFromOpenAPI(openApi, config);
 
         log.info(json);
 
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderTest.java
index e1e5c878274..26da6cc97c7 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiReaderTest.java
@@ -16,13 +16,9 @@
  */
 package org.apache.camel.openapi;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Info;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Info;
+import io.swagger.v3.core.util.Json;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.info.Info;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
@@ -148,20 +144,15 @@ public class RestOpenApiReaderTest extends CamelTestSupport {
         config.setHost("localhost:8080");
         config.setSchemes(new String[] { "http" });
         config.setBasePath("/api");
-        Oas20Info info = new Oas20Info();
-        config.setInfo(info);
+        config.setInfo(new Info());
         config.setVersion("2.0");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = RestOpenApiSupport.getJsonFromOpenAPI(openApi, config);
         String flatJson = json.replace("\n", " ").replaceAll("\\s+", " ");
 
         log.info(json);
@@ -180,14 +171,16 @@ public class RestOpenApiReaderTest extends CamelTestSupport {
         assertTrue(json.contains("\"error\" : \"-1\""));
         assertTrue(json.contains("\"type\" : \"array\""));
 
+        flatJson = flatJson.replaceAll("\"operationId\" : \"[^\\\"]*\", ", "").replaceAll("\"summary\" : \"[^\\\"]*\", ", "");
+        log.info(flatJson);
         assertTrue(flatJson.contains(
-                "\"/hello/bye\" : { \"post\" : { \"consumes\" : [ \"application/xml\" ], \"produces\" : [ \"application/xml\" ], \"tags\" : [ \"/hello\" ],"));
+                "\"/hello/bye\" : { \"post\" : { \"tags\" : [ \"/hello\" ], \"consumes\" : [ \"application/xml\" ], \"produces\" : [ \"application/xml\" ], "));
         assertTrue(flatJson.contains(
-                "\"/tag/single\" : { \"get\" : { \"consumes\" : [ \"application/json\" ], \"produces\" : [ \"application/json\" ], \"tags\" : [ \"Organisation\" ],"));
+                "\"/tag/single\" : { \"get\" : { \"tags\" : [ \"Organisation\" ], \"consumes\" : [ \"application/json\" ], \"produces\" : [ \"application/json\" ], "));
         assertTrue(flatJson.contains(
-                "\"/tag/multiple/a\" : { \"get\" : { \"consumes\" : [ \"application/json\" ], \"produces\" : [ \"application/json\" ], \"tags\" : [ \"Organisation\", \"Group A\" ],"));
+                "\"/tag/multiple/a\" : { \"get\" : { \"tags\" : [ \"Organisation\", \"Group A\" ], \"consumes\" : [ \"application/json\" ], \"produces\" : [ \"application/json\" ], "));
         assertTrue(flatJson.contains(
-                "\"/tag/multiple/b\" : { \"get\" : { \"consumes\" : [ \"application/json\" ], \"produces\" : [ \"application/json\" ], \"tags\" : [ \"Organisation\", \"Group B\" ],"));
+                "\"/tag/multiple/b\" : { \"get\" : { \"tags\" : [ \"Organisation\", \"Group B\" ], \"consumes\" : [ \"application/json\" ], \"produces\" : [ \"application/json\" ], "));
         assertTrue(flatJson.contains(
                 "\"tags\" : [ { \"name\" : \"Group B\" }, { \"name\" : \"Organisation\" }, { \"name\" : \"Group A\" }, { \"name\" : \"/hello\" } ]"));
 
@@ -200,22 +193,17 @@ public class RestOpenApiReaderTest extends CamelTestSupport {
         config.setHost("localhost:8080");
         config.setSchemes(new String[] { "http" });
         config.setBasePath("/api");
-        Oas30Info info = new Oas30Info();
+        Info info = new Info();
         config.setInfo(info);
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
-        String flatJson = json.replace("\n", " ").replaceAll("\\s+", " ");
-
+        String json = Json.pretty(openApi);
         log.info(json);
+        json = json.replace("\n", " ").replaceAll("\\s+", " ");
 
         assertTrue(json.contains("\"url\" : \"http://localhost:8080/api\""));
         assertTrue(json.contains("\"/hello/bye\""));
@@ -224,20 +212,20 @@ public class RestOpenApiReaderTest extends CamelTestSupport {
         assertTrue(json.contains("\"/hello/hi/{name}\""));
         assertTrue(json.contains("\"type\" : \"number\""));
         assertTrue(json.contains("\"format\" : \"float\""));
-        assertTrue(json.contains("\"application/xml\" : \"<hello>Hi</hello>\""));
-        assertTrue(json.contains("\"x-example\" : \"Donald Duck\""));
-        assertTrue(json.contains("\"success\" : \"123\""));
-        assertTrue(json.contains("\"error\" : \"-1\""));
+        assertTrue(json.contains("\"example\" : \"<hello>Hi</hello>\""));
+        assertTrue(json.contains("\"example\" : \"Donald Duck\""));
+        assertTrue(json.contains("\"success\" : { \"value\" : \"123\" }"));
+        assertTrue(json.contains("\"error\" : { \"value\" : \"-1\" }"));
         assertTrue(json.contains("\"type\" : \"array\""));
         assertTrue(json.contains("\"format\" : \"date-time\""));
 
-        assertTrue(flatJson.contains("\"/hello/bye/{name}\" : { \"get\" : { \"tags\" : [ \"/hello\" ],"));
-        assertTrue(flatJson.matches(".*\"/tag/single\" : \\{ \"get\" : .* \"tags\" : \\[ \"Organisation\" ],.*"));
+        assertTrue(json.contains("\"/hello/bye/{name}\" : { \"get\" : { \"tags\" : [ \"/hello\" ],"));
+        assertTrue(json.matches(".*\"/tag/single\" : \\{ \"get\" : .* \"tags\" : \\[ \"Organisation\" ],.*"));
         assertTrue(
-                flatJson.matches(".*\"/tag/multiple/a\" : \\{ \"get\" : .* \"tags\" : \\[ \"Organisation\", \"Group A\" ],.*"));
+                json.matches(".*\"/tag/multiple/a\" : \\{ \"get\" : .* \"tags\" : \\[ \"Organisation\", \"Group A\" ],.*"));
         assertTrue(
-                flatJson.matches(".*\"/tag/multiple/b\" : \\{ \"get\" : .*\"tags\" : \\[ \"Organisation\", \"Group B\" ],.*"));
-        assertTrue(flatJson.contains(
+                json.matches(".*\"/tag/multiple/b\" : \\{ \"get\" : .*\"tags\" : \\[ \"Organisation\", \"Group B\" ],.*"));
+        assertTrue(json.contains(
                 "\"tags\" : [ { \"name\" : \"Group B\" }, { \"name\" : \"Organisation\" }, { \"name\" : \"Group A\" }, { \"name\" : \"/hello\" } ]"));
 
         context.stop();
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiSupportTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiSupportTest.java
index d8f6c8e226b..900c8ffd4d1 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiSupportTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiSupportTest.java
@@ -25,9 +25,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.stream.Stream;
 
-import io.apicurio.datamodels.core.models.common.Server;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Document;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Document;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.servers.Server;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.Arguments;
@@ -37,34 +36,14 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.params.provider.Arguments.arguments;
 import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verifyNoInteractions;
 
 public class RestOpenApiSupportTest {
 
-    @Test
-    public void shouldAdaptFromXForwardHeaders() {
-        Oas20Document doc = new Oas20Document();
-        doc.basePath = "/base";
-        final Oas20Document openApi = spy(doc);
-
-        final Map<String, Object> headers = new HashMap<>();
-        headers.put(RestOpenApiSupport.HEADER_X_FORWARDED_PREFIX, "/prefix");
-        headers.put(RestOpenApiSupport.HEADER_X_FORWARDED_HOST, "host");
-        headers.put(RestOpenApiSupport.HEADER_X_FORWARDED_PROTO, "http, HTTPS ");
-        RestOpenApiSupport.setupXForwardedHeaders(openApi, headers);
-
-        assertEquals("/prefix/base", openApi.basePath);
-        assertEquals("host", openApi.host);
-        assertTrue(openApi.schemes.contains("http"));
-        assertTrue(openApi.schemes.contains("https"));
-
-    }
-
     @Test
     public void shouldAdaptFromXForwardHeadersV3() {
-        Oas30Document doc = new Oas30Document();
-        doc.addServer("http://myhost/base", null);
-        final Oas30Document openApi = spy(doc);
+        OpenAPI doc = new OpenAPI();
+        doc.addServersItem(new Server().url("http://myhost/base"));
+        final OpenAPI openApi = spy(doc);
 
         final Map<String, Object> headers = new HashMap<>();
         headers.put(RestOpenApiSupport.HEADER_X_FORWARDED_PREFIX, "/prefix");
@@ -72,74 +51,44 @@ public class RestOpenApiSupportTest {
         headers.put(RestOpenApiSupport.HEADER_X_FORWARDED_PROTO, "http, HTTPS ");
         RestOpenApiSupport.setupXForwardedHeaders(openApi, headers);
 
-        assertEquals("http://host/prefix/base", openApi.getServers().get(0).url);
-        assertEquals("https://host/prefix/base", openApi.getServers().get(1).url);
+        assertEquals("http://host/prefix/base", openApi.getServers().get(0).getUrl());
+        assertEquals("https://host/prefix/base", openApi.getServers().get(1).getUrl());
 
     }
 
-    @ParameterizedTest
-    @MethodSource("basePathAndPrefixVariations")
-    public void shouldAdaptWithVaryingBasePathsAndPrefixes(
-            final String prefix, final String basePath,
-            final String expected) {
-        Oas20Document doc = new Oas20Document();
-        doc.basePath = basePath;
-        final Oas20Document openApi = spy(doc);
-
-        final Map<String, Object> headers = new HashMap<>();
-        headers.put(RestOpenApiSupport.HEADER_X_FORWARDED_PREFIX, prefix);
-        RestOpenApiSupport.setupXForwardedHeaders(openApi, headers);
-
-        assertEquals(openApi.basePath, expected);
-    }
-
     @ParameterizedTest
     @MethodSource("basePathAndPrefixVariations")
     public void shouldAdaptWithVaryingBasePathsAndPrefixesV3(
             final String prefix, final String basePath,
             final String expected) {
-        Oas30Document doc = new Oas30Document();
+        OpenAPI doc = new OpenAPI();
         if (basePath != null) {
-            doc.addServer("http://myhost/" + basePath, null);
+            doc.addServersItem(new Server().url("http://myhost/" + basePath));
         } else {
-            doc.addServer("http://myhost/", null);
+            doc.addServersItem(new Server().url("http://myhost/"));
         }
-        final Oas30Document openApi = spy(doc);
+        final OpenAPI openApi = spy(doc);
 
         final Map<String, Object> headers = new HashMap<>();
         headers.put(RestOpenApiSupport.HEADER_X_FORWARDED_PREFIX, prefix);
         RestOpenApiSupport.setupXForwardedHeaders(openApi, headers);
 
-        assertEquals(openApi.getServers().get(0).url, expected);
-    }
-
-    @ParameterizedTest
-    @MethodSource("schemeVariations")
-    public void shouldAdaptWithVaryingSchemes(final String xForwardedScheme, final String[] expected) {
-        final Oas20Document openApi = spy(new Oas20Document());
-
-        RestOpenApiSupport.setupXForwardedHeaders(openApi,
-                Collections.singletonMap(RestOpenApiSupport.HEADER_X_FORWARDED_PROTO, xForwardedScheme));
-
-        for (final String scheme : expected) {
-            assertTrue(openApi.schemes.contains(scheme));
-        }
-
+        assertEquals(openApi.getServers().get(0).getUrl(), expected);
     }
 
     @ParameterizedTest
     @MethodSource("schemeVariations")
     public void shouldAdaptWithVaryingSchemesV3(final String xForwardedScheme, final String[] expected) {
-        final Oas30Document openApi = spy(new Oas30Document());
+        final OpenAPI openApi = spy(new OpenAPI());
 
         RestOpenApiSupport.setupXForwardedHeaders(openApi,
                 Collections.singletonMap(RestOpenApiSupport.HEADER_X_FORWARDED_PROTO, xForwardedScheme));
 
         List<String> schemas = new ArrayList<String>();
-        if (openApi.servers != null) {
-            for (Server server : openApi.servers) {
+        if (openApi.getServers() != null) {
+            for (Server server : openApi.getServers()) {
                 try {
-                    URL url = new URL(server.url);
+                    URL url = new URL(server.getUrl());
                     schemas.add(url.getProtocol());
                 } catch (MalformedURLException e) {
 
@@ -149,16 +98,6 @@ public class RestOpenApiSupportTest {
         for (final String scheme : expected) {
             assertTrue(schemas.contains(scheme));
         }
-
-    }
-
-    @Test
-    public void shouldNotAdaptFromXForwardHeadersWhenNoHeadersSpecified() {
-        final Oas20Document openApi = spy(new Oas20Document());
-
-        RestOpenApiSupport.setupXForwardedHeaders(openApi, Collections.emptyMap());
-
-        verifyNoInteractions(openApi);
     }
 
     static Stream<Arguments> basePathAndPrefixVariations() {
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiV2SecuritySchemesTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiV2SecuritySchemesTest.java
index 306c5d62e3a..44a0a626abc 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiV2SecuritySchemesTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiV2SecuritySchemesTest.java
@@ -16,11 +16,7 @@
  */
 package org.apache.camel.openapi;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
+import io.swagger.v3.oas.models.OpenAPI;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
 import org.apache.camel.test.junit5.CamelTestSupport;
@@ -76,27 +72,23 @@ public class RestOpenApiV2SecuritySchemesTest extends CamelTestSupport {
         config.setVersion("2.0");
 
         RestOpenApiReader reader = new RestOpenApiReader();
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = RestOpenApiSupport.getJsonFromOpenAPI(openApi, config);
 
         log.info(json);
 
         json = json.replace("\n", " ").replaceAll("\\s+", " ");
 
-        assertTrue(json.contains("\"petstore_auth_implicit\" : { \"flow\" : \"implicit\", \"authorizationUrl\" : " +
-                                 "\"https://petstore.swagger.io/oauth/dialog\", \"type\" : \"oauth2\" }"));
-        assertTrue(json.contains("\"oauth_password\" : { \"flow\" : \"password\", \"tokenUrl\" : " +
-                                 "\"https://petstore.swagger.io/oauth/token\", \"type\" : \"oauth2\" }"));
-        assertTrue(json.contains("\"oauth2_accessCode\" : { \"flow\" : \"accessCode\", \"authorizationUrl\" : " +
+        assertTrue(json.contains("\"petstore_auth_implicit\" : { \"type\" : \"oauth2\", \"authorizationUrl\" : " +
+                                 "\"https://petstore.swagger.io/oauth/dialog\", \"flow\" : \"implicit\" }"));
+        assertTrue(json.contains("\"oauth_password\" : { \"type\" : \"oauth2\", \"tokenUrl\" : " +
+                                 "\"https://petstore.swagger.io/oauth/token\", \"flow\" : \"password\" }"));
+        assertTrue(json.contains("\"oauth2_accessCode\" : { \"type\" : \"oauth2\", \"authorizationUrl\" : " +
                                  "\"https://petstore.swagger.io/oauth/dialog\", \"tokenUrl\" : " +
-                                 "\"https://petstore.swagger.io/oauth/token\", \"type\" : \"oauth2\" }"));
+                                 "\"https://petstore.swagger.io/oauth/token\", \"flow\" : \"accessCode\" }"));
         assertTrue(
                 json.contains("\"api_key_header\" : { \"type\" : \"apiKey\", \"name\" : \"myHeader\", \"in\" : \"header\" }"));
         assertTrue(json.contains("\"api_key_query\" : { \"type\" : \"apiKey\", \"name\" : \"myQuery\", \"in\" : \"query\" }"));
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiV3SecuritySchemesTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiV3SecuritySchemesTest.java
index fcd14f25e78..46704f3f095 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiV3SecuritySchemesTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/RestOpenApiV3SecuritySchemesTest.java
@@ -16,11 +16,7 @@
  */
 package org.apache.camel.openapi;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
+import io.swagger.v3.oas.models.OpenAPI;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
 import org.apache.camel.test.junit5.CamelTestSupport;
@@ -82,36 +78,32 @@ public class RestOpenApiV3SecuritySchemesTest extends CamelTestSupport {
         config.setLicenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html");
 
         RestOpenApiReader reader = new RestOpenApiReader();
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
-
+        String json = io.swagger.v3.core.util.Json.pretty(openApi);
         log.info(json);
-
         json = json.replace("\n", " ").replaceAll("\\s+", " ");
 
-        assertTrue(json.contains("\"petstore_auth_implicit\" : { \"flows\" : { \"implicit\" : { \"authorizationUrl\" : " +
+        assertTrue(json.contains(
+                "\"petstore_auth_implicit\" : { \"type\" : \"oauth2\", \"flows\" : { \"implicit\" : { \"authorizationUrl\" : " +
                                  "\"https://petstore.swagger.io/oauth/dialog\", \"refreshUrl\" : " +
-                                 "\"https://petstore.swagger.io/oauth/refresh\" } }, \"type\" : \"oauth2\" }"));
-        assertTrue(json.contains("\"oauth_password\" : { \"flows\" : { \"password\" : { \"tokenUrl\" : " +
-                                 "\"https://petstore.swagger.io/oauth/token\" } }, \"type\" : \"oauth2\" }"));
-        assertTrue(json.contains("\"oauth2_accessCode\" : { \"flows\" : { \"authorizationCode\" : { \"authorizationUrl\" : " +
+                                 "\"https://petstore.swagger.io/oauth/refresh\" } } }"));
+        assertTrue(
+                json.contains("\"oauth_password\" : { \"type\" : \"oauth2\", \"flows\" : { \"password\" : { \"tokenUrl\" : " +
+                              "\"https://petstore.swagger.io/oauth/token\" } } }"));
+        assertTrue(json.contains(
+                "\"oauth2_accessCode\" : { \"type\" : \"oauth2\", \"flows\" : { \"authorizationCode\" : { \"authorizationUrl\" : "
+                                 +
                                  "\"https://petstore.swagger.io/oauth/dialog\", \"tokenUrl\" : " +
-                                 "\"https://petstore.swagger.io/oauth/token\" } }, \"type\" : \"oauth2\" }"));
+                                 "\"https://petstore.swagger.io/oauth/token\" } } }"));
         assertTrue(
                 json.contains("\"api_key_header\" : { \"type\" : \"apiKey\", \"name\" : \"myHeader\", \"in\" : \"header\" }"));
         assertTrue(json.contains("\"api_key_query\" : { \"type\" : \"apiKey\", \"name\" : \"myQuery\", \"in\" : \"query\" }"));
         assertTrue(json.contains("\"api_key_cookie\" : { \"type\" : \"apiKey\", \"description\" : \"API Key using cookie\", " +
                                  "\"name\" : \"myCookie\", \"in\" : \"cookie\" }"));
-        assertTrue(
-                json.contains("\"openIdConnect_auth\" : { \"openIdConnectUrl\" : " +
-                              "\"https://petstore.swagger.io/openidconnect\", \"type\" : \"openIdConnect\" }"));
+
         assertTrue(json.contains("\"mutualTLS_auth\" : { \"type\" : \"mutualTLS\" }"));
     }
 
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 64ef06289fd..b5fe5cf2b16 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
@@ -16,11 +16,7 @@
  */
 package org.apache.camel.openapi;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
+import io.swagger.v3.oas.models.OpenAPI;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
@@ -110,32 +106,30 @@ public class RestOpenApiV3XOfTest extends CamelTestSupport {
         config.setLicenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html");
 
         RestOpenApiReader reader = new RestOpenApiReader();
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = io.swagger.v3.core.util.Json.pretty(openApi);
 
         LOG.info(json);
+
         json = json.replace("\n", " ").replaceAll("\\s+", " ");
 
         assertTrue(json.contains(
-                "\"XOfFormA\" : { \"type\" : \"object\", \"properties\" : { \"code\" : { \"type\" : \"string\" }, \"a\" : { \"type\" : \"string\" }, \"b\" : { \"format\" : \"int32\", \"type\" : \"integer\" } },"));
+                "\"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\" : { \"format\" : \"int32\", \"type\" : \"integer\" }, \"y\" : { \"type\" : \"string\" } },"));
+                "\"XOfFormB\" : { \"type\" : \"object\", \"properties\" : { \"code\" : { \"type\" : \"string\" }, \"x\" : { \"type\" : \"integer\", \"format\" : \"int32\" }, \"y\" : { \"type\" : \"string\" } },"));
 
         assertTrue(json.contains(
                 "\"OneOfFormWrapper\" : { \"type\" : \"object\", \"properties\" : { \"formType\" : { \"type\" : \"string\" }, \"form\" : { \"$ref\" : \"#/components/schemas/OneOfForm\" } },"));
         assertTrue(json.contains(
-                "\"OneOfForm\" : { \"oneOf\" : [ { \"$ref\" : \"#/components/schemas/XOfFormA\" }, { \"$ref\" : \"#/components/schemas/XOfFormB\" } ],"
-                                 +
-                                 " \"discriminator\" : { \"propertyName\" : \"code\", \"mapping\" : " +
-                                 "{ \"a-123\" : \"#/components/schemas/org.apache.camel.openapi.model.XOfFormA\", \"b-456\" : \"#/components/schemas/org.apache.camel.openapi.model.XOfFormB\" } },"));
+                "\"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();
     }
@@ -151,16 +145,12 @@ public class RestOpenApiV3XOfTest extends CamelTestSupport {
         config.setLicenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html");
 
         RestOpenApiReader reader = new RestOpenApiReader();
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = io.swagger.v3.core.util.Json.pretty(openApi);
 
         LOG.info(json);
         json = json.replace("\n", " ").replaceAll("\\s+", " ");
@@ -168,7 +158,7 @@ public class RestOpenApiV3XOfTest extends CamelTestSupport {
         assertTrue(json.contains(
                 "\"AllOfFormWrapper\" : { \"type\" : \"object\", \"properties\" : { \"fullForm\" : { \"$ref\" : \"#/components/schemas/AllOfForm\" } },"));
         assertTrue(json.contains(
-                "\"AllOfForm\" : { \"allOf\" : [ { \"$ref\" : \"#/components/schemas/XOfFormA\" }, { \"$ref\" : \"#/components/schemas/XOfFormB\" } ],"));
+                "\"allOf\" : [ { \"$ref\" : \"#/components/schemas/XOfFormA\" }, { \"$ref\" : \"#/components/schemas/XOfFormB\" } ]"));
 
         context.stop();
     }
@@ -184,16 +174,12 @@ public class RestOpenApiV3XOfTest extends CamelTestSupport {
         config.setLicenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html");
 
         RestOpenApiReader reader = new RestOpenApiReader();
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = io.swagger.v3.core.util.Json.pretty(openApi);
 
         LOG.info(json);
         json = json.replace("\n", " ").replaceAll("\\s+", " ");
@@ -201,7 +187,7 @@ public class RestOpenApiV3XOfTest extends CamelTestSupport {
         assertTrue(json.contains(
                 "\"AnyOfFormWrapper\" : { \"type\" : \"object\", \"properties\" : { \"formElements\" : { \"$ref\" : \"#/components/schemas/AnyOfForm\" } },"));
         assertTrue(json.contains(
-                "\"AnyOfForm\" : { \"anyOf\" : [ { \"$ref\" : \"#/components/schemas/XOfFormA\" }, { \"$ref\" : \"#/components/schemas/XOfFormB\" } ],"));
+                "\"anyOf\" : [ { \"$ref\" : \"#/components/schemas/XOfFormA\" }, { \"$ref\" : \"#/components/schemas/XOfFormB\" } ]"));
 
         context.stop();
     }
diff --git a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/SpringRestOpenApiReaderModelApiSecurityTest.java b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/SpringRestOpenApiReaderModelApiSecurityTest.java
index b1214d52bb6..3a7605b290e 100644
--- a/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/SpringRestOpenApiReaderModelApiSecurityTest.java
+++ b/components/camel-openapi-java/src/test/java/org/apache/camel/openapi/SpringRestOpenApiReaderModelApiSecurityTest.java
@@ -16,11 +16,7 @@
  */
 package org.apache.camel.openapi;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.openapi.models.OasDocument;
+import io.swagger.v3.oas.models.OpenAPI;
 import org.apache.camel.impl.engine.DefaultClassResolver;
 import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
 import org.junit.jupiter.api.Test;
@@ -54,15 +50,11 @@ public class SpringRestOpenApiReaderModelApiSecurityTest extends CamelSpringTest
         config.setVersion("2.0");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = RestOpenApiSupport.getJsonFromOpenAPI(openApi, config);
 
         log.info(json);
 
@@ -98,15 +90,11 @@ public class SpringRestOpenApiReaderModelApiSecurityTest extends CamelSpringTest
         config.setLicenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
         RestOpenApiReader reader = new RestOpenApiReader();
 
-        OasDocument openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
+        OpenAPI openApi = reader.read(context, context.getRestDefinitions(), config, context.getName(),
                 new DefaultClassResolver());
         assertNotNull(openApi);
 
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationFeature.INDENT_OUTPUT);
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        Object dump = Library.writeNode(openApi);
-        String json = mapper.writeValueAsString(dump);
+        String json = io.swagger.v3.core.util.Json.pretty(openApi);
 
         log.info(json);
 
@@ -123,7 +111,6 @@ public class SpringRestOpenApiReaderModelApiSecurityTest extends CamelSpringTest
         assertTrue(json.contains("\"api_key\" : [ ]"));
         assertTrue(json.contains("\"description\" : \"The user returned\""));
         assertTrue(json.contains("\"$ref\" : \"#/components/schemas/User\""));
-        assertTrue(json.contains("\"x-className\""));
         assertTrue(json.contains("\"format\" : \"org.apache.camel.openapi.User\""));
         assertTrue(json.contains("\"type\" : \"string\""));
         assertTrue(json.contains("\"format\" : \"date\""));
diff --git a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V2SchemaForComplexTypesRequest.json b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V2SchemaForComplexTypesRequest.json
index 99276fa67d1..54bcc6a854b 100644
--- a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V2SchemaForComplexTypesRequest.json
+++ b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V2SchemaForComplexTypesRequest.json
@@ -6,15 +6,17 @@
   "paths" : {
     "/complexRequest" : {
       "post" : {
+        "summary" : "Demo complex request type",
+        "operationId" : "verb",
         "consumes" : [ "application/json" ],
         "produces" : [ "text/plain" ],
         "parameters" : [ {
+          "in" : "body",
           "name" : "body",
+          "required" : true,
           "schema" : {
             "$ref" : "#/definitions/SampleComplexRequestType"
-          },
-          "in" : "body",
-          "required" : true
+          }
         } ],
         "responses" : {
           "200" : {
@@ -24,13 +26,35 @@
             }
           }
         },
-        "operationId" : "verb",
-        "summary" : "Demo complex request type",
         "x-camelContextId" : "camel"
       }
     }
   },
+  "securityDefinitions" : {
+    "global" : {
+      "type" : "oauth2",
+      "authorizationUrl" : "https://AUTHORIZATION_URL",
+      "tokenUrl" : "https://TOKEN_URL",
+      "flow" : "accessCode",
+      "scopes" : {
+        "groups" : "Required scopes for Camel REST APIs"
+      }
+    }
+  },
   "definitions" : {
+    "SampleComplexResponseType_InnerClass" : {
+      "type" : "object",
+      "properties" : {
+        "doubleField" : {
+          "type" : "number",
+          "format" : "double"
+        }
+      },
+      "x-className" : {
+        "format" : "org.apache.camel.openapi.model.SampleComplexResponseType$InnerClass",
+        "type" : "string"
+      }
+    },
     "CustomData" : {
       "type" : "object",
       "properties" : {
@@ -44,33 +68,36 @@
       }
     },
     "SampleComplexRequestType" : {
-      "required" : [ "mapOfStrings", "requestField1" ],
       "type" : "object",
+      "required" : [ "mapOfStrings", "requestField1" ],
       "properties" : {
-        "data" : {
-          "$ref" : "#/definitions/CustomData"
+        "requestField1" : {
+          "type" : "string"
         },
-        "listOfData" : {
-          "type" : "array",
-          "items" : {
-            "$ref" : "#/definitions/CustomData"
-          }
+        "requestField2" : {
+          "type" : "string"
         },
-        "listOfListOfData" : {
+        "listOfStrings" : {
           "type" : "array",
           "items" : {
-            "type" : "array",
-            "items" : {
-              "$ref" : "#/definitions/CustomData"
-            }
+            "type" : "string"
           }
         },
+        "data" : {
+          "$ref" : "#/definitions/CustomData"
+        },
         "mapOfData" : {
           "type" : "object",
           "additionalProperties" : {
             "$ref" : "#/definitions/CustomData"
           }
         },
+        "arrayOfString" : {
+          "type" : "array",
+          "items" : {
+            "type" : "string"
+          }
+        },
         "mapOfMapOfData" : {
           "type" : "object",
           "additionalProperties" : {
@@ -80,22 +107,22 @@
             }
           }
         },
-        "requestField1" : {
-          "type" : "string"
-        },
-        "requestField2" : {
-          "type" : "string"
+        "innerClass" : {
+          "$ref" : "#/definitions/SampleComplexRequestType_InnerClass"
         },
-        "listOfStrings" : {
+        "listOfListOfData" : {
           "type" : "array",
           "items" : {
-            "type" : "string"
+            "type" : "array",
+            "items" : {
+              "$ref" : "#/definitions/CustomData"
+            }
           }
         },
-        "arrayOfString" : {
+        "listOfData" : {
           "type" : "array",
           "items" : {
-            "type" : "string"
+            "$ref" : "#/definitions/CustomData"
           }
         },
         "mapOfStrings" : {
@@ -105,11 +132,8 @@
           }
         },
         "timeUnit" : {
-          "enum" : [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ],
-          "type" : "string"
-        },
-        "innerClass" : {
-          "$ref" : "#/definitions/SampleComplexRequestType_InnerClass"
+          "type" : "string",
+          "enum" : [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ]
         }
       },
       "x-className" : {
@@ -121,38 +145,14 @@
       "type" : "object",
       "properties" : {
         "longField" : {
-          "format" : "int64",
-          "type" : "integer"
+          "type" : "integer",
+          "format" : "int64"
         }
       },
       "x-className" : {
         "format" : "org.apache.camel.openapi.model.SampleComplexRequestType$InnerClass",
         "type" : "string"
       }
-    },
-    "SampleComplexResponseType_InnerClass" : {
-      "type" : "object",
-      "properties" : {
-        "doubleField" : {
-          "format" : "double",
-          "type" : "number"
-        }
-      },
-      "x-className" : {
-        "format" : "org.apache.camel.openapi.model.SampleComplexResponseType$InnerClass",
-        "type" : "string"
-      }
-    }
-  },
-  "securityDefinitions" : {
-    "global" : {
-      "flow" : "accessCode",
-      "authorizationUrl" : "https://AUTHORIZATION_URL",
-      "tokenUrl" : "https://TOKEN_URL",
-      "scopes" : {
-        "groups" : "Required scopes for Camel REST APIs"
-      },
-      "type" : "oauth2"
     }
   }
-}
\ No newline at end of file
+}
diff --git a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V2SchemaForComplexTypesRequestWithSchemaAnnotation.json b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V2SchemaForComplexTypesRequestWithSchemaAnnotation.json
index dd744b9aa90..d82c34fab19 100644
--- a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V2SchemaForComplexTypesRequestWithSchemaAnnotation.json
+++ b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V2SchemaForComplexTypesRequestWithSchemaAnnotation.json
@@ -6,15 +6,17 @@
   "paths" : {
     "/complexRequestWithSchemaAnnotation" : {
       "post" : {
+        "summary" : "Demo complex request type",
+        "operationId" : "verb",
         "consumes" : [ "application/json" ],
         "produces" : [ "text/plain" ],
         "parameters" : [ {
+          "in" : "body",
           "name" : "body",
+          "required" : true,
           "schema" : {
             "$ref" : "#/definitions/sampleRequestWithSchema"
-          },
-          "in" : "body",
-          "required" : true
+          }
         } ],
         "responses" : {
           "200" : {
@@ -24,31 +26,28 @@
             }
           }
         },
-        "operationId" : "verb",
-        "summary" : "Demo complex request type",
         "x-camelContextId" : "camel"
       }
     }
   },
-  "definitions" : {
-    "customData" : {
-      "type" : "object",
-      "properties" : {
-        "customDataField" : {
-          "type" : "string"
-        }
-      },
-      "x-className" : {
-        "format" : "org.apache.camel.openapi.model.CustomDataWithSchemaAnnotation",
-        "type" : "string"
+  "securityDefinitions" : {
+    "global" : {
+      "type" : "oauth2",
+      "authorizationUrl" : "https://AUTHORIZATION_URL",
+      "tokenUrl" : "https://TOKEN_URL",
+      "flow" : "accessCode",
+      "scopes" : {
+        "groups" : "Required scopes for Camel REST APIs"
       }
-    },
+    }
+  },
+  "definitions" : {
     "requestInner" : {
       "type" : "object",
       "properties" : {
         "longField" : {
-          "format" : "int64",
-          "type" : "integer"
+          "type" : "integer",
+          "format" : "int64"
         }
       },
       "x-className" : {
@@ -57,33 +56,36 @@
       }
     },
     "sampleRequestWithSchema" : {
-      "required" : [ "mapOfStrings", "requestField1" ],
       "type" : "object",
+      "required" : [ "mapOfStrings", "requestField1" ],
       "properties" : {
-        "data" : {
-          "$ref" : "#/definitions/customData"
+        "requestField1" : {
+          "type" : "string"
         },
-        "listOfData" : {
-          "type" : "array",
-          "items" : {
-            "$ref" : "#/definitions/customData"
-          }
+        "requestField2" : {
+          "type" : "string"
         },
-        "listOfListOfData" : {
+        "listOfStrings" : {
           "type" : "array",
           "items" : {
-            "type" : "array",
-            "items" : {
-              "$ref" : "#/definitions/customData"
-            }
+            "type" : "string"
           }
         },
+        "data" : {
+          "$ref" : "#/definitions/customData"
+        },
         "mapOfData" : {
           "type" : "object",
           "additionalProperties" : {
             "$ref" : "#/definitions/customData"
           }
         },
+        "arrayOfString" : {
+          "type" : "array",
+          "items" : {
+            "type" : "string"
+          }
+        },
         "mapOfMapOfData" : {
           "type" : "object",
           "additionalProperties" : {
@@ -93,22 +95,22 @@
             }
           }
         },
-        "requestField1" : {
-          "type" : "string"
-        },
-        "requestField2" : {
-          "type" : "string"
+        "innerClass" : {
+          "$ref" : "#/definitions/requestInner"
         },
-        "listOfStrings" : {
+        "listOfListOfData" : {
           "type" : "array",
           "items" : {
-            "type" : "string"
+            "type" : "array",
+            "items" : {
+              "$ref" : "#/definitions/customData"
+            }
           }
         },
-        "arrayOfString" : {
+        "listOfData" : {
           "type" : "array",
           "items" : {
-            "type" : "string"
+            "$ref" : "#/definitions/customData"
           }
         },
         "mapOfStrings" : {
@@ -118,11 +120,8 @@
           }
         },
         "timeUnit" : {
-          "enum" : [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ],
-          "type" : "string"
-        },
-        "innerClass" : {
-          "$ref" : "#/definitions/requestInner"
+          "type" : "string",
+          "enum" : [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ]
         }
       },
       "x-className" : {
@@ -130,12 +129,24 @@
         "type" : "string"
       }
     },
+    "customData" : {
+      "type" : "object",
+      "properties" : {
+        "customDataField" : {
+          "type" : "string"
+        }
+      },
+      "x-className" : {
+        "format" : "org.apache.camel.openapi.model.CustomDataWithSchemaAnnotation",
+        "type" : "string"
+      }
+    },
     "responseInner" : {
       "type" : "object",
       "properties" : {
         "doubleField" : {
-          "format" : "double",
-          "type" : "number"
+          "type" : "number",
+          "format" : "double"
         }
       },
       "x-className" : {
@@ -143,16 +154,5 @@
         "type" : "string"
       }
     }
-  },
-  "securityDefinitions" : {
-    "global" : {
-      "flow" : "accessCode",
-      "authorizationUrl" : "https://AUTHORIZATION_URL",
-      "tokenUrl" : "https://TOKEN_URL",
-      "scopes" : {
-        "groups" : "Required scopes for Camel REST APIs"
-      },
-      "type" : "oauth2"
-    }
   }
 }
diff --git a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V2SchemaForComplexTypesResponse.json b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V2SchemaForComplexTypesResponse.json
index 4193eab11b5..c5fc9b0ede1 100644
--- a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V2SchemaForComplexTypesResponse.json
+++ b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V2SchemaForComplexTypesResponse.json
@@ -6,15 +6,17 @@
   "paths" : {
     "/complexResponse" : {
       "get" : {
+        "summary" : "Demo complex response type",
+        "operationId" : "verb",
         "consumes" : [ "application/json" ],
         "produces" : [ "application/json" ],
         "parameters" : [ {
+          "in" : "body",
           "name" : "body",
+          "required" : true,
           "schema" : {
             "$ref" : "#/definitions/SampleComplexRequestType_InnerClass"
-          },
-          "in" : "body",
-          "required" : true
+          }
         } ],
         "responses" : {
           "200" : {
@@ -24,35 +26,41 @@
             }
           }
         },
-        "operationId" : "verb",
-        "summary" : "Demo complex response type",
         "x-camelContextId" : "camel"
       }
     }
   },
+  "securityDefinitions" : {
+    "global" : {
+      "type" : "oauth2",
+      "authorizationUrl" : "https://AUTHORIZATION_URL",
+      "tokenUrl" : "https://TOKEN_URL",
+      "flow" : "accessCode",
+      "scopes" : {
+        "groups" : "Required scopes for Camel REST APIs"
+      }
+    }
+  },
   "definitions" : {
-    "SampleComplexRequestType_InnerClass" : {
+    "SampleComplexResponseType_InnerClass" : {
       "type" : "object",
       "properties" : {
-        "longField" : {
-          "format" : "int64",
-          "type" : "integer"
+        "doubleField" : {
+          "type" : "number",
+          "format" : "double"
         }
       },
       "x-className" : {
-        "format" : "org.apache.camel.openapi.model.SampleComplexRequestType$InnerClass",
+        "format" : "org.apache.camel.openapi.model.SampleComplexResponseType$InnerClass",
         "type" : "string"
       }
     },
     "SampleComplexResponseType" : {
-      "required" : [ "arrayOfStrings", "responseField1" ],
       "type" : "object",
+      "required" : [ "arrayOfStrings", "responseField1" ],
       "properties" : {
-        "responseField1" : {
-          "type" : "string"
-        },
-        "responseField2" : {
-          "type" : "string"
+        "innerClass" : {
+          "$ref" : "#/definitions/SampleComplexResponseType_InnerClass"
         },
         "arrayOfStrings" : {
           "type" : "array",
@@ -61,11 +69,14 @@
           }
         },
         "month" : {
-          "enum" : [ "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER" ],
+          "type" : "string",
+          "enum" : [ "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER" ]
+        },
+        "responseField2" : {
           "type" : "string"
         },
-        "innerClass" : {
-          "$ref" : "#/definitions/SampleComplexResponseType_InnerClass"
+        "responseField1" : {
+          "type" : "string"
         }
       },
       "x-className" : {
@@ -73,29 +84,18 @@
         "type" : "string"
       }
     },
-    "SampleComplexResponseType_InnerClass" : {
+    "SampleComplexRequestType_InnerClass" : {
       "type" : "object",
       "properties" : {
-        "doubleField" : {
-          "format" : "double",
-          "type" : "number"
+        "longField" : {
+          "type" : "integer",
+          "format" : "int64"
         }
       },
       "x-className" : {
-        "format" : "org.apache.camel.openapi.model.SampleComplexResponseType$InnerClass",
+        "format" : "org.apache.camel.openapi.model.SampleComplexRequestType$InnerClass",
         "type" : "string"
       }
     }
-  },
-  "securityDefinitions" : {
-    "global" : {
-      "flow" : "accessCode",
-      "authorizationUrl" : "https://AUTHORIZATION_URL",
-      "tokenUrl" : "https://TOKEN_URL",
-      "scopes" : {
-        "groups" : "Required scopes for Camel REST APIs"
-      },
-      "type" : "oauth2"
-    }
   }
 }
\ No newline at end of file
diff --git a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V2SchemaForComplexTypesResponseWithSchemaAnnotation.json b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V2SchemaForComplexTypesResponseWithSchemaAnnotation.json
index 4823e969630..1f31689ae3b 100644
--- a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V2SchemaForComplexTypesResponseWithSchemaAnnotation.json
+++ b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V2SchemaForComplexTypesResponseWithSchemaAnnotation.json
@@ -6,15 +6,17 @@
   "paths" : {
     "/complexResponseWithSchemaAnnotation" : {
       "get" : {
+        "summary" : "Demo complex response type",
+        "operationId" : "verb",
         "consumes" : [ "application/json" ],
         "produces" : [ "application/json" ],
         "parameters" : [ {
+          "in" : "body",
           "name" : "body",
+          "required" : true,
           "schema" : {
             "$ref" : "#/definitions/SampleComplexRequestType_InnerClass"
-          },
-          "in" : "body",
-          "required" : true
+          }
         } ],
         "responses" : {
           "200" : {
@@ -24,23 +26,48 @@
             }
           }
         },
-        "operationId" : "verb",
-        "summary" : "Demo complex response type",
         "x-camelContextId" : "camel"
       }
     }
   },
+  "securityDefinitions" : {
+    "global" : {
+      "type" : "oauth2",
+      "authorizationUrl" : "https://AUTHORIZATION_URL",
+      "tokenUrl" : "https://TOKEN_URL",
+      "flow" : "accessCode",
+      "scopes" : {
+        "groups" : "Required scopes for Camel REST APIs"
+      }
+    }
+  },
   "definitions" : {
-    "SampleComplexRequestType_InnerClass" : {
+    "sampleResponseWithSchema" : {
       "type" : "object",
+      "required" : [ "arrayOfStrings", "responseField1" ],
       "properties" : {
-        "longField" : {
-          "format" : "int64",
-          "type" : "integer"
+        "innerClass" : {
+          "$ref" : "#/definitions/responseInner"
+        },
+        "arrayOfStrings" : {
+          "type" : "array",
+          "items" : {
+            "type" : "string"
+          }
+        },
+        "month" : {
+          "type" : "string",
+          "enum" : [ "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER" ]
+        },
+        "responseField2" : {
+          "type" : "string"
+        },
+        "responseField1" : {
+          "type" : "string"
         }
       },
       "x-className" : {
-        "format" : "org.apache.camel.openapi.model.SampleComplexRequestType$InnerClass",
+        "format" : "org.apache.camel.openapi.model.SampleComplexResponseTypeWithSchemaAnnotation",
         "type" : "string"
       }
     },
@@ -48,8 +75,8 @@
       "type" : "object",
       "properties" : {
         "doubleField" : {
-          "format" : "double",
-          "type" : "number"
+          "type" : "number",
+          "format" : "double"
         }
       },
       "x-className" : {
@@ -57,45 +84,18 @@
         "type" : "string"
       }
     },
-    "sampleResponseWithSchema" : {
-      "required" : [ "arrayOfStrings", "responseField1" ],
+    "SampleComplexRequestType_InnerClass" : {
       "type" : "object",
       "properties" : {
-        "responseField1" : {
-          "type" : "string"
-        },
-        "responseField2" : {
-          "type" : "string"
-        },
-        "arrayOfStrings" : {
-          "type" : "array",
-          "items" : {
-            "type" : "string"
-          }
-        },
-        "month" : {
-          "enum" : [ "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER" ],
-          "type" : "string"
-        },
-        "innerClass" : {
-          "$ref" : "#/definitions/responseInner"
+        "longField" : {
+          "type" : "integer",
+          "format" : "int64"
         }
       },
       "x-className" : {
-        "format" : "org.apache.camel.openapi.model.SampleComplexResponseTypeWithSchemaAnnotation",
+        "format" : "org.apache.camel.openapi.model.SampleComplexRequestType$InnerClass",
         "type" : "string"
       }
     }
-  },
-  "securityDefinitions" : {
-    "global" : {
-      "flow" : "accessCode",
-      "authorizationUrl" : "https://AUTHORIZATION_URL",
-      "tokenUrl" : "https://TOKEN_URL",
-      "scopes" : {
-        "groups" : "Required scopes for Camel REST APIs"
-      },
-      "type" : "oauth2"
-    }
   }
 }
diff --git a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V3SchemaForComplexTypesRequest.json b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V3SchemaForComplexTypesRequest.json
index 7abf17480b3..870499eab05 100644
--- a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V3SchemaForComplexTypesRequest.json
+++ b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V3SchemaForComplexTypesRequest.json
@@ -6,6 +6,8 @@
   "paths" : {
     "/complexRequest" : {
       "post" : {
+        "summary" : "Demo complex request type",
+        "operationId" : "verb",
         "requestBody" : {
           "description" : "",
           "content" : {
@@ -19,24 +21,35 @@
         },
         "responses" : {
           "200" : {
+            "description" : "Receives a complex object as parameter",
             "content" : {
               "text/plain" : {
                 "schema" : {
                   "$ref" : "#/components/schemas/SampleComplexResponseType_InnerClass"
                 }
               }
-            },
-            "description" : "Receives a complex object as parameter"
+            }
           }
         },
-        "operationId" : "verb",
-        "summary" : "Demo complex request type",
         "x-camelContextId" : "camel"
       }
     }
   },
   "components" : {
     "schemas" : {
+      "SampleComplexResponseType_InnerClass" : {
+        "type" : "object",
+        "properties" : {
+          "doubleField" : {
+            "type" : "number",
+            "format" : "double"
+          }
+        },
+        "x-className" : {
+          "format" : "org.apache.camel.openapi.model.SampleComplexResponseType$InnerClass",
+          "type" : "string"
+        }
+      },
       "CustomData" : {
         "type" : "object",
         "properties" : {
@@ -111,8 +124,8 @@
             }
           },
           "timeUnit" : {
-            "enum" : [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ],
-            "type" : "string"
+            "type" : "string",
+            "enum" : [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ]
           },
           "innerClass" : {
             "$ref" : "#/components/schemas/SampleComplexRequestType_InnerClass"
@@ -127,31 +140,19 @@
         "type" : "object",
         "properties" : {
           "longField" : {
-            "format" : "int64",
-            "type" : "integer"
+            "type" : "integer",
+            "format" : "int64"
           }
         },
         "x-className" : {
           "format" : "org.apache.camel.openapi.model.SampleComplexRequestType$InnerClass",
           "type" : "string"
         }
-      },
-      "SampleComplexResponseType_InnerClass" : {
-        "type" : "object",
-        "properties" : {
-          "doubleField" : {
-            "format" : "double",
-            "type" : "number"
-          }
-        },
-        "x-className" : {
-          "format" : "org.apache.camel.openapi.model.SampleComplexResponseType$InnerClass",
-          "type" : "string"
-        }
       }
     },
     "securitySchemes" : {
       "global" : {
+        "type" : "oauth2",
         "flows" : {
           "authorizationCode" : {
             "authorizationUrl" : "https://AUTHORIZATION_URL",
@@ -160,8 +161,7 @@
               "groups" : "Required scopes for Camel REST APIs"
             }
           }
-        },
-        "type" : "oauth2"
+        }
       }
     }
   }
diff --git a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V3SchemaForComplexTypesRequestWithSchemaAnnotation.json b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V3SchemaForComplexTypesRequestWithSchemaAnnotation.json
index 6b6cc5301a4..08858cc7837 100644
--- a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V3SchemaForComplexTypesRequestWithSchemaAnnotation.json
+++ b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V3SchemaForComplexTypesRequestWithSchemaAnnotation.json
@@ -6,6 +6,8 @@
   "paths" : {
     "/complexRequestWithSchemaAnnotation" : {
       "post" : {
+        "summary" : "Demo complex request type",
+        "operationId" : "verb",
         "requestBody" : {
           "description" : "",
           "content" : {
@@ -19,42 +21,28 @@
         },
         "responses" : {
           "200" : {
+            "description" : "Receives a complex object as parameter",
             "content" : {
               "text/plain" : {
                 "schema" : {
                   "$ref" : "#/components/schemas/responseInner"
                 }
               }
-            },
-            "description" : "Receives a complex object as parameter"
+            }
           }
         },
-        "operationId" : "verb",
-        "summary" : "Demo complex request type",
         "x-camelContextId" : "camel"
       }
     }
   },
   "components" : {
     "schemas" : {
-      "customData" : {
-        "type" : "object",
-        "properties" : {
-          "customDataField" : {
-            "type" : "string"
-          }
-        },
-        "x-className" : {
-          "format" : "org.apache.camel.openapi.model.CustomDataWithSchemaAnnotation",
-          "type" : "string"
-        }
-      },
       "requestInner" : {
         "type" : "object",
         "properties" : {
           "longField" : {
-            "format" : "int64",
-            "type" : "integer"
+            "type" : "integer",
+            "format" : "int64"
           }
         },
         "x-className" : {
@@ -124,8 +112,8 @@
             }
           },
           "timeUnit" : {
-            "enum" : [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ],
-            "type" : "string"
+            "type" : "string",
+            "enum" : [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ]
           },
           "innerClass" : {
             "$ref" : "#/components/schemas/requestInner"
@@ -136,12 +124,24 @@
           "type" : "string"
         }
       },
+      "customData" : {
+        "type" : "object",
+        "properties" : {
+          "customDataField" : {
+            "type" : "string"
+          }
+        },
+        "x-className" : {
+          "format" : "org.apache.camel.openapi.model.CustomDataWithSchemaAnnotation",
+          "type" : "string"
+        }
+      },
       "responseInner" : {
         "type" : "object",
         "properties" : {
           "doubleField" : {
-            "format" : "double",
-            "type" : "number"
+            "type" : "number",
+            "format" : "double"
           }
         },
         "x-className" : {
@@ -152,6 +152,7 @@
     },
     "securitySchemes" : {
       "global" : {
+        "type" : "oauth2",
         "flows" : {
           "authorizationCode" : {
             "authorizationUrl" : "https://AUTHORIZATION_URL",
@@ -160,8 +161,7 @@
               "groups" : "Required scopes for Camel REST APIs"
             }
           }
-        },
-        "type" : "oauth2"
+        }
       }
     }
   }
diff --git a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V3SchemaForComplexTypesResponse.json b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V3SchemaForComplexTypesResponse.json
index 88c81ebd9c0..66a4e86264e 100644
--- a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V3SchemaForComplexTypesResponse.json
+++ b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V3SchemaForComplexTypesResponse.json
@@ -6,6 +6,8 @@
   "paths" : {
     "/complexResponse" : {
       "get" : {
+        "summary" : "Demo complex response type",
+        "operationId" : "verb",
         "requestBody" : {
           "description" : "",
           "content" : {
@@ -19,34 +21,32 @@
         },
         "responses" : {
           "200" : {
+            "description" : "Returns a complex object",
             "content" : {
               "application/json" : {
                 "schema" : {
                   "$ref" : "#/components/schemas/SampleComplexResponseType"
                 }
               }
-            },
-            "description" : "Returns a complex object"
+            }
           }
         },
-        "operationId" : "verb",
-        "summary" : "Demo complex response type",
         "x-camelContextId" : "camel"
       }
     }
   },
   "components" : {
     "schemas" : {
-      "SampleComplexRequestType_InnerClass" : {
+      "SampleComplexResponseType_InnerClass" : {
         "type" : "object",
         "properties" : {
-          "longField" : {
-            "format" : "int64",
-            "type" : "integer"
+          "doubleField" : {
+            "type" : "number",
+            "format" : "double"
           }
         },
         "x-className" : {
-          "format" : "org.apache.camel.openapi.model.SampleComplexRequestType$InnerClass",
+          "format" : "org.apache.camel.openapi.model.SampleComplexResponseType$InnerClass",
           "type" : "string"
         }
       },
@@ -67,8 +67,8 @@
             }
           },
           "month" : {
-            "enum" : [ "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER" ],
-            "type" : "string"
+            "type" : "string",
+            "enum" : [ "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER" ]
           },
           "innerClass" : {
             "$ref" : "#/components/schemas/SampleComplexResponseType_InnerClass"
@@ -79,22 +79,23 @@
           "type" : "string"
         }
       },
-      "SampleComplexResponseType_InnerClass" : {
+      "SampleComplexRequestType_InnerClass" : {
         "type" : "object",
         "properties" : {
-          "doubleField" : {
-            "format" : "double",
-            "type" : "number"
+          "longField" : {
+            "type" : "integer",
+            "format" : "int64"
           }
         },
         "x-className" : {
-          "format" : "org.apache.camel.openapi.model.SampleComplexResponseType$InnerClass",
+          "format" : "org.apache.camel.openapi.model.SampleComplexRequestType$InnerClass",
           "type" : "string"
         }
       }
     },
     "securitySchemes" : {
       "global" : {
+        "type" : "oauth2",
         "flows" : {
           "authorizationCode" : {
             "authorizationUrl" : "https://AUTHORIZATION_URL",
@@ -103,8 +104,7 @@
               "groups" : "Required scopes for Camel REST APIs"
             }
           }
-        },
-        "type" : "oauth2"
+        }
       }
     }
   }
diff --git a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V3SchemaForComplexTypesResponseWithSchemaAnnotation.json b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V3SchemaForComplexTypesResponseWithSchemaAnnotation.json
index bb5191c16d7..b2aed970c3d 100644
--- a/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V3SchemaForComplexTypesResponseWithSchemaAnnotation.json
+++ b/components/camel-openapi-java/src/test/resources/org/apache/camel/openapi/V3SchemaForComplexTypesResponseWithSchemaAnnotation.json
@@ -6,6 +6,8 @@
   "paths" : {
     "/complexResponseWithSchemaAnnotation" : {
       "get" : {
+        "summary" : "Demo complex response type",
+        "operationId" : "verb",
         "requestBody" : {
           "description" : "",
           "content" : {
@@ -19,50 +21,22 @@
         },
         "responses" : {
           "200" : {
+            "description" : "Returns a complex object",
             "content" : {
               "application/json" : {
                 "schema" : {
                   "$ref" : "#/components/schemas/sampleResponseWithSchema"
                 }
               }
-            },
-            "description" : "Returns a complex object"
+            }
           }
         },
-        "operationId" : "verb",
-        "summary" : "Demo complex response type",
         "x-camelContextId" : "camel"
       }
     }
   },
   "components" : {
     "schemas" : {
-      "SampleComplexRequestType_InnerClass" : {
-        "type" : "object",
-        "properties" : {
-          "longField" : {
-            "format" : "int64",
-            "type" : "integer"
-          }
-        },
-        "x-className" : {
-          "format" : "org.apache.camel.openapi.model.SampleComplexRequestType$InnerClass",
-          "type" : "string"
-        }
-      },
-      "responseInner" : {
-        "type" : "object",
-        "properties" : {
-          "doubleField" : {
-            "format" : "double",
-            "type" : "number"
-          }
-        },
-        "x-className" : {
-          "format" : "org.apache.camel.openapi.model.SampleComplexResponseTypeWithSchemaAnnotation$InnerClass",
-          "type" : "string"
-        }
-      },
       "sampleResponseWithSchema" : {
         "required" : [ "arrayOfStrings", "responseField1" ],
         "type" : "object",
@@ -80,8 +54,8 @@
             }
           },
           "month" : {
-            "enum" : [ "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER" ],
-            "type" : "string"
+            "type" : "string",
+            "enum" : [ "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER" ]
           },
           "innerClass" : {
             "$ref" : "#/components/schemas/responseInner"
@@ -91,10 +65,37 @@
           "format" : "org.apache.camel.openapi.model.SampleComplexResponseTypeWithSchemaAnnotation",
           "type" : "string"
         }
+      },
+      "responseInner" : {
+        "type" : "object",
+        "properties" : {
+          "doubleField" : {
+            "type" : "number",
+            "format" : "double"
+          }
+        },
+        "x-className" : {
+          "format" : "org.apache.camel.openapi.model.SampleComplexResponseTypeWithSchemaAnnotation$InnerClass",
+          "type" : "string"
+        }
+      },
+      "SampleComplexRequestType_InnerClass" : {
+        "type" : "object",
+        "properties" : {
+          "longField" : {
+            "type" : "integer",
+            "format" : "int64"
+          }
+        },
+        "x-className" : {
+          "format" : "org.apache.camel.openapi.model.SampleComplexRequestType$InnerClass",
+          "type" : "string"
+        }
       }
     },
     "securitySchemes" : {
       "global" : {
+        "type" : "oauth2",
         "flows" : {
           "authorizationCode" : {
             "authorizationUrl" : "https://AUTHORIZATION_URL",
@@ -103,8 +104,7 @@
               "groups" : "Required scopes for Camel REST APIs"
             }
           }
-        },
-        "type" : "oauth2"
+        }
       }
     }
   }
diff --git a/components/camel-rest-openapi/pom.xml b/components/camel-rest-openapi/pom.xml
index 7a646ab90a3..541083f80fd 100644
--- a/components/camel-rest-openapi/pom.xml
+++ b/components/camel-rest-openapi/pom.xml
@@ -17,7 +17,8 @@
     limitations under the License.
 
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
     <modelVersion>4.0.0</modelVersion>
 
@@ -48,17 +49,16 @@
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-rest</artifactId>
         </dependency>
-
+        
+         <dependency>
+            <groupId>io.swagger.core.v3</groupId>
+            <artifactId>swagger-models</artifactId>
+            <version>${swagger-openapi3-version}</version>
+        </dependency>
         <dependency>
-            <groupId>io.apicurio</groupId>
-            <artifactId>apicurio-data-models</artifactId>
-            <version>${apicurio-version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>com.fasterxml.jackson.core</groupId>
-                    <artifactId>*</artifactId>
-                </exclusion>
-            </exclusions>
+            <groupId>io.swagger.parser.v3</groupId>
+            <artifactId>swagger-parser</artifactId>
+            <version>${swagger-openapi3-java-parser-version}</version>
         </dependency>
 
         <dependency>
diff --git a/components/camel-rest-openapi/src/main/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpoint.java b/components/camel-rest-openapi/src/main/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpoint.java
index e209c71f772..1961b4df715 100644
--- a/components/camel-rest-openapi/src/main/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpoint.java
+++ b/components/camel-rest-openapi/src/main/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpoint.java
@@ -16,50 +16,36 @@
  */
 package org.apache.camel.component.rest.openapi;
 
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Optional;
+import java.util.Set;
 import java.util.function.Function;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
-import com.fasterxml.jackson.core.JsonFactory;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
-import io.apicurio.datamodels.Library;
-import io.apicurio.datamodels.core.models.Document;
-import io.apicurio.datamodels.core.models.common.SecurityRequirement;
-import io.apicurio.datamodels.openapi.models.OasDocument;
-import io.apicurio.datamodels.openapi.models.OasOperation;
-import io.apicurio.datamodels.openapi.models.OasParameter;
-import io.apicurio.datamodels.openapi.models.OasPathItem;
-import io.apicurio.datamodels.openapi.models.OasPaths;
-import io.apicurio.datamodels.openapi.models.OasResponse;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Document;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Operation;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Parameter;
-import io.apicurio.datamodels.openapi.v2.models.Oas20SecurityDefinitions;
-import io.apicurio.datamodels.openapi.v2.models.Oas20SecurityScheme;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Document;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Operation;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Parameter;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Response;
-import io.apicurio.datamodels.openapi.v3.models.Oas30SecurityScheme;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Server;
+import io.swagger.parser.OpenAPIParser;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.Operation;
+import io.swagger.v3.oas.models.PathItem;
+import io.swagger.v3.oas.models.PathItem.HttpMethod;
+import io.swagger.v3.oas.models.Paths;
+import io.swagger.v3.oas.models.parameters.Parameter;
+import io.swagger.v3.oas.models.responses.ApiResponse;
+import io.swagger.v3.oas.models.security.SecurityRequirement;
+import io.swagger.v3.oas.models.security.SecurityScheme;
+import io.swagger.v3.oas.models.security.SecurityScheme.In;
+import io.swagger.v3.oas.models.servers.Server;
+import io.swagger.v3.parser.core.models.ParseOptions;
+import io.swagger.v3.parser.core.models.SwaggerParseResult;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Category;
 import org.apache.camel.Consumer;
@@ -68,18 +54,16 @@ import org.apache.camel.ExchangePattern;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.spi.Metadata;
-import org.apache.camel.spi.Resource;
 import org.apache.camel.spi.RestConfiguration;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
 import org.apache.camel.support.CamelContextHelper;
 import org.apache.camel.support.DefaultEndpoint;
-import org.apache.camel.support.ResourceHelper;
-import org.apache.camel.util.FileUtil;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.StringHelper;
 import org.apache.camel.util.UnsafeUriCharactersEncoder;
+import org.slf4j.LoggerFactory;
 
 import static java.util.Optional.ofNullable;
 import static org.apache.camel.component.rest.openapi.RestOpenApiHelper.isHostParam;
@@ -188,94 +172,47 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
     @Override
     public Producer createProducer() throws Exception {
         final CamelContext camelContext = getCamelContext();
-        final Document openapiDoc = loadSpecificationFrom(camelContext, specificationUri);
-
-        final OasPaths paths = ((OasDocument) openapiDoc).paths;
-
-        for (final OasPathItem path : paths.getItems()) {
-            final Optional<Entry<HttpMethod, OasOperation>> maybeOperationEntry = getOperationMap(path).entrySet()
-                    .stream().filter(operationEntry -> operationId.equals(operationEntry.getValue().operationId))
+        final OpenAPI openapiDoc = loadSpecificationFrom(camelContext, specificationUri);
+        final Paths paths = openapiDoc.getPaths();
+
+        for (final Entry<String, PathItem> pathEntry : paths.entrySet()) {
+            final PathItem path = pathEntry.getValue();
+            Map<PathItem.HttpMethod, Operation> operationMap = path.readOperationsMap();
+            final Optional<Entry<PathItem.HttpMethod, Operation>> maybeOperationEntry = operationMap.entrySet()
+                    .stream().filter(operationEntry -> operationId.equals(operationEntry.getValue().getOperationId()))
                     .findAny();
 
             if (maybeOperationEntry.isPresent()) {
-                final Entry<HttpMethod, OasOperation> operationEntry = maybeOperationEntry.get();
+                final Entry<PathItem.HttpMethod, Operation> operationEntry = maybeOperationEntry.get();
 
-                final OasOperation operation = operationEntry.getValue();
-                Map<String, OasParameter> pathParameters;
+                final Operation operation = operationEntry.getValue();
+                Map<String, Parameter> pathParameters;
                 if (operation.getParameters() != null) {
                     pathParameters = operation.getParameters().stream()
-                            .filter(p -> "path".equals(p.in))
-                            .collect(Collectors.toMap(OasParameter::getName, Function.identity()));
+                            .filter(p -> "path".equals(p.getIn()))
+                            .collect(Collectors.toMap(Parameter::getName, Function.identity()));
                 } else {
                     pathParameters = new HashMap<>();
                 }
-                final String uriTemplate = resolveUri(path.getPath(), pathParameters);
+                final String uriTemplate = resolveUri(pathEntry.getKey(), pathParameters);
 
                 final HttpMethod httpMethod = operationEntry.getKey();
                 final String method = httpMethod.name();
 
                 return createProducerFor(openapiDoc, operation, method, uriTemplate);
             }
+
         }
 
-        String supportedOperations = paths.getItems().stream().flatMap(p -> getOperationMap(p).values().stream())
-                .map(p -> p.operationId).collect(Collectors.joining(", "));
+        final String supportedOperations = paths.values().stream().flatMap(p -> p.readOperations().stream())
+                .map(Operation::getOperationId).collect(Collectors.joining(", "));
+
         throw new IllegalArgumentException(
                 "The specified operation with ID: `" + operationId
                                            + "` cannot be found in the OpenApi specification loaded from `" + specificationUri
                                            + "`. Operations defined in the specification are: " + supportedOperations);
     }
 
-    /**
-     * Generates an operationId from provided OpenApi specification path and operation
-     */
-    private void generateMissingOperationId(String path, OasOperation operation) {
-        if (null == operation.operationId) {
-            final StringBuilder idBuilder = new StringBuilder(operation.getMethod().toLowerCase());
-            final Matcher matcher = PATH_EXTRACTOR.matcher(path);
-            while (matcher.find()) {
-                idBuilder.append('-').append(matcher.group(1));
-            }
-            operation.operationId = idBuilder.toString();
-        }
-    }
-
-    private Map<HttpMethod, OasOperation> getOperationMap(OasPathItem path) {
-        Map<HttpMethod, OasOperation> result = new LinkedHashMap<>();
-        final String uriPath = path.getPath();
-
-        if (path.get != null) {
-            generateMissingOperationId(uriPath, path.get);
-            result.put(HttpMethod.GET, path.get);
-        }
-        if (path.put != null) {
-            generateMissingOperationId(uriPath, path.put);
-            result.put(HttpMethod.PUT, path.put);
-        }
-        if (path.post != null) {
-            generateMissingOperationId(uriPath, path.post);
-            result.put(HttpMethod.POST, path.post);
-        }
-        if (path.delete != null) {
-            generateMissingOperationId(uriPath, path.delete);
-            result.put(HttpMethod.DELETE, path.delete);
-        }
-        if (path.patch != null) {
-            generateMissingOperationId(uriPath, path.patch);
-            result.put(HttpMethod.PATCH, path.patch);
-        }
-        if (path.head != null) {
-            generateMissingOperationId(uriPath, path.head);
-            result.put(HttpMethod.HEAD, path.head);
-        }
-        if (path.options != null) {
-            generateMissingOperationId(uriPath, path.options);
-            result.put(HttpMethod.OPTIONS, path.options);
-        }
-
-        return result;
-    }
-
     public String getBasePath() {
         return basePath;
     }
@@ -342,7 +279,7 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
     }
 
     Producer createProducerFor(
-            final Document openapi, final OasOperation operation, final String method,
+            final OpenAPI openapi, final Operation operation, final String method,
             final String uriTemplate)
             throws Exception {
 
@@ -366,7 +303,7 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
         return new RestOpenApiProducer(endpoint.createProducer(), hasHost);
     }
 
-    String determineBasePath(final Document openapi) {
+    String determineBasePath(final OpenAPI openapi) {
         if (isNotEmpty(basePath)) {
             return basePath;
         }
@@ -376,7 +313,7 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
             return componentBasePath;
         }
 
-        final String specificationBasePath = getBasePathFromOasDocument((OasDocument) openapi);
+        final String specificationBasePath = getBasePathFromOpenApi(openapi);
 
         if (isNotEmpty(specificationBasePath)) {
             return specificationBasePath;
@@ -394,22 +331,15 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
         return RestOpenApiComponent.DEFAULT_BASE_PATH;
     }
 
-    public static String getBasePathFromOasDocument(final OasDocument openapi) {
+    public static String getBasePathFromOpenApi(final OpenAPI openApi) {
         String basePath = null;
-        if (openapi instanceof Oas20Document) {
-            basePath = ((Oas20Document) openapi).basePath;
-        } else if (openapi instanceof Oas30Document) {
-            if (((Oas30Document) openapi).getServers() != null
-                    && ((Oas30Document) openapi).getServers().get(0) != null) {
-                try {
-                    Oas30Server server = (Oas30Server) ((Oas30Document) openapi).getServers().get(0);
-                    if (server.variables != null && server.variables.get("basePath") != null) {
-                        basePath = server.variables.get("basePath").default_;
-                    }
-                    if (basePath == null) {
-                        // parse server url as fallback
-                        URL serverUrl = new URL(parseVariables(((Oas30Document) openapi).getServers().get(0).url, server));
+        if (openApi.getServers() != null) {
+            for (Server server : openApi.getServers()) {
+                if (server.getUrl() != null) {
+                    try {
+                        URI serverUrl = new URI(parseVariables(server.getUrl(), server));
                         basePath = serverUrl.getPath();
+                        // Is this really necessary?
                         if (basePath.indexOf("//") == 0) {
                             // strip off the first "/" if double "/" exists
                             basePath = basePath.substring(1);
@@ -417,27 +347,24 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
                         if ("/".equals(basePath)) {
                             basePath = "";
                         }
+                    } catch (URISyntaxException e) {
+                        //not a valid whole url, just the basePath
+                        basePath = server.getUrl();
                     }
-
-                } catch (MalformedURLException e) {
-                    //not a valid whole url, just the basePath
-                    basePath = ((Oas30Document) openapi).getServers().get(0).url;
                 }
             }
-
         }
         return basePath;
-
     }
 
-    public static String parseVariables(String url, Oas30Server server) {
+    public static String parseVariables(String url, Server server) {
         Pattern p = Pattern.compile("\\{(.*?)\\}");
         Matcher m = p.matcher(url);
         while (m.find()) {
 
             String var = m.group(1);
-            if (server != null && server.variables != null && server.variables.get(var) != null) {
-                String varValue = server.variables.get(var).default_;
+            if (server != null && server.getVariables() != null && server.getVariables().get(var) != null) {
+                String varValue = server.getVariables().get(var).getDefault();
                 url = url.replace("{" + var + "}", varValue);
             }
         }
@@ -448,7 +375,7 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
         return Optional.ofNullable(componentName).orElse(component().getComponentName());
     }
 
-    Map<String, Object> determineEndpointParameters(final Document openapi, final OasOperation operation) {
+    Map<String, Object> determineEndpointParameters(final OpenAPI openapi, final Operation operation) {
         final Map<String, Object> parameters = new HashMap<>();
 
         final String componentName = determineComponentName();
@@ -456,7 +383,7 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
             parameters.put("producerComponentName", componentName);
         }
 
-        final String host = determineHost(openapi);
+        final String host = determineHost(openapi, operation);
         if (host != null) {
             parameters.put("host", host);
         }
@@ -466,20 +393,15 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
         // what we consume is what the API defined by OpenApi specification
         // produces
         List<String> specificationLevelConsumers = new ArrayList<>();
-        if (openapi instanceof Oas20Document) {
-            specificationLevelConsumers = ((Oas20Document) openapi).produces;
-        }
-        List<String> operationLevelConsumers = new ArrayList<>();
-        if (operation instanceof Oas20Operation) {
-            operationLevelConsumers = ((Oas20Operation) operation).produces;
-        } else if (operation instanceof Oas30Operation) {
-            Oas30Operation oas30Operation = (Oas30Operation) operation;
-            if (oas30Operation.responses != null) {
-                for (OasResponse response : oas30Operation.responses.getResponses()) {
-                    operationLevelConsumers.addAll(((Oas30Response) response).content.keySet());
+        Set<String> operationLevelConsumers = new java.util.HashSet<>();
+        if (operation.getResponses() != null) {
+            for (ApiResponse response : operation.getResponses().values()) {
+                if (response.getContent() != null) {
+                    operationLevelConsumers.addAll(response.getContent().keySet());
                 }
             }
         }
+
         final String determinedConsumes = determineOption(specificationLevelConsumers, operationLevelConsumers,
                 component.getConsumes(), consumes);
 
@@ -488,19 +410,10 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
         }
 
         // what we produce is what the API defined by OpenApi specification consumes
-
         List<String> specificationLevelProducers = new ArrayList<>();
-        if (openapi instanceof Oas20Document) {
-            specificationLevelProducers = ((Oas20Document) openapi).consumes;
-        }
-        List<String> operationLevelProducers = new ArrayList<>();
-        if (operation instanceof Oas20Operation) {
-            operationLevelProducers = ((Oas20Operation) operation).consumes;
-        } else if (operation instanceof Oas30Operation) {
-            Oas30Operation oas30Operation = (Oas30Operation) operation;
-            if (oas30Operation.requestBody != null && oas30Operation.requestBody.content != null) {
-                operationLevelProducers.addAll(oas30Operation.requestBody.content.keySet());
-            }
+        Set<String> operationLevelProducers = new java.util.HashSet<>();
+        if (operation.getRequestBody() != null && operation.getRequestBody().getContent() != null) {
+            operationLevelProducers.addAll(operation.getRequestBody().getContent().keySet());
         }
 
         final String determinedProducers = determineOption(specificationLevelProducers, operationLevelProducers,
@@ -538,10 +451,10 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
         if (this.parameters != null) {
             if (operation.getParameters() != null) {
                 for (Map.Entry<String, Object> entry : this.parameters.entrySet()) {
-                    for (OasParameter param : operation.getParameters()) {
+                    for (Parameter param : operation.getParameters()) {
                         // skip parameters that are part of the operation as path as otherwise
                         // it will be duplicated as query parameter as well
-                        boolean clash = "path".equals(param.in) && entry.getKey().equals(param.getName());
+                        boolean clash = "path".equals(param.getIn()) && entry.getKey().equals(param.getName());
                         if (!clash) {
                             nestedParameters.put(entry.getKey(), entry.getValue());
                         }
@@ -560,7 +473,7 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
         return parameters;
     }
 
-    String determineHost(final Document openapi) {
+    String determineHost(final OpenAPI openApi, Operation operation) {
         if (isNotEmpty(host)) {
             return host;
         }
@@ -570,34 +483,36 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
             return componentHost;
         }
 
-        if (openapi instanceof Oas20Document) {
-            final String openapiScheme = pickBestScheme(specificationUri.getScheme(), ((Oas20Document) openapi).schemes);
-            final String openapiHost = ((Oas20Document) openapi).host;
-
-            if (isNotEmpty(openapiScheme) && isNotEmpty(openapiHost)) {
-                return openapiScheme + "://" + openapiHost;
+        URI absoluteURI = null;
+        URI relativeURI = null;
+        Set<URI> operationURIs = getURIs(operation.getServers());
+        // Check if at least one of them is absolute:
+        Optional<URI> opURI = operationURIs.stream().filter(uri -> uri.isAbsolute()).findFirst();
+        if (opURI.isEmpty()) {
+            // look for absolute at api level + possible relative URI for the operation
+            Set<URI> apiURIs = getURIs(openApi.getServers());
+            for (URI uri : apiURIs) {
+                if (uri.isAbsolute()) {
+                    absoluteURI = uri;
+                } else {
+                    relativeURI = uri;
+                }
             }
-        } else if (openapi instanceof Oas30Document) {
-            //In OpenApi 3.0, scheme/host are in servers url section
-            //But there could be many servers url(like one for production and one for test)
-            //Use first one here
-            Oas30Document oas30Document = (Oas30Document) openapi;
-            if (oas30Document.getServers() != null
-                    && oas30Document.getServers().get(0) != null) {
-                try {
-
-                    URL serverUrl = new URL(
-                            parseVariables(oas30Document.getServers().get(0).url,
-                                    (Oas30Server) oas30Document.getServers().get(0)));
-                    final String openapiScheme = serverUrl.getProtocol();
-                    final String openapiHost = serverUrl.getHost();
-                    if (isNotEmpty(openapiScheme) && isNotEmpty(openapiHost)) {
-                        return openapiScheme + "://" + openapiHost;
-                    }
-                } catch (MalformedURLException e) {
-                    throw new IllegalStateException(e);
+            for (URI uri : operationURIs) {
+                if (absoluteURI != null) {
+                    absoluteURI = absoluteURI.resolve(uri);
+                } else if (relativeURI != null && !relativeURI.equals(uri)) {
+                    // concatenate the relativeURIs
+                    relativeURI = relativeURI.resolve(uri);
+                } else {
+                    relativeURI = uri;
                 }
             }
+        } else {
+            absoluteURI = opURI.get();
+        }
+        if (absoluteURI != null) {
+            return absoluteURI.toString();
         }
 
         final CamelContext camelContext = getCamelContext();
@@ -631,7 +546,22 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
                                         + " and there is no global RestConfiguration with those properties");
     }
 
-    String literalPathParameterValue(final OasParameter parameter) {
+    private Set<URI> getURIs(List<Server> servers) {
+        Set<URI> uris = new java.util.HashSet<URI>();
+        if (servers != null) {
+            for (Server server : servers) {
+                try {
+                    uris.add(new URI(parseVariables(server.getUrl(), server)));
+                } catch (URISyntaxException e) {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+            }
+        }
+        return uris;
+    }
+
+    String literalPathParameterValue(final Parameter parameter) {
         final String name = parameter.getName();
 
         final String valueStr = String.valueOf(parameters.get(name));
@@ -639,7 +569,7 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
         return UnsafeUriCharactersEncoder.encode(valueStr);
     }
 
-    String literalQueryParameterValue(final OasParameter parameter) {
+    String literalQueryParameterValue(final Parameter parameter) {
         final String name = parameter.getName();
 
         final String valueStr = String.valueOf(parameters.get(name));
@@ -648,7 +578,7 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
         return name + "=" + encoded;
     }
 
-    String queryParameter(final OasParameter parameter) {
+    String queryParameter(final Parameter parameter) {
         final String name = parameter.getName();
         if (ObjectHelper.isEmpty(name)) {
             return "";
@@ -661,7 +591,7 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
         return queryParameterExpression(parameter);
     }
 
-    String resolveUri(final String uriTemplate, final Map<String, OasParameter> pathParameters) {
+    String resolveUri(final String uriTemplate, final Map<String, Parameter> pathParameters) {
         if (pathParameters.isEmpty()) {
             return uriTemplate;
         }
@@ -682,7 +612,7 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
             final String name = uriTemplate.substring(start + 1, end);
 
             if (parameters.containsKey(name)) {
-                final OasParameter parameter = pathParameters.get(name);
+                final Parameter parameter = pathParameters.get(name);
                 final Object value = literalPathParameterValue(parameter);
                 resolved.append(value);
             } else {
@@ -701,7 +631,7 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
     }
 
     static String determineOption(
-            final List<String> specificationLevel, final List<String> operationLevel,
+            final List<String> specificationLevel, final Set<String> operationLevel,
             final String componentLevel, final String endpointLevel) {
         if (isNotEmpty(endpointLevel)) {
             return endpointLevel;
@@ -722,54 +652,30 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
         return null;
     }
 
-    static Stream<OasParameter> determineQueryParameters(final Document openapi, final OasOperation operation) {
-        final List<SecurityRequirement> securityRequirements = operation.security;
-        final List<OasParameter> apiKeyQueryParameters = new ArrayList<>();
+    static Stream<Parameter> determineQueryParameters(final OpenAPI openApi, final Operation operation) {
+        final List<SecurityRequirement> securityRequirements = operation.getSecurity();
+        final List<Parameter> securityQueryParameters = new ArrayList<>();
         if (securityRequirements != null) {
-            if (openapi instanceof Oas20Document) {
-                Oas20Document oas20Document = (Oas20Document) openapi;
-                Oas20SecurityDefinitions securityDefinitions = oas20Document.securityDefinitions;
-
-                for (final SecurityRequirement securityRequirement : securityRequirements) {
-                    for (final String securityRequirementName : securityRequirement.getSecurityRequirementNames()) {
-                        final Oas20SecurityScheme securitySchemeDefinition = securityDefinitions
-                                .getSecurityScheme(securityRequirementName);
-                        if (securitySchemeDefinition.in != null
-                                && securitySchemeDefinition.in.equals("query")) {
-                            Oas20Parameter securityParameter = new Oas20Parameter(securitySchemeDefinition.name);
-                            securityParameter.required = true;
-                            securityParameter.type = "string";
-                            securityParameter.description = securitySchemeDefinition.description;
-                            apiKeyQueryParameters.add(securityParameter);
-                        }
-
-                    }
-                }
-            } else if (openapi instanceof Oas30Document) {
-                Oas30Document oas30Document = (Oas30Document) openapi;
-                for (final SecurityRequirement securityRequirement : securityRequirements) {
-                    for (final String securityRequirementName : securityRequirement.getSecurityRequirementNames()) {
-                        final Oas30SecurityScheme securitySchemeDefinition = oas30Document.components
-                                .getSecurityScheme(securityRequirementName);
-                        if (securitySchemeDefinition.in != null && securitySchemeDefinition.in.equals("query")) {
-                            Oas30Parameter securityParameter = new Oas30Parameter(securitySchemeDefinition.name);
-                            securityParameter.required = true;
-                            securityParameter.description = securitySchemeDefinition.description;
-                            apiKeyQueryParameters.add(securityParameter);
-                        }
-
+            final Map<String, SecurityScheme> securityDefinitions = openApi.getComponents().getSecuritySchemes();
+
+            for (final Map<String, List<String>> securityRequirement : securityRequirements) {
+                for (final String securityRequirementName : securityRequirement.keySet()) {
+                    final SecurityScheme securitySchemeDefinition = securityDefinitions
+                            .get(securityRequirementName);
+                    if (In.QUERY.equals(securitySchemeDefinition.getIn())) {
+                        securityQueryParameters.add(new Parameter().name(securitySchemeDefinition.getName())
+                                .required(true).description(securitySchemeDefinition.getDescription()));
+                        // Not needed to set schema or style?
                     }
                 }
-            } else {
-                throw new IllegalStateException("We only support OpenApi 2.0 or 3.0 document here");
             }
         }
 
         if (operation.getParameters() != null) {
-            return Stream.concat(apiKeyQueryParameters.stream(),
-                    operation.getParameters().stream().filter(p -> "query".equals(p.in)));
+            return Stream.concat(securityQueryParameters.stream(),
+                    operation.getParameters().stream().filter(p -> "query".equals(p.getIn())));
         } else {
-            return apiKeyQueryParameters.stream();
+            return securityQueryParameters.stream();
         }
     }
 
@@ -796,43 +702,38 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
     }
 
     /**
-     * Loads the OpenApi definition model from the given path. Tries to resolve the resource using Camel's resource
-     * loading support, if it fails uses OpenApi's resource loading support instead.
+     * Loads the OpenApi definition model from the given path. This delegates directly to the OpenAPI parser. If the
+     * specification can't be read there is no OpenAPI object in the result.
      *
      * @param  uri          URI of the specification
      * @param  camelContext context to use
      * @return              the specification
      */
-    static Document loadSpecificationFrom(final CamelContext camelContext, final URI uri) {
+    static OpenAPI loadSpecificationFrom(final CamelContext camelContext, final URI uri) {
         final String uriAsString = uri.toString();
-        JsonFactory factory = null;
+        final OpenAPIParser openApiParser = new OpenAPIParser();
+        final ParseOptions options = new ParseOptions();
+        options.setResolveFully(true);
+        final SwaggerParseResult openApi = openApiParser.readLocation(uriAsString, null, options);
 
-        try {
-            final Resource resource = ResourceHelper.resolveMandatoryResource(camelContext, uriAsString);
-
-            try (InputStream stream = resource.getInputStream()) {
-                if (stream == null) {
-                    String resourcePath = FileUtil.compactPath(uriAsString, '/');
-                    throw new FileNotFoundException("Cannot find resource: " + resourcePath + " for URI: " + uri);
-                }
-
-                if (RestOpenApiHelper.isYamlResource(resource)) {
-                    factory = new YAMLFactory();
-                }
+        if (openApi != null && openApi.getOpenAPI() != null) {
+            checkV2specification(openApi.getOpenAPI(), uri);
+            return openApi.getOpenAPI();
+        }
 
-                ObjectMapper mapper = new ObjectMapper(factory);
-                final JsonNode node = mapper.readTree(stream);
+        // In theory there should be a message in the parse result but it has disappeared...
+        throw new IllegalArgumentException(
+                "The given OpenApi specification could not be loaded from `" + uri + "`.");
+    }
 
-                return Library.readDocument(node);
+    private static void checkV2specification(OpenAPI openAPI, final URI uri) {
+        if (openAPI.getExtensions() != null) {
+            Object swaggerVersion = openAPI.getExtensions().get("x-original-swagger-version");
+            if (swaggerVersion != null) {
+                LoggerFactory.getLogger(RestOpenApiEndpoint.class).info(
+                        "The specification {} was upgraded from {} to OpenAPI {}",
+                        uri, swaggerVersion, openAPI.getSpecVersion());
             }
-        } catch (final Exception e) {
-            throw new IllegalArgumentException(
-                    "The given OpenApi specification could not be loaded from `" + uri
-                                               + "`. Tried loading using Camel's resource resolution and using OpenApi's own resource resolution."
-                                               + " OpenApi tends to swallow exceptions while parsing, try specifying Java system property `debugParser`"
-                                               + " (e.g. `-DdebugParser=true`), the exception that occurred when loading using Camel's resource"
-                                               + " loader follows",
-                    e);
         }
     }
 
@@ -850,11 +751,11 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
         // there is no support for WebSocket (Scheme.WS, Scheme.WSS)
     }
 
-    static String queryParameterExpression(final OasParameter parameter) {
+    static String queryParameterExpression(final Parameter parameter) {
         final String name = parameter.getName();
 
         final StringBuilder expression = new StringBuilder(name).append("={").append(name);
-        if (parameter.required == null || !parameter.required) {
+        if (parameter.getRequired() == null || !parameter.getRequired()) {
             expression.append('?');
         }
         expression.append('}');
@@ -862,14 +763,4 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint {
         return expression.toString();
     }
 
-    enum HttpMethod {
-        POST,
-        GET,
-        PUT,
-        PATCH,
-        DELETE,
-        HEAD,
-        OPTIONS
-    }
-
 }
diff --git a/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/HttpsV3Test.java b/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/HttpsV3Test.java
index 516f5a48333..461226441fa 100644
--- a/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/HttpsV3Test.java
+++ b/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/HttpsV3Test.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.rest.openapi;
 
 import java.io.IOException;
 import java.net.HttpURLConnection;
+import java.net.URI;
 import java.net.URISyntaxException;
 import java.nio.file.Files;
 import java.nio.file.Paths;
@@ -119,13 +120,20 @@ public abstract class HttpsV3Test extends CamelTestSupport {
 
         final RestOpenApiComponent component = new RestOpenApiComponent();
         component.setComponentName(componentName);
-        component.setHost("https://localhost:" + petstore.httpsPort());
-        component.setSpecificationUri(RestOpenApiComponentV3Test.class.getResource("/openapi-v3.json").toURI());
+        final String host = "https://localhost:" + petstore.httpsPort();
+        component.setHost(host);
+        // Workaround bug resolving relative references with file URLs in swagger parser
+        component.setSpecificationUri(new URI(host + getSpecName()));
+        //        component.setSpecificationUri(HttpsV3Test.class.getResource(getSpecName()).toURI());
         camelContext.addComponent("petStore", component);
 
         return camelContext;
     }
 
+    protected String getSpecName() {
+        return "/openapi-v3.json";
+    }
+
     @Override
     protected RoutesBuilder createRouteBuilder() {
         return new RouteBuilder() {
@@ -151,10 +159,14 @@ public abstract class HttpsV3Test extends CamelTestSupport {
     }
 
     @BeforeAll
-    public static void setupStubs() throws IOException, URISyntaxException {
-        petstore.stubFor(get(urlEqualTo("/openapi.json")).willReturn(aResponse().withBody(
-                Files.readAllBytes(Paths.get(RestOpenApiGlobalHttpsTest.class.getResource("/openapi.json").toURI())))));
+    public static void makeSwaggerTrustLocalhost() {
+        System.setProperty("io.swagger.v3.parser.util.RemoteUrl.trustAll", "true");
+    }
 
+    @BeforeAll
+    public static void setupStubs() throws IOException, URISyntaxException {
+        petstore.stubFor(get(urlEqualTo("/openapi-v3.json")).willReturn(aResponse().withBody(
+                Files.readAllBytes(Paths.get(RestOpenApiGlobalHttpsTest.class.getResource("/openapi-v3.json").toURI())))));
         petstore.stubFor(
                 get(urlEqualTo("/api/v3/pet/14")).willReturn(aResponse().withStatus(HttpURLConnection.HTTP_OK).withBody(
                         "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Pet><id>14</id><name>Olafur Eliason Arnalds</name></Pet>")));
diff --git a/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiComponentTest.java b/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiComponentTest.java
index 52597dde622..0ddc0428185 100644
--- a/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiComponentTest.java
+++ b/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiComponentTest.java
@@ -101,7 +101,9 @@ public class RestOpenApiComponentTest extends CamelTestSupport {
         assertEquals(Integer.valueOf(14), created.id);
 
         petstore.verify(
-                postRequestedFor(urlEqualTo("/v2/pet")).withHeader("Accept", equalTo("application/xml, application/json"))
+                postRequestedFor(urlEqualTo("/v2/pet"))
+                        // Swagger V2 converted to V3 ignores "produces" if there is no associated response schema
+                        //.withHeader("Accept", equalTo("application/xml, application/json"))
                         .withHeader("Content-Type", equalTo("application/xml")));
     }
 
diff --git a/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiComponentYamlTest.java b/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiComponentYamlTest.java
index aa463afff95..7270264ca89 100644
--- a/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiComponentYamlTest.java
+++ b/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiComponentYamlTest.java
@@ -101,7 +101,9 @@ public class RestOpenApiComponentYamlTest extends CamelTestSupport {
         assertEquals(Integer.valueOf(14), created.id);
 
         petstore.verify(
-                postRequestedFor(urlEqualTo("/v2/pet")).withHeader("Accept", equalTo("application/xml, application/json"))
+                postRequestedFor(urlEqualTo("/v2/pet"))
+                        // Swagger V2 converted to V3 ignores "produces" if there is no associated response schema
+                        //.withHeader("Accept", equalTo("application/xml, application/json"))
                         .withHeader("Content-Type", equalTo("application/xml")));
     }
 
diff --git a/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpointTest.java b/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpointTest.java
deleted file mode 100644
index c40bdde181a..00000000000
--- a/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpointTest.java
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.rest.openapi;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import io.apicurio.datamodels.core.models.common.SecurityRequirement;
-import io.apicurio.datamodels.openapi.models.OasParameter;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Document;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Operation;
-import io.apicurio.datamodels.openapi.v2.models.Oas20Parameter;
-import io.apicurio.datamodels.openapi.v2.models.Oas20SecurityScheme;
-import org.apache.camel.CamelContext;
-import org.apache.camel.impl.engine.DefaultClassResolver;
-import org.apache.camel.spi.RestConfiguration;
-import org.junit.jupiter.api.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.entry;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-public class RestOpenApiEndpointTest {
-
-    URI componentJsonUri = URI.create("component.json");
-
-    URI endpointUri = URI.create("endpoint.json");
-
-    @Test
-    public void shouldComplainForUnknownOperations() {
-        final CamelContext camelContext = mock(CamelContext.class);
-        when(camelContext.getClassResolver()).thenReturn(new DefaultClassResolver());
-
-        final RestOpenApiComponent component = new RestOpenApiComponent(camelContext);
-
-        final RestOpenApiEndpoint endpoint = new RestOpenApiEndpoint(
-                "rest-openapi:unknown", "unknown", component,
-                Collections.emptyMap());
-
-        assertThrows(IllegalArgumentException.class,
-                () -> endpoint.createProducer());
-    }
-
-    @Test
-    public void shouldComputeQueryParameters() {
-        final RestOpenApiEndpoint endpoint = new RestOpenApiEndpoint();
-        endpoint.parameters = new HashMap<>();
-        endpoint.parameters.put("literal", "value");
-        assertThat(endpoint.queryParameter(new Oas20Parameter())).isEqualTo("");
-        assertThat(endpoint.queryParameter(new Oas20Parameter("param"))).isEqualTo("param={param?}");
-        assertThat(endpoint.queryParameter(new Oas20Parameter("literal"))).isEqualTo("literal=value");
-    }
-
-    @Test
-    public void shouldCreateQueryParameterExpressions() {
-        Oas20Parameter oas20Parameter = new Oas20Parameter("q");
-        oas20Parameter.required = true;
-        assertThat(RestOpenApiEndpoint.queryParameterExpression(oas20Parameter))
-                .isEqualTo("q={q}");
-        oas20Parameter.required = false;
-        assertThat(RestOpenApiEndpoint.queryParameterExpression(oas20Parameter))
-                .isEqualTo("q={q?}");
-    }
-
-    @Test
-    public void shouldDetermineBasePath() {
-        final RestConfiguration restConfiguration = new RestConfiguration();
-
-        final CamelContext camelContext = mock(CamelContext.class);
-        when(camelContext.getRestConfiguration()).thenReturn(restConfiguration);
-
-        final Oas20Document openapi = new Oas20Document();
-
-        final RestOpenApiComponent component = new RestOpenApiComponent();
-        component.setCamelContext(camelContext);
-        final RestOpenApiEndpoint endpoint = new RestOpenApiEndpoint(
-                "rest-openapi:getPetById", "getPetById", component,
-                Collections.emptyMap());
-
-        assertThat(endpoint.determineBasePath(openapi))
-                .as("When no base path is specified on component, endpoint or rest configuration it should default to `/`")
-                .isEqualTo("/");
-
-        restConfiguration.setContextPath("/rest");
-        assertThat(endpoint.determineBasePath(openapi)).as(
-                "When base path is specified in REST configuration and not specified in component the base path should be from the REST configuration")
-                .isEqualTo("/rest");
-
-        openapi.basePath = "/specification";
-        assertThat(endpoint.determineBasePath(openapi)).as(
-                "When base path is specified in the specification it should take precedence the one specified in the REST configuration")
-                .isEqualTo("/specification");
-
-        component.setBasePath("/component");
-        assertThat(endpoint.determineBasePath(openapi)).as(
-                "When base path is specified on the component it should take precedence over OpenApi specification and REST configuration")
-                .isEqualTo("/component");
-
-        endpoint.setBasePath("/endpoint");
-        assertThat(endpoint.determineBasePath(openapi))
-                .as("When base path is specified on the endpoint it should take precedence over any other")
-                .isEqualTo("/endpoint");
-    }
-
-    @Test
-    public void shouldDetermineEndpointParameters() {
-        final CamelContext camelContext = mock(CamelContext.class);
-
-        final RestOpenApiComponent component = new RestOpenApiComponent();
-        component.setCamelContext(camelContext);
-
-        final RestOpenApiEndpoint endpoint = new RestOpenApiEndpoint(
-                "uri", "remaining", component,
-                Collections.emptyMap());
-        endpoint.setHost("http://petstore.openapi.io");
-
-        final Oas20Document openapi = new Oas20Document();
-        final Oas20Operation operation = new Oas20Operation("get");
-        operation.createParameter();
-        assertThat(endpoint.determineEndpointParameters(openapi, operation))
-                .containsOnly(entry("host", "http://petstore.openapi.io"));
-
-        component.setComponentName("xyz");
-        assertThat(endpoint.determineEndpointParameters(openapi, operation))
-                .containsOnly(entry("host", "http://petstore.openapi.io"), entry("producerComponentName", "xyz"));
-
-        List<String> consumers = new ArrayList<String>();
-        consumers.add("application/json");
-        List<String> produces = new ArrayList<String>();
-        produces.add("application/xml");
-        openapi.consumes = consumers;
-        openapi.produces = produces;
-
-        assertThat(endpoint.determineEndpointParameters(openapi, operation)).containsOnly(
-                entry("host", "http://petstore.openapi.io"), entry("producerComponentName", "xyz"),
-                entry("consumes", "application/xml"), entry("produces", "application/json"));
-
-        component.setProduces("application/json");
-        component.setConsumes("application/atom+xml");
-        assertThat(endpoint.determineEndpointParameters(openapi, operation)).containsOnly(
-                entry("host", "http://petstore.openapi.io"), entry("producerComponentName", "xyz"),
-                entry("consumes", "application/atom+xml"), entry("produces", "application/json"));
-
-        endpoint.setProduces("application/atom+xml");
-        endpoint.setConsumes("application/json");
-        assertThat(endpoint.determineEndpointParameters(openapi, operation)).containsOnly(
-                entry("host", "http://petstore.openapi.io"), entry("producerComponentName", "xyz"),
-                entry("consumes", "application/json"), entry("produces", "application/atom+xml"));
-
-        endpoint.setComponentName("zyx");
-        assertThat(endpoint.determineEndpointParameters(openapi, operation)).containsOnly(
-                entry("host", "http://petstore.openapi.io"), entry("producerComponentName", "zyx"),
-                entry("consumes", "application/json"), entry("produces", "application/atom+xml"));
-
-        Oas20Parameter oas20Parameter = new Oas20Parameter("q");
-        oas20Parameter.in = "query";
-        oas20Parameter.required = true;
-        operation.addParameter(oas20Parameter);
-        assertThat(endpoint.determineEndpointParameters(openapi, operation)).containsOnly(
-                entry("host", "http://petstore.openapi.io"), entry("producerComponentName", "zyx"),
-                entry("consumes", "application/json"), entry("produces", "application/atom+xml"),
-                entry("queryParameters", "q={q}"));
-
-        oas20Parameter = new Oas20Parameter("o");
-        oas20Parameter.in = "query";
-        operation.addParameter(oas20Parameter);
-        assertThat(endpoint.determineEndpointParameters(openapi, operation)).containsOnly(
-                entry("host", "http://petstore.openapi.io"), entry("producerComponentName", "zyx"),
-                entry("consumes", "application/json"), entry("produces", "application/atom+xml"),
-                entry("queryParameters", "q={q}&o={o?}"));
-    }
-
-    @Test
-    public void shouldDetermineHostFromRestConfiguration() {
-        assertThat(RestOpenApiEndpoint.hostFrom(null)).isNull();
-
-        final RestConfiguration configuration = new RestConfiguration();
-        assertThat(RestOpenApiEndpoint.hostFrom(configuration)).isNull();
-
-        configuration.setScheme("ftp");
-        assertThat(RestOpenApiEndpoint.hostFrom(configuration)).isNull();
-
-        configuration.setScheme("http");
-        assertThat(RestOpenApiEndpoint.hostFrom(configuration)).isNull();
-
-        configuration.setHost("petstore.openapi.io");
-        assertThat(RestOpenApiEndpoint.hostFrom(configuration)).isEqualTo("http://petstore.openapi.io");
-
-        configuration.setPort(80);
-        assertThat(RestOpenApiEndpoint.hostFrom(configuration)).isEqualTo("http://petstore.openapi.io");
-
-        configuration.setPort(8080);
-        assertThat(RestOpenApiEndpoint.hostFrom(configuration)).isEqualTo("http://petstore.openapi.io:8080");
-
-        configuration.setScheme("https");
-        configuration.setPort(80);
-        assertThat(RestOpenApiEndpoint.hostFrom(configuration)).isEqualTo("https://petstore.openapi.io:80");
-
-        configuration.setPort(443);
-        assertThat(RestOpenApiEndpoint.hostFrom(configuration)).isEqualTo("https://petstore.openapi.io");
-    }
-
-    @Test
-    public void shouldDetermineHostFromSpecification() {
-        final RestOpenApiComponent component = new RestOpenApiComponent();
-
-        final RestOpenApiEndpoint endpoint = new RestOpenApiEndpoint(
-                "rest-openapi:http://some-uri#getPetById",
-                "http://some-uri#getPetById", component, Collections.emptyMap());
-
-        final Oas20Document openapi = new Oas20Document();
-        openapi.host = "petstore.swagger.io";
-
-        assertThat(endpoint.determineHost(openapi)).isEqualTo("http://petstore.swagger.io");
-
-        openapi.schemes = Arrays.asList("https");
-        assertThat(endpoint.determineHost(openapi)).isEqualTo("https://petstore.swagger.io");
-    }
-
-    @Test
-    public void shouldDetermineOptions() {
-        assertThat(RestOpenApiEndpoint.determineOption(null, null, null, null)).isNull();
-
-        assertThat(RestOpenApiEndpoint.determineOption(Collections.emptyList(), Collections.emptyList(), "", ""))
-                .isNull();
-
-        assertThat(RestOpenApiEndpoint.determineOption(Arrays.asList("specification"), null, null, null))
-                .isEqualTo("specification");
-
-        assertThat(
-                RestOpenApiEndpoint.determineOption(Arrays.asList("specification"), Arrays.asList("operation"), null, null))
-                .isEqualTo("operation");
-
-        assertThat(RestOpenApiEndpoint.determineOption(Arrays.asList("specification"), Arrays.asList("operation"),
-                "component", null)).isEqualTo("component");
-
-        assertThat(RestOpenApiEndpoint.determineOption(Arrays.asList("specification"), Arrays.asList("operation"),
-                "component", "operation")).isEqualTo("operation");
-    }
-
-    @Test
-    public void shouldHonourComponentSpecificationPathProperty() {
-        final RestOpenApiComponent component = new RestOpenApiComponent();
-        component.setSpecificationUri(componentJsonUri);
-
-        final RestOpenApiEndpoint endpoint = new RestOpenApiEndpoint(
-                "rest-openapi:getPetById", "getPetById", component,
-                Collections.emptyMap());
-
-        assertThat(endpoint.getSpecificationUri()).isEqualTo(componentJsonUri);
-    }
-
-    @Test
-    public void shouldHonourEndpointUriPathSpecificationPathProperty() {
-        final RestOpenApiComponent component = new RestOpenApiComponent();
-        component.setSpecificationUri(componentJsonUri);
-
-        final RestOpenApiEndpoint endpoint = new RestOpenApiEndpoint(
-                "rest-openapi:endpoint.json#getPetById",
-                "endpoint.json#getPetById", component, Collections.emptyMap());
-
-        assertThat(endpoint.getSpecificationUri()).isEqualTo(endpointUri);
-    }
-
-    @Test
-    public void shouldHonourHostPrecedence() {
-        final RestConfiguration globalRestConfiguration = new RestConfiguration();
-        final CamelContext camelContext = mock(CamelContext.class);
-
-        when(camelContext.getRestConfiguration()).thenReturn(globalRestConfiguration);
-
-        final RestOpenApiComponent component = new RestOpenApiComponent();
-        component.setCamelContext(camelContext);
-
-        final RestOpenApiEndpoint endpoint = new RestOpenApiEndpoint(
-                "petstore:http://specification-uri#getPetById",
-                "http://specification-uri#getPetById", component, Collections.emptyMap());
-
-        final Oas20Document openapi = new Oas20Document();
-        assertThat(endpoint.determineHost(openapi)).isEqualTo("http://specification-uri");
-
-        globalRestConfiguration.setHost("global-rest");
-        globalRestConfiguration.setScheme("http");
-        assertThat(endpoint.determineHost(openapi)).isEqualTo("http://global-rest");
-
-        globalRestConfiguration.setHost("component-rest");
-        globalRestConfiguration.setScheme("http");
-        assertThat(endpoint.determineHost(openapi)).isEqualTo("http://component-rest");
-
-        openapi.host = "specification";
-        openapi.schemes = Arrays.asList("http");
-        assertThat(endpoint.determineHost(openapi)).isEqualTo("http://specification");
-
-        component.setHost("http://component");
-        assertThat(endpoint.determineHost(openapi)).isEqualTo("http://component");
-
-        endpoint.setHost("http://endpoint");
-        assertThat(endpoint.determineHost(openapi)).isEqualTo("http://endpoint");
-    }
-
-    @Test
-    public void shouldIncludeApiKeysQueryParameters() {
-        final CamelContext camelContext = mock(CamelContext.class);
-
-        final RestOpenApiComponent component = new RestOpenApiComponent();
-        component.setCamelContext(camelContext);
-
-        final RestOpenApiEndpoint endpoint = new RestOpenApiEndpoint(
-                "uri", "remaining", component,
-                Collections.emptyMap());
-        endpoint.setHost("http://petstore.openapi.io");
-
-        final Oas20Document openapi = new Oas20Document();
-        final Oas20SecurityScheme apiKeys = new Oas20SecurityScheme("key");
-        apiKeys.name = "key";
-        apiKeys.in = "header";
-        openapi.securityDefinitions = openapi.createSecurityDefinitions();
-        openapi.securityDefinitions.addItem("apiKeys", apiKeys);
-
-        final Oas20Operation operation = new Oas20Operation("get");
-        Oas20Parameter oas20Parameter = new Oas20Parameter("q");
-        oas20Parameter.in = "query";
-        oas20Parameter.required = true;
-        operation.addParameter(oas20Parameter);
-        SecurityRequirement securityRequirement = operation.createSecurityRequirement();
-        securityRequirement.addSecurityRequirementItem("apiKeys", Collections.emptyList());
-        operation.addSecurityRequirement(securityRequirement);
-
-        assertThat(endpoint.determineEndpointParameters(openapi, operation))
-                .containsOnly(entry("host", "http://petstore.openapi.io"), entry("queryParameters", "q={q}"));
-
-        apiKeys.in = "query";
-        assertThat(endpoint.determineEndpointParameters(openapi, operation))
-                .containsOnly(entry("host", "http://petstore.openapi.io"), entry("queryParameters", "key={key}&q={q}"));
-    }
-
-    @Test
-    public void shouldPickBestScheme() {
-        assertThat(RestOpenApiEndpoint.pickBestScheme("http", Arrays.asList("http", "https")))
-                .isEqualTo("https");
-
-        assertThat(RestOpenApiEndpoint.pickBestScheme("https", Arrays.asList("http"))).isEqualTo("http");
-
-        assertThat(RestOpenApiEndpoint.pickBestScheme("http", Collections.emptyList())).isEqualTo("http");
-
-        assertThat(RestOpenApiEndpoint.pickBestScheme("http", null)).isEqualTo("http");
-
-        assertThat(RestOpenApiEndpoint.pickBestScheme(null, Collections.emptyList())).isNull();
-
-        assertThat(RestOpenApiEndpoint.pickBestScheme(null, null)).isNull();
-    }
-
-    @Test
-    public void shouldRaiseExceptionsForMissingSpecifications() {
-        final CamelContext camelContext = mock(CamelContext.class);
-        when(camelContext.getClassResolver()).thenReturn(new DefaultClassResolver());
-
-        final URI uri = URI.create("non-existant.json");
-        assertThrows(IllegalArgumentException.class,
-                () -> RestOpenApiEndpoint.loadSpecificationFrom(camelContext, uri));
-    }
-
-    @Test
-    public void shouldResolveUris() {
-        final RestOpenApiEndpoint endpoint = new RestOpenApiEndpoint();
-        endpoint.parameters = new HashMap<>();
-        endpoint.parameters.put("param1", "value1");
-
-        final Map<String, OasParameter> pathParameters = new HashMap<>();
-        pathParameters.put("param1", new Oas20Parameter("param1"));
-        pathParameters.put("param2", new Oas20Parameter("param2"));
-
-        assertThat(endpoint.resolveUri("/path", pathParameters)).isEqualTo("/path");
-        assertThat(endpoint.resolveUri("/path/{param1}", pathParameters)).isEqualTo("/path/value1");
-        assertThat(endpoint.resolveUri("/{param1}/path", pathParameters)).isEqualTo("/value1/path");
-        assertThat(endpoint.resolveUri("/{param1}/path/{param2}", pathParameters)).isEqualTo("/value1/path/{param2}");
-        assertThat(endpoint.resolveUri("/{param1}/{param2}", pathParameters)).isEqualTo("/value1/{param2}");
-        assertThat(endpoint.resolveUri("/path/{param1}/to/{param2}/rest", pathParameters))
-                .isEqualTo("/path/value1/to/{param2}/rest");
-    }
-
-    @Test
-    public void shouldSerializeGivenLiteralValues() {
-        final RestOpenApiEndpoint endpoint = new RestOpenApiEndpoint();
-        endpoint.parameters = new HashMap<>();
-        endpoint.parameters.put("param", "va lue");
-
-        final OasParameter queryParameter = new Oas20Parameter("param");
-
-        assertThat(endpoint.literalQueryParameterValue(queryParameter)).isEqualTo("param=va%20lue");
-
-        final Oas20Parameter pathParameter = new Oas20Parameter("param");
-        assertThat(endpoint.literalPathParameterValue(pathParameter)).isEqualTo("va%20lue");
-    }
-
-    @Test
-    public void shouldUseDefaultSpecificationUri() {
-        final RestOpenApiComponent component = new RestOpenApiComponent();
-
-        final RestOpenApiEndpoint endpoint = new RestOpenApiEndpoint(
-                "rest-openapi:getPetById", "getPetById", component,
-                Collections.emptyMap());
-
-        assertThat(endpoint.getSpecificationUri()).isEqualTo(RestOpenApiComponent.DEFAULT_SPECIFICATION_URI);
-    }
-
-    @Test
-    public void shouldUseDefaultSpecificationUriEvenIfHashIsPresent() {
-        final RestOpenApiComponent component = new RestOpenApiComponent();
-
-        final RestOpenApiEndpoint endpoint = new RestOpenApiEndpoint(
-                "rest-openapi:#getPetById", "#getPetById",
-                component, Collections.emptyMap());
-
-        assertThat(endpoint.getSpecificationUri()).isEqualTo(RestOpenApiComponent.DEFAULT_SPECIFICATION_URI);
-    }
-
-}
diff --git a/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpointV3Test.java b/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpointV3Test.java
index fd5a873de83..75276640e1f 100644
--- a/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpointV3Test.java
+++ b/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpointV3Test.java
@@ -24,14 +24,20 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import io.apicurio.datamodels.core.models.common.SecurityRequirement;
-import io.apicurio.datamodels.openapi.models.OasParameter;
-import io.apicurio.datamodels.openapi.models.OasResponse;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Document;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Operation;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Parameter;
-import io.apicurio.datamodels.openapi.v3.models.Oas30Response;
-import io.apicurio.datamodels.openapi.v3.models.Oas30SecurityScheme;
+import io.swagger.v3.oas.models.Components;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.Operation;
+import io.swagger.v3.oas.models.media.Content;
+import io.swagger.v3.oas.models.media.MediaType;
+import io.swagger.v3.oas.models.parameters.Parameter;
+import io.swagger.v3.oas.models.parameters.RequestBody;
+import io.swagger.v3.oas.models.responses.ApiResponse;
+import io.swagger.v3.oas.models.responses.ApiResponses;
+import io.swagger.v3.oas.models.security.SecurityRequirement;
+import io.swagger.v3.oas.models.security.SecurityScheme;
+import io.swagger.v3.oas.models.security.SecurityScheme.In;
+import io.swagger.v3.oas.models.security.SecurityScheme.Type;
+import io.swagger.v3.oas.models.servers.Server;
 import org.apache.camel.CamelContext;
 import org.apache.camel.impl.engine.DefaultClassResolver;
 import org.apache.camel.spi.RestConfiguration;
@@ -69,18 +75,17 @@ public class RestOpenApiEndpointV3Test {
         final RestOpenApiEndpoint endpoint = new RestOpenApiEndpoint();
         endpoint.parameters = new HashMap<>();
         endpoint.parameters.put("literal", "value");
-        assertThat(endpoint.queryParameter(new Oas30Parameter())).isEqualTo("");
-        assertThat(endpoint.queryParameter(new Oas30Parameter("param"))).isEqualTo("param={param?}");
-        assertThat(endpoint.queryParameter(new Oas30Parameter("literal"))).isEqualTo("literal=value");
+        assertThat(endpoint.queryParameter(new Parameter())).isEqualTo("");
+        assertThat(endpoint.queryParameter(new Parameter().name("param"))).isEqualTo("param={param?}");
+        assertThat(endpoint.queryParameter(new Parameter().name("literal"))).isEqualTo("literal=value");
     }
 
     @Test
     public void shouldCreateQueryParameterExpressions() {
-        Oas30Parameter oas30Parameter = new Oas30Parameter("q");
-        oas30Parameter.required = true;
+        Parameter oas30Parameter = new Parameter().name("q").required(true);
         assertThat(RestOpenApiEndpoint.queryParameterExpression(oas30Parameter))
                 .isEqualTo("q={q}");
-        oas30Parameter.required = false;
+        oas30Parameter = new Parameter().name("q").required(false);
         assertThat(RestOpenApiEndpoint.queryParameterExpression(oas30Parameter))
                 .isEqualTo("q={q?}");
     }
@@ -92,7 +97,7 @@ public class RestOpenApiEndpointV3Test {
         final CamelContext camelContext = mock(CamelContext.class);
         when(camelContext.getRestConfiguration()).thenReturn(restConfiguration);
 
-        final Oas30Document openapi = new Oas30Document();
+        final OpenAPI openapi = new OpenAPI();
 
         final RestOpenApiComponent component = new RestOpenApiComponent();
         component.setCamelContext(camelContext);
@@ -109,7 +114,7 @@ public class RestOpenApiEndpointV3Test {
                 "When base path is specified in REST configuration and not specified in component the base path should be from the REST configuration")
                 .isEqualTo("/rest");
 
-        openapi.addServer("http://petstore.openapi.io", "v3 test");
+        openapi.addServersItem(new Server().url("http://petstore.openapi.io").description("v3 test"));
 
         component.setBasePath("/component");
         assertThat(endpoint.determineBasePath(openapi)).as(
@@ -134,9 +139,8 @@ public class RestOpenApiEndpointV3Test {
                 Collections.emptyMap());
         endpoint.setHost("http://petstore.openapi.io");
 
-        final Oas30Document openapi = new Oas30Document();
-        final Oas30Operation operation = new Oas30Operation("get");
-        operation.createParameter();
+        final OpenAPI openapi = new OpenAPI();
+        final Operation operation = new Operation().operationId("get");
         assertThat(endpoint.determineEndpointParameters(openapi, operation))
                 .containsOnly(entry("host", "http://petstore.openapi.io"));
 
@@ -148,18 +152,17 @@ public class RestOpenApiEndpointV3Test {
         consumers.add("application/json");
         List<String> produces = new ArrayList<String>();
         produces.add("application/xml");
-        operation.requestBody = operation.createRequestBody();
-        operation.responses = operation.createResponses();
-        operation.responses.addResponse("200", operation.responses.createResponse("200"));
+        //        operation.requestBody = operation.createRequestBody();
+        //        operation.responses = operation.createResponses();
+        //        operation.responses.addResponse("200", operation.responses.createResponse("200"));
         for (String consumer : consumers) {
-            operation.requestBody.content.put(consumer, operation.requestBody.createMediaType(consumer));
-
+            operation.requestBody(new RequestBody().content(new Content().addMediaType(consumer, new MediaType()))); // MediaType object should be schema?
         }
+        ApiResponses apiResponses = new ApiResponses();
+        operation.responses(apiResponses);
+        // Can only have one content per response...
         for (String produce : produces) {
-            for (OasResponse response : operation.responses.getResponses()) {
-                Oas30Response oas30Response = (Oas30Response) response;
-                oas30Response.content.put(produce, oas30Response.createMediaType(produce));
-            }
+            apiResponses.addApiResponse("200", new ApiResponse().content(new Content().addMediaType(produce, new MediaType())));
         }
 
         assertThat(endpoint.determineEndpointParameters(openapi, operation)).containsOnly(
@@ -183,18 +186,15 @@ public class RestOpenApiEndpointV3Test {
                 entry("host", "http://petstore.openapi.io"), entry("producerComponentName", "zyx"),
                 entry("consumes", "application/json"), entry("produces", "application/atom+xml"));
 
-        Oas30Parameter oas30Parameter = new Oas30Parameter("q");
-        oas30Parameter.in = "query";
-        oas30Parameter.required = true;
-        operation.addParameter(oas30Parameter);
+        Parameter parameter1 = new Parameter().name("q").in("query").required(true);
+        operation.addParametersItem(parameter1);
         assertThat(endpoint.determineEndpointParameters(openapi, operation)).containsOnly(
                 entry("host", "http://petstore.openapi.io"), entry("producerComponentName", "zyx"),
                 entry("consumes", "application/json"), entry("produces", "application/atom+xml"),
                 entry("queryParameters", "q={q}"));
 
-        oas30Parameter = new Oas30Parameter("o");
-        oas30Parameter.in = "query";
-        operation.addParameter(oas30Parameter);
+        Parameter parameter2 = new Parameter().name("o").in("query");
+        operation.addParametersItem(parameter2);
         assertThat(endpoint.determineEndpointParameters(openapi, operation)).containsOnly(
                 entry("host", "http://petstore.openapi.io"), entry("producerComponentName", "zyx"),
                 entry("consumes", "application/json"), entry("produces", "application/atom+xml"),
@@ -239,35 +239,36 @@ public class RestOpenApiEndpointV3Test {
                 "rest-openapi:http://some-uri#getPetById",
                 "http://some-uri#getPetById", component, Collections.emptyMap());
 
-        final Oas30Document openapi = new Oas30Document();
-        openapi.addServer("http://petstore.openapi.io", "v3 test");
-        openapi.addServer("http://anotherpetstore.openapi.io", "v3 test");
-
-        assertThat(endpoint.determineHost(openapi)).isEqualTo("http://petstore.openapi.io");
+        final OpenAPI openapi = new OpenAPI();
+        openapi.addServersItem(new Server().url("http://petstore.openapi.io").description("v3 test"));
+        openapi.addServersItem(new Server().url("http://anotherpetstore.openapi.io").description("v3 test"));
+        Operation dummyOp = new Operation();
+        assertThat(endpoint.determineHost(openapi, dummyOp)).isEqualTo("http://petstore.openapi.io");
 
         openapi.getServers().clear();
-        openapi.addServer("https://petstore.openapi.io", "v3 test");
-        assertThat(endpoint.determineHost(openapi)).isEqualTo("https://petstore.openapi.io");
+        openapi.addServersItem(new Server().url("https://petstore.openapi.io").description("v3 test"));
+        assertThat(endpoint.determineHost(openapi, dummyOp)).isEqualTo("https://petstore.openapi.io");
     }
 
     @Test
     public void shouldDetermineOptions() {
         assertThat(RestOpenApiEndpoint.determineOption(null, null, null, null)).isNull();
 
-        assertThat(RestOpenApiEndpoint.determineOption(Collections.emptyList(), Collections.emptyList(), "", ""))
+        assertThat(RestOpenApiEndpoint.determineOption(Collections.emptyList(), Collections.emptySet(), "", ""))
                 .isNull();
 
         assertThat(RestOpenApiEndpoint.determineOption(Arrays.asList("specification"), null, null, null))
                 .isEqualTo("specification");
 
         assertThat(
-                RestOpenApiEndpoint.determineOption(Arrays.asList("specification"), Arrays.asList("operation"), null, null))
+                RestOpenApiEndpoint.determineOption(Arrays.asList("specification"), Collections.singleton("operation"), null,
+                        null))
                 .isEqualTo("operation");
 
-        assertThat(RestOpenApiEndpoint.determineOption(Arrays.asList("specification"), Arrays.asList("operation"),
+        assertThat(RestOpenApiEndpoint.determineOption(Arrays.asList("specification"), Collections.singleton("operation"),
                 "component", null)).isEqualTo("component");
 
-        assertThat(RestOpenApiEndpoint.determineOption(Arrays.asList("specification"), Arrays.asList("operation"),
+        assertThat(RestOpenApiEndpoint.determineOption(Arrays.asList("specification"), Collections.singleton("operation"),
                 "component", "operation")).isEqualTo("operation");
     }
 
@@ -309,23 +310,23 @@ public class RestOpenApiEndpointV3Test {
                 "petstore:http://specification-uri#getPetById",
                 "http://specification-uri#getPetById", component, Collections.emptyMap());
 
-        final Oas30Document openapi = new Oas30Document();
-
-        assertThat(endpoint.determineHost(openapi)).isEqualTo("http://specification-uri");
+        final OpenAPI openapi = new OpenAPI();
+        Operation dummyOp = new Operation();
+        assertThat(endpoint.determineHost(openapi, dummyOp)).isEqualTo("http://specification-uri");
 
         globalRestConfiguration.setHost("global-rest");
         globalRestConfiguration.setScheme("http");
-        assertThat(endpoint.determineHost(openapi)).isEqualTo("http://global-rest");
+        assertThat(endpoint.determineHost(openapi, dummyOp)).isEqualTo("http://global-rest");
 
         globalRestConfiguration.setHost("component-rest");
         globalRestConfiguration.setScheme("http");
-        assertThat(endpoint.determineHost(openapi)).isEqualTo("http://component-rest");
+        assertThat(endpoint.determineHost(openapi, dummyOp)).isEqualTo("http://component-rest");
 
         component.setHost("http://component");
-        assertThat(endpoint.determineHost(openapi)).isEqualTo("http://component");
+        assertThat(endpoint.determineHost(openapi, dummyOp)).isEqualTo("http://component");
 
         endpoint.setHost("http://endpoint");
-        assertThat(endpoint.determineHost(openapi)).isEqualTo("http://endpoint");
+        assertThat(endpoint.determineHost(openapi, dummyOp)).isEqualTo("http://endpoint");
     }
 
     @Test
@@ -340,27 +341,21 @@ public class RestOpenApiEndpointV3Test {
                 Collections.emptyMap());
         endpoint.setHost("http://petstore.openapi.io");
 
-        final Oas30Document openapi = new Oas30Document();
-        final Oas30SecurityScheme apiKeys = new Oas30SecurityScheme("key");
-        apiKeys.name = "key";
-        apiKeys.in = "header";
-        openapi.components = openapi.createComponents();
+        final OpenAPI openapi = new OpenAPI();
+        final SecurityScheme apiKeys = new SecurityScheme().type(Type.APIKEY).in(In.HEADER).name("key");
+
+        openapi.components(new Components().addSecuritySchemes("apiKeys", apiKeys));
 
-        openapi.components.addSecurityScheme("apiKeys", apiKeys);
+        final Operation operation = new Operation().operationId("get");
+        Parameter oas30Parameter = new Parameter().name("q").in("query").required(true);
+        operation.addParametersItem(oas30Parameter);
 
-        final Oas30Operation operation = new Oas30Operation("get");
-        Oas30Parameter oas30Parameter = new Oas30Parameter("q");
-        oas30Parameter.in = "query";
-        oas30Parameter.required = true;
-        operation.addParameter(oas30Parameter);
-        SecurityRequirement securityRequirement = operation.createSecurityRequirement();
-        securityRequirement.addSecurityRequirementItem("apiKeys", Collections.emptyList());
-        operation.addSecurityRequirement(securityRequirement);
+        operation.addSecurityItem(new SecurityRequirement().addList("apiKeys", Collections.emptyList()));
 
         assertThat(endpoint.determineEndpointParameters(openapi, operation))
                 .containsOnly(entry("host", "http://petstore.openapi.io"), entry("queryParameters", "q={q}"));
 
-        apiKeys.in = "query";
+        apiKeys.setIn(In.QUERY);
         assertThat(endpoint.determineEndpointParameters(openapi, operation))
                 .containsOnly(entry("host", "http://petstore.openapi.io"), entry("queryParameters", "key={key}&q={q}"));
     }
@@ -397,9 +392,9 @@ public class RestOpenApiEndpointV3Test {
         endpoint.parameters = new HashMap<>();
         endpoint.parameters.put("param1", "value1");
 
-        final Map<String, OasParameter> pathParameters = new HashMap<>();
-        pathParameters.put("param1", new Oas30Parameter("param1"));
-        pathParameters.put("param2", new Oas30Parameter("param2"));
+        final Map<String, Parameter> pathParameters = new HashMap<>();
+        pathParameters.put("param1", new Parameter().name("param1"));
+        pathParameters.put("param2", new Parameter().name("param2"));
 
         assertThat(endpoint.resolveUri("/path", pathParameters)).isEqualTo("/path");
         assertThat(endpoint.resolveUri("/path/{param1}", pathParameters)).isEqualTo("/path/value1");
@@ -416,11 +411,11 @@ public class RestOpenApiEndpointV3Test {
         endpoint.parameters = new HashMap<>();
         endpoint.parameters.put("param", "va lue");
 
-        final OasParameter queryParameter = new Oas30Parameter("param");
+        final Parameter queryParameter = new Parameter().name("param");
 
         assertThat(endpoint.literalQueryParameterValue(queryParameter)).isEqualTo("param=va%20lue");
 
-        final Oas30Parameter pathParameter = new Oas30Parameter("param");
+        final Parameter pathParameter = new Parameter().name("param");
         assertThat(endpoint.literalPathParameterValue(pathParameter)).isEqualTo("va%20lue");
     }
 
diff --git a/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiGlobalHttpsV31Test.java b/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiGlobalHttpsV31Test.java
new file mode 100644
index 00000000000..b395853e18f
--- /dev/null
+++ b/components/camel-rest-openapi/src/test/java/org/apache/camel/component/rest/openapi/RestOpenApiGlobalHttpsV31Test.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.rest.openapi;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+import org.apache.camel.CamelContext;
+import org.junit.jupiter.api.BeforeAll;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+
+public class RestOpenApiGlobalHttpsV31Test extends HttpsV3Test {
+
+    @BeforeAll
+    public static void setupStubForSpec() throws IOException, URISyntaxException {
+        petstore.stubFor(get(urlEqualTo("/petstore-3.1.yaml")).willReturn(aResponse().withBody(
+                Files.readAllBytes(Paths.get(RestOpenApiGlobalHttpsTest.class.getResource("/petstore-3.1.yaml").toURI())))));
+    }
+
+    @Override
+    protected String getSpecName() {
+        return "/petstore-3.1.yaml";
+    }
+
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        CamelContext camelContext = super.createCamelContext();
+        camelContext.setSSLContextParameters(createHttpsParameters(camelContext));
+
+        RestOpenApiComponent component = camelContext.getComponent("petStore", RestOpenApiComponent.class);
+        component.setUseGlobalSslContextParameters(true);
+
+        return camelContext;
+    }
+}
diff --git a/components/camel-rest-openapi/src/test/resources/openapi-v3.json b/components/camel-rest-openapi/src/test/resources/openapi-v3.json
index fa698db24b0..42f2e20c053 100644
--- a/components/camel-rest-openapi/src/test/resources/openapi-v3.json
+++ b/components/camel-rest-openapi/src/test/resources/openapi-v3.json
@@ -1,21 +1,1240 @@
-{"openapi":"3.0.2","info":{"title":"Swagger Petstore - OpenAPI 3.0","description":"This is a sample Pet Store Server based on the OpenAPI 3.0 specification.  You can find out more about\nSwagger at [http://swagger.io](http://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!\nYou can now help us improve the API whether it's by making changes to the definition itself or to the code.\nThat way, with time, we can improve the API in general, an [...]
-    {
-      "url": "{scheme}://{host}/{basePath}",
-      "variables": {
-        "scheme": {
-          "enum": [
-            "https",
-            "http"
-          ],
-          "default": "https"
-        },
-        "host": {
-          "default": "petstore.swagger.io"
-        },
-        "basePath": {
-          "default": "/api/v3"
-        }
-        
-      }
-    }
-  ],"tags":[{"name":"pet","description":"Everything about your Pets","externalDocs":{"description":"Find out more","url":"http://swagger.io"}},{"name":"store","description":"Operations about user"},{"name":"user","description":"Access to Petstore orders","externalDocs":{"description":"Find out more about our store","url":"http://swagger.io"}}],"paths":{"/pet":{"put":{"tags":["pet"],"summary":"Update an existing pet","description":"Update an existing pet by Id","operationId":"updatePet"," [...]
+{
+	"openapi": "3.0.2",
+	"info": {
+		"title": "Swagger Petstore - OpenAPI 3.0",
+		"description": "This is a sample Pet Store Server based on the OpenAPI 3.0 specification.  You can find out more about\nSwagger at [http://swagger.io](http://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!\nYou can now help us improve the API whether it's by making changes to the definition itself or to the code.\nThat way, with time, we can improve the API in general, and expose some of the new features in OAS3.\n\nSome useful links:\ [...]
+		"termsOfService": "http://swagger.io/terms/",
+		"contact": {
+			"email": "apiteam@swagger.io"
+		},
+		"license": {
+			"name": "Apache 2.0",
+			"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+		},
+		"version": "1.0.4"
+	},
+	"externalDocs": {
+		"description": "Find out more about Swagger",
+		"url": "http://swagger.io"
+	},
+	"servers": [
+		{
+			"url": "{scheme}://{host}/{basePath}",
+			"variables": {
+				"scheme": {
+					"enum": [
+						"https",
+						"http"
+					],
+					"default": "https"
+				},
+				"host": {
+					"default": "petstore.swagger.io"
+				},
+				"basePath": {
+					"default": "/api/v3"
+				}
+			}
+		}
+	],
+	"tags": [
+		{
+			"name": "pet",
+			"description": "Everything about your Pets",
+			"externalDocs": {
+				"description": "Find out more",
+				"url": "http://swagger.io"
+			}
+		},
+		{
+			"name": "store",
+			"description": "Operations about user"
+		},
+		{
+			"name": "user",
+			"description": "Access to Petstore orders",
+			"externalDocs": {
+				"description": "Find out more about our store",
+				"url": "http://swagger.io"
+			}
+		}
+	],
+	"paths": {
+		"/pet": {
+			"put": {
+				"tags": [
+					"pet"
+				],
+				"summary": "Update an existing pet",
+				"description": "Update an existing pet by Id",
+				"operationId": "updatePet",
+				"requestBody": {
+					"description": "Update an existent pet in the store",
+					"content": {
+						"application/json": {
+							"schema": {
+								"$ref": "#/components/schemas/Pet"
+							}
+						},
+						"application/xml": {
+							"schema": {
+								"$ref": "#/components/schemas/Pet"
+							}
+						},
+						"application/x-www-form-urlencoded": {
+							"schema": {
+								"$ref": "#/components/schemas/Pet"
+							}
+						}
+					},
+					"required": true
+				},
+				"responses": {
+					"200": {
+						"description": "Successful operation",
+						"content": {
+							"application/xml": {
+								"schema": {
+									"$ref": "#/components/schemas/Pet"
+								}
+							},
+							"application/json": {
+								"schema": {
+									"$ref": "#/components/schemas/Pet"
+								}
+							}
+						}
+					},
+					"400": {
+						"description": "Invalid ID supplied"
+					},
+					"404": {
+						"description": "Pet not found"
+					},
+					"405": {
+						"description": "Validation exception"
+					}
+				},
+				"security": [
+					{
+						"petstore_auth": [
+							"write:pets",
+							"read:pets"
+						]
+					}
+				]
+			},
+			"post": {
+				"tags": [
+					"pet"
+				],
+				"summary": "Add a new pet to the store",
+				"description": "Add a new pet to the store",
+				"operationId": "addPet",
+				"requestBody": {
+					"description": "Create a new pet in the store",
+					"content": {
+						"application/json": {
+							"schema": {
+								"$ref": "#/components/schemas/Pet"
+							}
+						},
+						"application/xml": {
+							"schema": {
+								"$ref": "#/components/schemas/Pet"
+							}
+						},
+						"application/x-www-form-urlencoded": {
+							"schema": {
+								"$ref": "#/components/schemas/Pet"
+							}
+						}
+					},
+					"required": true
+				},
+				"responses": {
+					"200": {
+						"description": "Successful operation",
+						"content": {
+							"application/xml": {
+								"schema": {
+									"$ref": "#/components/schemas/Pet"
+								}
+							},
+							"application/json": {
+								"schema": {
+									"$ref": "#/components/schemas/Pet"
+								}
+							}
+						}
+					},
+					"405": {
+						"description": "Invalid input"
+					}
+				},
+				"security": [
+					{
+						"petstore_auth": [
+							"write:pets",
+							"read:pets"
+						]
+					}
+				]
+			}
+		},
+		"/pet/findByStatus": {
+			"get": {
+				"tags": [
+					"pet"
+				],
+				"summary": "Finds Pets by status",
+				"description": "Multiple status values can be provided with comma separated strings",
+				"operationId": "findPetsByStatus",
+				"parameters": [
+					{
+						"name": "status",
+						"in": "query",
+						"description": "Status values that need to be considered for filter",
+						"required": false,
+						"explode": true,
+						"schema": {
+							"type": "string",
+							"default": "available",
+							"enum": [
+								"available",
+								"pending",
+								"sold"
+							]
+						}
+					}
+				],
+				"responses": {
+					"200": {
+						"description": "successful operation",
+						"content": {
+							"application/xml": {
+								"schema": {
+									"type": "array",
+									"items": {
+										"$ref": "#/components/schemas/Pet"
+									}
+								}
+							},
+							"application/json": {
+								"schema": {
+									"type": "array",
+									"items": {
+										"$ref": "#/components/schemas/Pet"
+									}
+								}
+							}
+						}
+					},
+					"400": {
+						"description": "Invalid status value"
+					}
+				},
+				"security": [
+					{
+						"petstore_auth": [
+							"write:pets",
+							"read:pets"
+						]
+					}
+				]
+			}
+		},
+		"/pet/findByTags": {
+			"get": {
+				"tags": [
+					"pet"
+				],
+				"summary": "Finds Pets by tags",
+				"description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
+				"operationId": "findPetsByTags",
+				"parameters": [
+					{
+						"name": "tags",
+						"in": "query",
+						"description": "Tags to filter by",
+						"required": false,
+						"explode": true,
+						"schema": {
+							"type": "array",
+							"items": {
+								"type": "string"
+							}
+						}
+					}
+				],
+				"responses": {
+					"200": {
+						"description": "successful operation",
+						"content": {
+							"application/xml": {
+								"schema": {
+									"type": "array",
+									"items": {
+										"$ref": "#/components/schemas/Pet"
+									}
+								}
+							},
+							"application/json": {
+								"schema": {
+									"type": "array",
+									"items": {
+										"$ref": "#/components/schemas/Pet"
+									}
+								}
+							}
+						}
+					},
+					"400": {
+						"description": "Invalid tag value"
+					}
+				},
+				"security": [
+					{
+						"petstore_auth": [
+							"write:pets",
+							"read:pets"
+						]
+					}
+				]
+			}
+		},
+		"/pet/{petId}": {
+			"get": {
+				"tags": [
+					"pet"
+				],
+				"summary": "Find pet by ID",
+				"description": "Returns a single pet",
+				"operationId": "getPetById",
+				"parameters": [
+					{
+						"name": "petId",
+						"in": "path",
+						"description": "ID of pet to return",
+						"required": true,
+						"schema": {
+							"type": "integer",
+							"format": "int64"
+						}
+					}
+				],
+				"responses": {
+					"200": {
+						"description": "successful operation",
+						"content": {
+							"application/xml": {
+								"schema": {
+									"$ref": "#/components/schemas/Pet"
+								}
+							},
+							"application/json": {
+								"schema": {
+									"$ref": "#/components/schemas/Pet"
+								}
+							}
+						}
+					},
+					"400": {
+						"description": "Invalid ID supplied"
+					},
+					"404": {
+						"description": "Pet not found"
+					}
+				},
+				"security": [
+					{
+						"api_key": []
+					},
+					{
+						"petstore_auth": [
+							"write:pets",
+							"read:pets"
+						]
+					}
+				]
+			},
+			"post": {
+				"tags": [
+					"pet"
+				],
+				"summary": "Updates a pet in the store with form data",
+				"description": "",
+				"operationId": "updatePetWithForm",
+				"parameters": [
+					{
+						"name": "petId",
+						"in": "path",
+						"description": "ID of pet that needs to be updated",
+						"required": true,
+						"schema": {
+							"type": "integer",
+							"format": "int64"
+						}
+					},
+					{
+						"name": "name",
+						"in": "query",
+						"description": "Name of pet that needs to be updated",
+						"schema": {
+							"type": "string"
+						}
+					},
+					{
+						"name": "status",
+						"in": "query",
+						"description": "Status of pet that needs to be updated",
+						"schema": {
+							"type": "string"
+						}
+					}
+				],
+				"responses": {
+					"405": {
+						"description": "Invalid input"
+					}
+				},
+				"security": [
+					{
+						"petstore_auth": [
+							"write:pets",
+							"read:pets"
+						]
+					}
+				]
+			},
+			"delete": {
+				"tags": [
+					"pet"
+				],
+				"summary": "Deletes a pet",
+				"description": "",
+				"operationId": "deletePet",
+				"parameters": [
+					{
+						"name": "api_key",
+						"in": "header",
+						"description": "",
+						"required": false,
+						"schema": {
+							"type": "string"
+						}
+					},
+					{
+						"name": "petId",
+						"in": "path",
+						"description": "Pet id to delete",
+						"required": true,
+						"schema": {
+							"type": "integer",
+							"format": "int64"
+						}
+					}
+				],
+				"responses": {
+					"400": {
+						"description": "Invalid pet value"
+					}
+				},
+				"security": [
+					{
+						"petstore_auth": [
+							"write:pets",
+							"read:pets"
+						]
+					}
+				]
+			}
+		},
+		"/pet/{petId}/uploadImage": {
+			"post": {
+				"tags": [
+					"pet"
+				],
+				"summary": "uploads an image",
+				"description": "",
+				"operationId": "uploadFile",
+				"parameters": [
+					{
+						"name": "petId",
+						"in": "path",
+						"description": "ID of pet to update",
+						"required": true,
+						"schema": {
+							"type": "integer",
+							"format": "int64"
+						}
+					},
+					{
+						"name": "additionalMetadata",
+						"in": "query",
+						"description": "Additional Metadata",
+						"required": false,
+						"schema": {
+							"type": "string"
+						}
+					}
+				],
+				"requestBody": {
+					"content": {
+						"application/octet-stream": {
+							"schema": {
+								"type": "string",
+								"format": "binary"
+							}
+						}
+					}
+				},
+				"responses": {
+					"200": {
+						"description": "successful operation",
+						"content": {
+							"application/json": {
+								"schema": {
+									"$ref": "#/components/schemas/ApiResponse"
+								}
+							}
+						}
+					}
+				},
+				"security": [
+					{
+						"petstore_auth": [
+							"write:pets",
+							"read:pets"
+						]
+					}
+				]
+			}
+		},
+		"/store/inventory": {
+			"get": {
+				"tags": [
+					"store"
+				],
+				"summary": "Returns pet inventories by status",
+				"description": "Returns a map of status codes to quantities",
+				"operationId": "getInventory",
+				"responses": {
+					"200": {
+						"description": "successful operation",
+						"content": {
+							"application/json": {
+								"schema": {
+									"type": "object",
+									"additionalProperties": {
+										"type": "integer",
+										"format": "int32"
+									}
+								}
+							}
+						}
+					}
+				},
+				"security": [
+					{
+						"api_key": []
+					}
+				]
+			}
+		},
+		"/store/order": {
+			"post": {
+				"tags": [
+					"store"
+				],
+				"summary": "Place an order for a pet",
+				"description": "Place a new order in the store",
+				"operationId": "placeOrder",
+				"requestBody": {
+					"content": {
+						"application/json": {
+							"schema": {
+								"$ref": "#/components/schemas/Order"
+							}
+						},
+						"application/xml": {
+							"schema": {
+								"$ref": "#/components/schemas/Order"
+							}
+						},
+						"application/x-www-form-urlencoded": {
+							"schema": {
+								"$ref": "#/components/schemas/Order"
+							}
+						}
+					}
+				},
+				"responses": {
+					"200": {
+						"description": "successful operation",
+						"content": {
+							"application/json": {
+								"schema": {
+									"$ref": "#/components/schemas/Order"
+								}
+							}
+						}
+					},
+					"405": {
+						"description": "Invalid input"
+					}
+				}
+			}
+		},
+		"/store/order/{orderId}": {
+			"get": {
+				"tags": [
+					"store"
+				],
+				"summary": "Find purchase order by ID",
+				"description": "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions",
+				"operationId": "getOrderById",
+				"parameters": [
+					{
+						"name": "orderId",
+						"in": "path",
+						"description": "ID of order that needs to be fetched",
+						"required": true,
+						"schema": {
+							"type": "integer",
+							"format": "int64"
+						}
+					}
+				],
+				"responses": {
+					"200": {
+						"description": "successful operation",
+						"content": {
+							"application/xml": {
+								"schema": {
+									"$ref": "#/components/schemas/Order"
+								}
+							},
+							"application/json": {
+								"schema": {
+									"$ref": "#/components/schemas/Order"
+								}
+							}
+						}
+					},
+					"400": {
+						"description": "Invalid ID supplied"
+					},
+					"404": {
+						"description": "Order not found"
+					}
+				}
+			},
+			"delete": {
+				"tags": [
+					"store"
+				],
+				"summary": "Delete purchase order by ID",
+				"description": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
+				"operationId": "deleteOrder",
+				"parameters": [
+					{
+						"name": "orderId",
+						"in": "path",
+						"description": "ID of the order that needs to be deleted",
+						"required": true,
+						"schema": {
+							"type": "integer",
+							"format": "int64"
+						}
+					}
+				],
+				"responses": {
+					"400": {
+						"description": "Invalid ID supplied"
+					},
+					"404": {
+						"description": "Order not found"
+					}
+				}
+			}
+		},
+		"/user": {
+			"post": {
+				"tags": [
+					"user"
+				],
+				"summary": "Create user",
+				"description": "This can only be done by the logged in user.",
+				"operationId": "createUser",
+				"requestBody": {
+					"description": "Created user object",
+					"content": {
+						"application/json": {
+							"schema": {
+								"$ref": "#/components/schemas/User"
+							}
+						},
+						"application/xml": {
+							"schema": {
+								"$ref": "#/components/schemas/User"
+							}
+						},
+						"application/x-www-form-urlencoded": {
+							"schema": {
+								"$ref": "#/components/schemas/User"
+							}
+						}
+					}
+				},
+				"responses": {
+					"default": {
+						"description": "successful operation",
+						"content": {
+							"application/json": {
+								"schema": {
+									"$ref": "#/components/schemas/User"
+								}
+							},
+							"application/xml": {
+								"schema": {
+									"$ref": "#/components/schemas/User"
+								}
+							}
+						}
+					}
+				}
+			}
+		},
+		"/user/createWithList": {
+			"post": {
+				"tags": [
+					"user"
+				],
+				"summary": "Creates list of users with given input array",
+				"description": "Creates list of users with given input array",
+				"operationId": "createUsersWithListInput",
+				"requestBody": {
+					"content": {
+						"application/json": {
+							"schema": {
+								"type": "array",
+								"items": {
+									"$ref": "#/components/schemas/User"
+								}
+							}
+						}
+					}
+				},
+				"responses": {
+					"200": {
+						"description": "Successful operation",
+						"content": {
+							"application/xml": {
+								"schema": {
+									"$ref": "#/components/schemas/User"
+								}
+							},
+							"application/json": {
+								"schema": {
+									"$ref": "#/components/schemas/User"
+								}
+							}
+						}
+					},
+					"default": {
+						"description": "successful operation"
+					}
+				}
+			}
+		},
+		"/user/login": {
+			"get": {
+				"tags": [
+					"user"
+				],
+				"summary": "Logs user into the system",
+				"description": "",
+				"operationId": "loginUser",
+				"parameters": [
+					{
+						"name": "username",
+						"in": "query",
+						"description": "The user name for login",
+						"required": false,
+						"schema": {
+							"type": "string"
+						}
+					},
+					{
+						"name": "password",
+						"in": "query",
+						"description": "The password for login in clear text",
+						"required": false,
+						"schema": {
+							"type": "string"
+						}
+					}
+				],
+				"responses": {
+					"200": {
+						"description": "successful operation",
+						"headers": {
+							"X-Rate-Limit": {
+								"description": "calls per hour allowed by the user",
+								"schema": {
+									"type": "integer",
+									"format": "int32"
+								}
+							},
+							"X-Expires-After": {
+								"description": "date in UTC when toekn expires",
+								"schema": {
+									"type": "string",
+									"format": "date-time"
+								}
+							}
+						},
+						"content": {
+							"application/xml": {
+								"schema": {
+									"type": "string"
+								}
+							},
+							"application/json": {
+								"schema": {
+									"type": "string"
+								}
+							}
+						}
+					},
+					"400": {
+						"description": "Invalid username/password supplied"
+					}
+				}
+			}
+		},
+		"/user/logout": {
+			"get": {
+				"tags": [
+					"user"
+				],
+				"summary": "Logs out current logged in user session",
+				"description": "",
+				"operationId": "logoutUser",
+				"parameters": [],
+				"responses": {
+					"default": {
+						"description": "successful operation"
+					}
+				}
+			}
+		},
+		"/user/{username}": {
+			"get": {
+				"tags": [
+					"user"
+				],
+				"summary": "Get user by user name",
+				"description": "",
+				"operationId": "getUserByName",
+				"parameters": [
+					{
+						"name": "username",
+						"in": "path",
+						"description": "The name that needs to be fetched. Use user1 for testing. ",
+						"required": true,
+						"schema": {
+							"type": "string"
+						}
+					}
+				],
+				"responses": {
+					"200": {
+						"description": "successful operation",
+						"content": {
+							"application/xml": {
+								"schema": {
+									"$ref": "#/components/schemas/User"
+								}
+							},
+							"application/json": {
+								"schema": {
+									"$ref": "#/components/schemas/User"
+								}
+							}
+						}
+					},
+					"400": {
+						"description": "Invalid username supplied"
+					},
+					"404": {
+						"description": "User not found"
+					}
+				}
+			},
+			"put": {
+				"tags": [
+					"user"
+				],
+				"summary": "Update user",
+				"description": "This can only be done by the logged in user.",
+				"operationId": "updateUser",
+				"parameters": [
+					{
+						"name": "username",
+						"in": "path",
+						"description": "name that need to be deleted",
+						"required": true,
+						"schema": {
+							"type": "string"
+						}
+					}
+				],
+				"requestBody": {
+					"description": "Update an existent user in the store",
+					"content": {
+						"application/json": {
+							"schema": {
+								"$ref": "#/components/schemas/User"
+							}
+						},
+						"application/xml": {
+							"schema": {
+								"$ref": "#/components/schemas/User"
+							}
+						},
+						"application/x-www-form-urlencoded": {
+							"schema": {
+								"$ref": "#/components/schemas/User"
+							}
+						}
+					}
+				},
+				"responses": {
+					"default": {
+						"description": "successful operation"
+					}
+				}
+			},
+			"delete": {
+				"tags": [
+					"user"
+				],
+				"summary": "Delete user",
+				"description": "This can only be done by the logged in user.",
+				"operationId": "deleteUser",
+				"parameters": [
+					{
+						"name": "username",
+						"in": "path",
+						"description": "The name that needs to be deleted",
+						"required": true,
+						"schema": {
+							"type": "string"
+						}
+					}
+				],
+				"responses": {
+					"400": {
+						"description": "Invalid username supplied"
+					},
+					"404": {
+						"description": "User not found"
+					}
+				}
+			}
+		}
+	},
+	"components": {
+		"schemas": {
+			"Order": {
+				"type": "object",
+				"properties": {
+					"id": {
+						"type": "integer",
+						"format": "int64",
+						"example": 10
+					},
+					"petId": {
+						"type": "integer",
+						"format": "int64",
+						"example": 198772
+					},
+					"quantity": {
+						"type": "integer",
+						"format": "int32",
+						"example": 7
+					},
+					"shipDate": {
+						"type": "string",
+						"format": "date-time"
+					},
+					"status": {
+						"type": "string",
+						"description": "Order Status",
+						"example": "approved",
+						"enum": [
+							"placed",
+							"approved",
+							"delivered"
+						]
+					},
+					"complete": {
+						"type": "boolean"
+					}
+				},
+				"xml": {
+					"name": "order"
+				}
+			},
+			"Customer": {
+				"type": "object",
+				"properties": {
+					"id": {
+						"type": "integer",
+						"format": "int64",
+						"example": 100000
+					},
+					"username": {
+						"type": "string",
+						"example": "fehguy"
+					},
+					"address": {
+						"type": "array",
+						"xml": {
+							"name": "addresses",
+							"wrapped": true
+						},
+						"items": {
+							"$ref": "#/components/schemas/Address"
+						}
+					}
+				},
+				"xml": {
+					"name": "customer"
+				}
+			},
+			"Address": {
+				"type": "object",
+				"properties": {
+					"street": {
+						"type": "string",
+						"example": "437 Lytton"
+					},
+					"city": {
+						"type": "string",
+						"example": "Palo Alto"
+					},
+					"state": {
+						"type": "string",
+						"example": "CA"
+					},
+					"zip": {
+						"type": "string",
+						"example": "94301"
+					}
+				},
+				"xml": {
+					"name": "address"
+				}
+			},
+			"Category": {
+				"type": "object",
+				"properties": {
+					"id": {
+						"type": "integer",
+						"format": "int64",
+						"example": 1
+					},
+					"name": {
+						"type": "string",
+						"example": "Dogs"
+					}
+				},
+				"xml": {
+					"name": "category"
+				}
+			},
+			"User": {
+				"type": "object",
+				"properties": {
+					"id": {
+						"type": "integer",
+						"format": "int64",
+						"example": 10
+					},
+					"username": {
+						"type": "string",
+						"example": "theUser"
+					},
+					"firstName": {
+						"type": "string",
+						"example": "John"
+					},
+					"lastName": {
+						"type": "string",
+						"example": "James"
+					},
+					"email": {
+						"type": "string",
+						"example": "john@email.com"
+					},
+					"password": {
+						"type": "string",
+						"example": "12345"
+					},
+					"phone": {
+						"type": "string",
+						"example": "12345"
+					},
+					"userStatus": {
+						"type": "integer",
+						"description": "User Status",
+						"format": "int32",
+						"example": 1
+					}
+				},
+				"xml": {
+					"name": "user"
+				}
+			},
+			"Tag": {
+				"type": "object",
+				"properties": {
+					"id": {
+						"type": "integer",
+						"format": "int64"
+					},
+					"name": {
+						"type": "string"
+					}
+				},
+				"xml": {
+					"name": "tag"
+				}
+			},
+			"Pet": {
+				"required": [
+					"name",
+					"photoUrls"
+				],
+				"type": "object",
+				"properties": {
+					"id": {
+						"type": "integer",
+						"format": "int64",
+						"example": 10
+					},
+					"name": {
+						"type": "string",
+						"example": "doggie"
+					},
+					"category": {
+						"$ref": "#/components/schemas/Category"
+					},
+					"photoUrls": {
+						"type": "array",
+						"xml": {
+							"wrapped": true
+						},
+						"items": {
+							"type": "string",
+							"xml": {
+								"name": "photoUrl"
+							}
+						}
+					},
+					"tags": {
+						"type": "array",
+						"xml": {
+							"wrapped": true
+						},
+						"items": {
+							"$ref": "#/components/schemas/Tag"
+						}
+					},
+					"status": {
+						"type": "string",
+						"description": "pet status in the store",
+						"enum": [
+							"available",
+							"pending",
+							"sold"
+						]
+					}
+				},
+				"xml": {
+					"name": "pet"
+				}
+			},
+			"ApiResponse": {
+				"type": "object",
+				"properties": {
+					"code": {
+						"type": "integer",
+						"format": "int32"
+					},
+					"type": {
+						"type": "string"
+					},
+					"message": {
+						"type": "string"
+					}
+				},
+				"xml": {
+					"name": "##default"
+				}
+			}
+		},
+		"requestBodies": {
+			"Pet": {
+				"description": "Pet object that needs to be added to the store",
+				"content": {
+					"application/json": {
+						"schema": {
+							"$ref": "#/components/schemas/Pet"
+						}
+					},
+					"application/xml": {
+						"schema": {
+							"$ref": "#/components/schemas/Pet"
+						}
+					}
+				}
+			},
+			"UserArray": {
+				"description": "List of user object",
+				"content": {
+					"application/json": {
+						"schema": {
+							"type": "array",
+							"items": {
+								"$ref": "#/components/schemas/User"
+							}
+						}
+					}
+				}
+			}
+		},
+		"securitySchemes": {
+			"petstore_auth": {
+				"type": "oauth2",
+				"flows": {
+					"implicit": {
+						"authorizationUrl": "https://petstore3.swagger.io/oauth/authorize",
+						"scopes": {
+							"write:pets": "modify pets in your account",
+							"read:pets": "read your pets"
+						}
+					}
+				}
+			},
+			"api_key": {
+				"type": "apiKey",
+				"name": "api_key",
+				"in": "header"
+			}
+		}
+	}
+}
diff --git a/components/camel-rest-openapi/src/test/resources/petstore-3.1.yaml b/components/camel-rest-openapi/src/test/resources/petstore-3.1.yaml
new file mode 100644
index 00000000000..d51548958bb
--- /dev/null
+++ b/components/camel-rest-openapi/src/test/resources/petstore-3.1.yaml
@@ -0,0 +1,144 @@
+openapi: "3.1.0"
+info:
+  version: 1.0.0
+  title: Swagger Petstore
+  summary: Updated to show OpenAPI 3.1.0 features
+  license:
+    name: MIT
+    identifier: test
+servers:
+  - url: '{scheme}://{host}/{basePath}'
+    variables:
+      scheme:
+        enum:
+          - http
+          - https
+        default: https
+      host:
+        default: petstore.swagger.io
+      basePath:
+        default: /api/v3
+webhooks:
+  # Each webhook needs a name
+  newPet:
+    # This is a Path Item Object, the only difference is that the request is initiated by the API provider
+    post:
+      requestBody:
+        description: Information about a new pet in the system
+        content:
+          application/json:
+            schema:
+              $ref: "#/components/schemas/Pet"
+      responses:
+        "200":
+          description: Return a 200 status to indicate that the data was received successfully
+paths:
+  /pets:
+    get:
+      summary: List all pets
+      operationId: listPets
+      tags:
+        - pets
+      parameters:
+        - name: limit
+          in: query
+          description: How many items to return at one time (max 100)
+          required: false
+          schema:
+            type: integer
+            format: int32
+      responses:
+        "200":
+          description: An paged array of pets
+          headers:
+            x-next:
+              description: A link to the next page of responses
+              schema:
+                type: string
+          content:
+            application/json:
+              schema:
+                $ref: "#/components/schemas/Pets"
+        default:
+          description: unexpected error
+          content:
+            application/json:
+              schema:
+                $ref: "#/components/schemas/Error"
+    post:
+      summary: Create a pet
+      operationId: createPets
+      tags:
+        - pets
+      responses:
+        "201":
+          description: Null response
+        default:
+          description: unexpected error
+          content:
+            application/json:
+              schema:
+                $ref: "#/components/schemas/Error"
+  /pet/{petId}:
+      $ref: "#/components/pathItems/getPet"
+components:
+  schemas:
+    Pet:
+      required:
+        - id
+        - name
+      properties:
+        id:
+          type: integer
+          format: int64
+        name:
+          type:
+          - string
+          - integer
+        tag:
+          type: string
+    Pets:
+      type: array
+      items:
+        $ref: "#/components/schemas/Pet"
+    Error:
+      required:
+        - code
+        - message
+      properties:
+        code:
+          type: integer
+          format: int32
+        message:
+          type: string
+  pathItems:
+    getPet:
+     get:
+      summary: Info for a specific pet
+      operationId: getPetById
+      tags:
+        - pets
+      parameters:
+        - name: petId
+          in: path
+          required: true
+          description: The id of the pet to retrieve
+          schema:
+            type: string
+      responses:
+        "200":
+          description: Expected response to a valid request
+          content:
+            application/json:
+              schema:
+                $ref: "#/components/schemas/Pet"
+            application/xml:
+              schema:
+                $ref: "#/components/schemas/Pet"
+        default:
+          description: unexpected error
+          content:
+            application/json:
+              schema:
+                $ref: "#/components/schemas/Error"
+    
diff --git a/parent/pom.xml b/parent/pom.xml
index 03136381a53..a584baae7db 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -465,9 +465,10 @@
         <squareup-okio-version>1.17.2</squareup-okio-version>
         <sshd-version>2.9.2</sshd-version>
         <stompjms-version>1.19</stompjms-version>
-        <swagger-java-version>1.6.4</swagger-java-version>
-        <swagger-openapi3-version>2.2.8</swagger-openapi3-version>
-        <swagger-java-parser-version>1.0.62</swagger-java-parser-version>
+        <swagger-java-version>1.6.10</swagger-java-version>
+        <swagger-openapi3-version>2.2.9</swagger-openapi3-version>
+        <swagger-java-parser-version>1.0.65</swagger-java-parser-version>
+        <swagger-openapi3-java-parser-version>2.1.13</swagger-openapi3-java-parser-version>
         <stax-api-version>1.0.1</stax-api-version>
         <stringtemplate-version>4.3.4</stringtemplate-version>
         <templating-maven-plugin-version>1.0.0</templating-maven-plugin-version>