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 10, 2023
1 parent cbe4f2b commit 8353724
Show file tree
Hide file tree
Showing 258 changed files with 31 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ public interface DefaultApi { /* omitted */ }

## Additional Properties as Attribute

If you want to map your models using composition instead inheretance for a better experience with Jackson, see the [Additional properties as attribute](./docs/modules/ROOT/pages/additional-properties-as-attribute.adoc) documentation.
If you want to map your models using composition instead inheretance for a better experience with Jackson, see the [Additional properties as attribute](client/docs/modules/ROOT/pages/additional-properties-as-attribute.adoc) documentation.

## Template Customization

Expand Down
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>
</modules>
<scm>
Expand Down Expand Up @@ -126,7 +126,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 8353724

Please sign in to comment.