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 58de5691d90 CAMEL-21020: remove obsolete swagger integration tests (#14944) 58de5691d90 is described below commit 58de5691d90136f95c225b1a89404e211f677849 Author: klease <38634989+kle...@users.noreply.github.com> AuthorDate: Sat Jul 27 10:23:37 2024 +0200 CAMEL-21020: remove obsolete swagger integration tests (#14944) Modify message if spec cannot be read to suggest checking openapi version. Fix compile error in customized-v3 integration test. Check for generated dto classes in specified model packages. --- .../java/com/example/MyDestinationGenerator.java | 4 +- .../src/it/customized/pom.xml | 87 -------------- .../java/com/example/MyDestinationGenerator.java | 30 ----- .../it/customized/src/main/resources/petstore.json | 1 - .../src/it/customized/verify.groovy | 24 ---- .../src/it/simple-dto/pom.xml | 94 ---------------- .../src/it/simple-dto/src/spec/openapi.json | 1 - .../src/it/simple-dto/verify.groovy | 28 ----- .../src/it/simple-xml-dto-v3/pom.xml | 1 + .../src/it/simple-xml-dto-v3/verify.groovy | 2 +- .../src/it/simple-xml-dto/pom.xml | 125 --------------------- .../src/it/simple-xml-dto/src/spec/openapi.json | 1 - .../src/it/simple-xml-dto/verify.groovy | 28 ----- .../src/it/simple-xml/pom.xml | 89 --------------- .../src/it/simple-xml/src/spec/openapi.json | 1 - .../src/it/simple-xml/verify.groovy | 20 ---- .../src/it/simple-yaml-dto-v3/pom.xml | 1 + .../src/it/simple-yaml-dto-v3/verify.groovy | 2 +- .../src/it/simple/pom.xml | 67 ----------- .../src/it/simple/src/spec/openapi.json | 1 - .../src/it/simple/verify.groovy | 20 ---- .../maven/generator/openapi/GenerateMojo.java | 2 +- 22 files changed, 7 insertions(+), 622 deletions(-) diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/customized-v3/src/main/java/com/example/MyDestinationGenerator.java b/tooling/maven/camel-restdsl-openapi-plugin/src/it/customized-v3/src/main/java/com/example/MyDestinationGenerator.java index 24905f92f3b..2c1244f509a 100644 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/customized-v3/src/main/java/com/example/MyDestinationGenerator.java +++ b/tooling/maven/camel-restdsl-openapi-plugin/src/it/customized-v3/src/main/java/com/example/MyDestinationGenerator.java @@ -17,14 +17,14 @@ package com.example; -import io.apicurio.datamodels.models.openapi.OpenApiOperation; +import io.swagger.v3.oas.models.Operation; import org.apache.camel.generator.openapi.DestinationGenerator; public class MyDestinationGenerator implements DestinationGenerator { @Override - public String generateDestinationFor(final OpenApiOperation operation) { + public String generateDestinationFor(final Operation operation) { return "rest-" + operation.getOperationId(); } diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/customized/pom.xml b/tooling/maven/camel-restdsl-openapi-plugin/src/it/customized/pom.xml deleted file mode 100644 index cc0a653c0de..00000000000 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/customized/pom.xml +++ /dev/null @@ -1,87 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<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/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.camel.maven.generator.openapi.it</groupId> - <artifactId>customized</artifactId> - <version>1-SNAPSHOT</version> - - <description>A simple IT verifying the basic use case.</description> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <maven.compiler.release>17</maven.compiler.release> - <maven.compiler.source>17</maven.compiler.source> - <maven.compiler.target>17</maven.compiler.target> - </properties> - - <build> - <plugins> - <plugin> - <groupId>@project.groupId@</groupId> - <artifactId>@project.artifactId@</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>customized</id> - <goals> - <goal>generate</goal> - </goals> - <phase>process-classes</phase> - <configuration> - <specificationUri>${project.basedir}/src/main/resources/petstore.json</specificationUri> - <outputDirectory>${project.build.outputDirectory}/generated</outputDirectory> - <packageName>com.example</packageName> - <className>MyRestRoute</className> - <indent>\t</indent> - <destinationGenerator>com.example.MyDestinationGenerator</destinationGenerator> - <apiContextPath>/api-docs</apiContextPath> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-openapi-rest-dsl-generator</artifactId> - <version>@project.version@</version> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-core</artifactId> - <version>@project.version@</version> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-openapi-java</artifactId> - <version>@project.version@</version> - </dependency> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>2.8.9</version> - </dependency> - </dependencies> -</project> diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/customized/src/main/java/com/example/MyDestinationGenerator.java b/tooling/maven/camel-restdsl-openapi-plugin/src/it/customized/src/main/java/com/example/MyDestinationGenerator.java deleted file mode 100644 index dd03e1b598a..00000000000 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/customized/src/main/java/com/example/MyDestinationGenerator.java +++ /dev/null @@ -1,30 +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 com.example; - -import io.apicurio.datamodels.models.openapi.OpenApiOperation; -import org.apache.camel.generator.openapi.DestinationGenerator; - - -public class MyDestinationGenerator implements DestinationGenerator { - - @Override - public String generateDestinationFor(final OpenApiOperation operation) { - return "rest-" + operation.getOperationId(); - } - -} diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/customized/src/main/resources/petstore.json b/tooling/maven/camel-restdsl-openapi-plugin/src/it/customized/src/main/resources/petstore.json deleted file mode 100644 index 816847f31bb..00000000000 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/customized/src/main/resources/petstore.json +++ /dev/null @@ -1 +0,0 @@ -{"swagger":"2.0","info":{"description":"This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.","version":"1.0.0","title":"Swagger Petstore","termsOfService":"http://swagger.io/terms/","contact":{"email":"apit...@swagger.io"},"license":{"name":"Apache 2.0","url":"http://www.a [...] \ No newline at end of file diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/customized/verify.groovy b/tooling/maven/camel-restdsl-openapi-plugin/src/it/customized/verify.groovy deleted file mode 100644 index 5cbf9f47f00..00000000000 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/customized/verify.groovy +++ /dev/null @@ -1,24 +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. - */ - -def File restdsl = new File(basedir, "target/classes/generated/com/example/MyRestRoute.java") - -assert restdsl.exists() - -def String data = restdsl.text - -assert data.contains('restConfiguration().component("platform-http").apiContextPath("/api-docs");') diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-dto/pom.xml b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-dto/pom.xml deleted file mode 100644 index c12b013a304..00000000000 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-dto/pom.xml +++ /dev/null @@ -1,94 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<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/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.camel.maven.generator.openapi.it</groupId> - <artifactId>simple-dto</artifactId> - <version>1-SNAPSHOT</version> - - <description>A simple IT verifying the basic use case.</description> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <maven.compiler.release>17</maven.compiler.release> - <maven.compiler.source>17</maven.compiler.source> - <maven.compiler.target>17</maven.compiler.target> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-core</artifactId> - <version>@project.version@</version> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-openapi-java</artifactId> - <version>@project.version@</version> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-platform-http</artifactId> - <version>@project.version@</version> - </dependency> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>2.10.1</version> - </dependency> - <dependency> - <groupId>jakarta.annotation</groupId> - <artifactId>jakarta.annotation-api</artifactId> - <version>@jakarta-annotation-api-version@</version> - </dependency> - <dependency> - <groupId>io.swagger.core.v3</groupId> - <artifactId>swagger-annotations</artifactId> - <version>2.2.15</version> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>@project.groupId@</groupId> - <artifactId>@project.artifactId@</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>simple-dto</id> - <goals> - <goal>generate-with-dto</goal> - </goals> - <configuration> - <modelPackage>com.foo</modelPackage> - <modelWithXml>false</modelWithXml> - <configOptions> - <dateLibrary>java11</dateLibrary> - </configOptions> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-dto/src/spec/openapi.json b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-dto/src/spec/openapi.json deleted file mode 100644 index 816847f31bb..00000000000 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-dto/src/spec/openapi.json +++ /dev/null @@ -1 +0,0 @@ -{"swagger":"2.0","info":{"description":"This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.","version":"1.0.0","title":"Swagger Petstore","termsOfService":"http://swagger.io/terms/","contact":{"email":"apit...@swagger.io"},"license":{"name":"Apache 2.0","url":"http://www.a [...] \ No newline at end of file diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-dto/verify.groovy b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-dto/verify.groovy deleted file mode 100644 index a276a940f3e..00000000000 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-dto/verify.groovy +++ /dev/null @@ -1,28 +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. - */ - -def File restdsl = new File(basedir, "target/generated-sources/restdsl-openapi/io/swagger/petstore/SwaggerPetstore.java") - -assert restdsl.exists() - -def String data = restdsl.text - -assert data.contains('restConfiguration().component("platform-http");') - -def File restdto = new File(basedir, "target/generated-sources/openapi/src/main/java/com/foo/Order.java") - -assert restdto.exists() diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml-dto-v3/pom.xml b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml-dto-v3/pom.xml index dacbce775c1..9e98a3d9a45 100644 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml-dto-v3/pom.xml +++ b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml-dto-v3/pom.xml @@ -81,6 +81,7 @@ </goals> <configuration> <blueprint>true</blueprint> + <modelPackage>org.openapi.model</modelPackage> <filterOperation>find*,deletePet,updatePet</filterOperation> <configOptions> <dateLibrary>java8</dateLibrary> diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml-dto-v3/verify.groovy b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml-dto-v3/verify.groovy index 5af179f1b5d..e0727a622ff 100644 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml-dto-v3/verify.groovy +++ b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml-dto-v3/verify.groovy @@ -23,6 +23,6 @@ def String data = restdsl.text assert data.contains('<restConfiguration component="jetty"/>') -def File restdto = new File(basedir, "target/generated-sources/openapi/src/main/java/io/swagger/client/model/Order.java") +def File restdto = new File(basedir, "target/generated-sources/openapi/src/main/java/org/openapi/model/Order.java") assert restdto.exists() diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml-dto/pom.xml b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml-dto/pom.xml deleted file mode 100644 index 2b3694c04b0..00000000000 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml-dto/pom.xml +++ /dev/null @@ -1,125 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<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/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.camel.maven.generator.openapi.it</groupId> - <artifactId>simple-xml-dto</artifactId> - <version>1-SNAPSHOT</version> - - <description>A simple IT verifying the basic use case.</description> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <maven.compiler.release>17</maven.compiler.release> - <maven.compiler.source>17</maven.compiler.source> - <maven.compiler.target>17</maven.compiler.target> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-core</artifactId> - <version>@project.version@</version> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-openapi-java</artifactId> - <version>@project.version@</version> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-jetty</artifactId> - <version>@project.version@</version> - </dependency> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>2.8.9</version> - </dependency> - <dependency> - <groupId>jakarta.annotation</groupId> - <artifactId>jakarta.annotation-api</artifactId> - <version>@jakarta-annotation-api-version@</version> - </dependency> - <dependency> - <groupId>io.swagger.core.v3</groupId> - <artifactId>swagger-annotations</artifactId> - <version>2.1.9</version> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>@project.groupId@</groupId> - <artifactId>@project.artifactId@</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>simple-xml-dto</id> - <goals> - <goal>generate-xml-with-dto</goal> - </goals> - <configuration> - <blueprint>true</blueprint> - <filterOperation>find*,deletePet,updatePet</filterOperation> - <configOptions> - <dateLibrary>java8</dateLibrary> - </configOptions> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - <profiles> - <profile> - <id>jdk9s-build</id> - <activation> - <jdk>[9,)</jdk> - </activation> - <build> - <pluginManagement> - <plugins> - <plugin> - <groupId>@project.groupId@</groupId> - <artifactId>@project.artifactId@</artifactId> - <version>@project.version@</version> - <dependencies> - <dependency> - <groupId>jakarta.xml.bind</groupId> - <artifactId>jakarta.xml.bind-api</artifactId> - <version>@jakarta-xml-bind-api-version@</version> - </dependency> - <dependency> - <groupId>org.glassfish.jaxb</groupId> - <artifactId>jaxb-runtime</artifactId> - <version>@glassfish-jaxb-runtime-version@</version> - </dependency> - </dependencies> - </plugin> - </plugins> - </pluginManagement> - </build> - </profile> - </profiles> -</project> diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml-dto/src/spec/openapi.json b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml-dto/src/spec/openapi.json deleted file mode 100644 index 816847f31bb..00000000000 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml-dto/src/spec/openapi.json +++ /dev/null @@ -1 +0,0 @@ -{"swagger":"2.0","info":{"description":"This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.","version":"1.0.0","title":"Swagger Petstore","termsOfService":"http://swagger.io/terms/","contact":{"email":"apit...@swagger.io"},"license":{"name":"Apache 2.0","url":"http://www.a [...] \ No newline at end of file diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml-dto/verify.groovy b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml-dto/verify.groovy deleted file mode 100644 index 5af179f1b5d..00000000000 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml-dto/verify.groovy +++ /dev/null @@ -1,28 +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. - */ - -def File restdsl = new File(basedir, "target/generated-sources/restdsl-openapi/camel-rest.xml") - -assert restdsl.exists() - -def String data = restdsl.text - -assert data.contains('<restConfiguration component="jetty"/>') - -def File restdto = new File(basedir, "target/generated-sources/openapi/src/main/java/io/swagger/client/model/Order.java") - -assert restdto.exists() diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml/pom.xml b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml/pom.xml deleted file mode 100644 index 3dd887f7b6c..00000000000 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml/pom.xml +++ /dev/null @@ -1,89 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<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/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.camel.maven.generator.openapi.it</groupId> - <artifactId>simple-xml</artifactId> - <version>1-SNAPSHOT</version> - - <description>A simple IT verifying the basic use case.</description> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <maven.compiler.release>17</maven.compiler.release> - <maven.compiler.source>17</maven.compiler.source> - <maven.compiler.target>17</maven.compiler.target> - </properties> - - <build> - <plugins> - <plugin> - <groupId>@project.groupId@</groupId> - <artifactId>@project.artifactId@</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>simple-xml</id> - <goals> - <goal>generate-xml</goal> - </goals> - <configuration> - <blueprint>true</blueprint> - <filterOperation>find*,deletePet,updatePet</filterOperation> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - <profiles> - <profile> - <id>jdk9s-build</id> - <activation> - <jdk>[9,)</jdk> - </activation> - <build> - <pluginManagement> - <plugins> - <plugin> - <groupId>@project.groupId@</groupId> - <artifactId>@project.artifactId@</artifactId> - <version>@project.version@</version> - <dependencies> - <dependency> - <groupId>jakarta.xml.bind</groupId> - <artifactId>jakarta.xml.bind-api</artifactId> - <version>@jakarta-xml-bind-api-version@</version> - </dependency> - <dependency> - <groupId>org.glassfish.jaxb</groupId> - <artifactId>jaxb-runtime</artifactId> - <version>@glassfish-jaxb-runtime-version@</version> - </dependency> - </dependencies> - </plugin> - </plugins> - </pluginManagement> - </build> - </profile> - </profiles> -</project> diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml/src/spec/openapi.json b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml/src/spec/openapi.json deleted file mode 100644 index 816847f31bb..00000000000 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml/src/spec/openapi.json +++ /dev/null @@ -1 +0,0 @@ -{"swagger":"2.0","info":{"description":"This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.","version":"1.0.0","title":"Swagger Petstore","termsOfService":"http://swagger.io/terms/","contact":{"email":"apit...@swagger.io"},"license":{"name":"Apache 2.0","url":"http://www.a [...] \ No newline at end of file diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml/verify.groovy b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml/verify.groovy deleted file mode 100644 index 92b7f832dfb..00000000000 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-xml/verify.groovy +++ /dev/null @@ -1,20 +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. - */ - -def File restdsl = new File(basedir, "target/generated-sources/restdsl-openapi/camel-rest.xml") - -assert restdsl.exists() diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-yaml-dto-v3/pom.xml b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-yaml-dto-v3/pom.xml index a302111979e..559095996da 100644 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-yaml-dto-v3/pom.xml +++ b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-yaml-dto-v3/pom.xml @@ -81,6 +81,7 @@ </goals> <configuration> <blueprint>true</blueprint> + <modelPackage>org.openapi.model</modelPackage> <filterOperation>find*,deletePet,updatePet</filterOperation> <configOptions> <dateLibrary>java11</dateLibrary> diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-yaml-dto-v3/verify.groovy b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-yaml-dto-v3/verify.groovy index 9b483612e1d..507f90f3b72 100644 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-yaml-dto-v3/verify.groovy +++ b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple-yaml-dto-v3/verify.groovy @@ -24,6 +24,6 @@ def String data = restdsl.text assert data.contains('restConfiguration:') assert data.contains('component: "jetty"') -def File restdto = new File(basedir, "target/generated-sources/openapi/src/main/java/io/swagger/client/model/Order.java") +def File restdto = new File(basedir, "target/generated-sources/openapi/src/main/java/org/openapi/model/Order.java") assert restdto.exists() diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple/pom.xml b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple/pom.xml deleted file mode 100644 index a512ec6f5b3..00000000000 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<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/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.camel.maven.generator.openapi.it</groupId> - <artifactId>simple</artifactId> - <version>1-SNAPSHOT</version> - - <description>A simple IT verifying the basic use case.</description> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <maven.compiler.release>17</maven.compiler.release> - <maven.compiler.source>17</maven.compiler.source> - <maven.compiler.target>17</maven.compiler.target> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-core</artifactId> - <version>@project.version@</version> - </dependency> - <dependency> - <groupId>jakarta.annotation</groupId> - <artifactId>jakarta.annotation-api</artifactId> - <version>@jakarta-annotation-api-version@</version> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>@project.groupId@</groupId> - <artifactId>@project.artifactId@</artifactId> - <version>@project.version@</version> - <executions> - <execution> - <id>simple</id> - <goals> - <goal>generate</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple/src/spec/openapi.json b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple/src/spec/openapi.json deleted file mode 100644 index 816847f31bb..00000000000 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple/src/spec/openapi.json +++ /dev/null @@ -1 +0,0 @@ -{"swagger":"2.0","info":{"description":"This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.","version":"1.0.0","title":"Swagger Petstore","termsOfService":"http://swagger.io/terms/","contact":{"email":"apit...@swagger.io"},"license":{"name":"Apache 2.0","url":"http://www.a [...] \ No newline at end of file diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple/verify.groovy b/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple/verify.groovy deleted file mode 100644 index 40818cc8a37..00000000000 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/it/simple/verify.groovy +++ /dev/null @@ -1,20 +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. - */ - -def File restdsl = new File(basedir, "target/generated-sources/restdsl-openapi/io/swagger/petstore/SwaggerPetstore.java") - -assert restdsl.exists() diff --git a/tooling/maven/camel-restdsl-openapi-plugin/src/main/java/org/apache/camel/maven/generator/openapi/GenerateMojo.java b/tooling/maven/camel-restdsl-openapi-plugin/src/main/java/org/apache/camel/maven/generator/openapi/GenerateMojo.java index 8ff2560ef54..78a7e5698d4 100644 --- a/tooling/maven/camel-restdsl-openapi-plugin/src/main/java/org/apache/camel/maven/generator/openapi/GenerateMojo.java +++ b/tooling/maven/camel-restdsl-openapi-plugin/src/main/java/org/apache/camel/maven/generator/openapi/GenerateMojo.java @@ -64,7 +64,7 @@ public class GenerateMojo extends AbstractGenerateMojo { throw new MojoExecutionException( "Unable to generate REST DSL OpenApi sources from specification: " + specificationUri - + ", make sure that the specification is available at the given URI"); + + ". Check that the specification is available at the given URI and that it has version OpenAPI 3.0.x or 3.1.x."); } final RestDslSourceCodeGenerator<Path> generator = RestDslGenerator.toPath(openapi);