Skip to content

Commit

Permalink
Create client directory
Browse files Browse the repository at this point in the history
  • Loading branch information
carlesarnal committed Oct 31, 2023
1 parent a6f669b commit e8e13eb
Show file tree
Hide file tree
Showing 269 changed files with 30 additions and 18 deletions.
1 change: 1 addition & 0 deletions deployment/pom.xml → client/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<groupId>io.quarkiverse.openapi.generator</groupId>
<artifactId>quarkus-openapi-generator-parent</artifactId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>quarkus-openapi-generator-deployment</artifactId>
<name>Quarkus - Openapi Generator - Deployment</name>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
<groupId>io.quarkiverse.openapi.generator</groupId>
<artifactId>quarkus-openapi-generator-parent</artifactId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>quarkus-openapi-generator-integration-tests</artifactId>
<name>Quarkus - Openapi Generator - Integration Tests</name>
<packaging>pom</packaging>
<modules>
<module>additional-properties</module>
<module>array-enum</module>
<module>beanparam</module>
<module>change-directory</module>
Expand All @@ -32,7 +34,6 @@
<module>type-mapping</module>
<module>config-key</module>
<module>github</module>
<module>additional-properties</module>
</modules>
<dependencyManagement>
<dependencies>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions runtime/pom.xml → client/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<groupId>io.quarkiverse.openapi.generator</groupId>
<artifactId>quarkus-openapi-generator-parent</artifactId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>quarkus-openapi-generator</artifactId>
<name>Quarkus - Openapi Generator - Runtime</name>
Expand Down
1 change: 1 addition & 0 deletions test-utils/pom.xml → client/test-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<artifactId>quarkus-openapi-generator-parent</artifactId>
<groupId>io.quarkiverse.openapi.generator</groupId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>quarkus-openapi-generator-test-utils</artifactId>
<name>Quarkus - Openapi Generator - Test Utils</name>
Expand Down
9 changes: 5 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<packaging>pom</packaging>
<name>Quarkus - Openapi Generator - Parent</name>
<modules>
<module>deployment</module>
<module>runtime</module>
<module>test-utils</module>
<module>client/deployment</module>
<module>client/runtime</module>
<module>client/test-utils</module>
<module>server</module>
<module>docs</module>
</modules>
Expand Down Expand Up @@ -127,7 +127,8 @@
</property>
</activation>
<modules>
<module>integration-tests</module>
<module>client/integration-tests</module>
<module>server/integration-tests</module>
</modules>
</profile>
</profiles>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
package io.quarkiverse.openapi.server.generator.deployment.codegen;

import static io.quarkiverse.openapi.server.generator.deployment.CodegenConfig.getBasePackagePropertyName;
import io.apicurio.hub.api.codegen.JaxRsProjectSettings;
import io.apicurio.hub.api.codegen.OpenApi2JaxRs;
import io.quarkus.bootstrap.prebuild.CodeGenException;
import org.apache.commons.io.IOUtils;
import org.eclipse.microprofile.config.Config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Path;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

import org.apache.commons.io.IOUtils;
import org.eclipse.microprofile.config.Config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.apicurio.hub.api.codegen.JaxRsProjectSettings;
import io.apicurio.hub.api.codegen.OpenApi2JaxRs;
import io.quarkus.bootstrap.prebuild.CodeGenException;
import static io.quarkiverse.openapi.server.generator.deployment.CodegenConfig.getBasePackagePropertyName;

public class ApicurioCodegenWrapper {

Expand Down Expand Up @@ -53,16 +57,20 @@ public void generate(Path openApiResource) throws CodeGenException {

// Generate code - output a ZIP file.
File zipFile = new File(outdir, "generated-code.zip");
try (FileOutputStream fos = new FileOutputStream(zipFile)) {

try (FileOutputStream fos = new FileOutputStream(zipFile);
FileInputStream openApiStream = new FileInputStream(openApiFile)) {
OpenApi2JaxRs generator = new OpenApi2JaxRs();
generator.setSettings(projectSettings);
generator.setUpdateOnly(true);
generator.setOpenApiDocument(new FileInputStream(openApiFile));
generator.setOpenApiDocument(openApiStream);
log.info("Generating code...");
generator.generate(fos);
} catch (Exception e) {
log.error("Error generating code from openapi spec", e);
throw new CodeGenException(e);
} finally {

}

// Unpack the temporary ZIP file
Expand Down
1 change: 0 additions & 1 deletion server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@
<modules>
<module>deployment</module>
<module>runtime</module>
<module>integration-tests</module>
</modules>
</project>

0 comments on commit e8e13eb

Please sign in to comment.