Skip to content

Commit 1a17a2d

Browse files
authored
Adding github spec to IT in order to verify it compiles (#468)
1 parent 586f7cc commit 1a17a2d

File tree

8 files changed

+293906
-5
lines changed

8 files changed

+293906
-5
lines changed

deployment/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<name>Quarkus - Openapi Generator - Deployment</name>
1111

1212
<properties>
13-
<version.org.openapitools>6.4.0</version.org.openapitools>
13+
<version.org.openapitools>7.0.0</version.org.openapitools>
1414
<version.org.slf4j>2.0.9</version.org.slf4j>
1515
<version.com.github.jknack>4.3.1</version.com.github.jknack>
1616
<version.io.swagger.parser>2.1.16</version.io.swagger.parser>

deployment/src/main/resources/templates/libraries/microprofile/enumClass.qute

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{#if e.withXml}
88
{#for v in e.allowableValues.enumVars}@XmlEnumValue({#if v.isInteger || v.isDouble || v.isLong || v.isFloat}"{/if}{v.value}{#if v.isInteger || v.isDouble || v.isLong || v.isFloat}"{/if}) {v.name}({#if e.isEnum}{e.items.dataType}{#else}{e.dataType}{/if}.valueOf({v.value})){#if v_hasNext}, {#else}; {/if}{/for}
99
{#else}
10-
{#for v in e.allowableValues.enumVars}{v.name}({v.value}){#if v_hasNext}, {#else};{/if}{/for}
10+
{#for v in e.allowableValues.enumVars}{v.name}({#if e.isContainer}{e.items.dataType}{#else}{e.dataType}{/if}.valueOf({v.value})){#if v_hasNext}, {#else};{/if}{/for}
1111
{/if}
1212
{/if}
1313

deployment/src/main/resources/templates/libraries/microprofile/pojo.qute

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class {m.classname} {#if m.parent}extends {m.parent}{/if}{#if m.serializa
4949
**/
5050
{/if}
5151
{#if v.isContainer}
52-
private {v.datatypeWithEnum} {v.name}{#if v.required} = {v.defaultValue}{#else} = null{/if};
52+
private {v.datatypeWithEnum} {v.name}{#if v.required && v.defaultValue} = {v.defaultValue}{/if};
5353
{#else}
5454
private {v.datatypeWithEnum} {v.name}{#if v.defaultValue} = {v.defaultValue}{/if};
5555
{/if}

deployment/src/main/resources/templates/libraries/microprofile/pojoQueryParam.qute

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
@jakarta.ws.rs.QueryParam("{v.name}")
3939
{/if}
4040
{#if v.isContainer}
41-
private {v.datatypeWithEnum} {v.name}{#if v.required} = {v.defaultValue}{#else} = null{/if};
41+
private {v.datatypeWithEnum} {v.name}{#if v.required&&v.defaultValue} = {v.defaultValue}{#else} = null{/if};
4242
{#else}
4343
private {v.datatypeWithEnum} {v.name}{#if v.defaultValue} = {v.defaultValue}{/if};
4444
{/if}

deployment/src/test/java/io/quarkiverse/openapi/generator/deployment/wrapper/OpenApiClientGeneratorWrapperTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ private void verifyApiAdditionalAnnotations(File file) {
516516
@Test
517517
void verifyAPINormalization() throws Exception {
518518
final List<File> generatedFiles = this.createGeneratorWrapper("open-api-normalizer.json")
519-
.withOpenApiNormalizer(Map.of("REF_AS_PARENT_IN_ALLOF", "true"))
519+
.withOpenApiNormalizer(Map.of("REF_AS_PARENT_IN_ALLOF", "true", "REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", "true"))
520520
.generate("org.acme.openapi.animals");
521521

522522
assertNotNull(generatedFiles);

integration-tests/github/pom.xml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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">
3+
<parent>
4+
<artifactId>quarkus-openapi-generator-integration-tests</artifactId>
5+
<groupId>io.quarkiverse.openapi.generator</groupId>
6+
<version>3.0.0-SNAPSHOT</version>
7+
</parent>
8+
<modelVersion>4.0.0</modelVersion>
9+
10+
<artifactId>quarkus-openapi-generator-it-ghub</artifactId>
11+
<name>Quarkus - Openapi Generator - Integration Tests - GitHub spec</name>
12+
<description>Example project for general usage</description>
13+
14+
<dependencies>
15+
<dependency>
16+
<groupId>io.quarkiverse.openapi.generator</groupId>
17+
<artifactId>quarkus-openapi-generator</artifactId>
18+
</dependency>
19+
<dependency>
20+
<groupId>org.assertj</groupId>
21+
<artifactId>assertj-core</artifactId>
22+
<scope>test</scope>
23+
</dependency>
24+
<dependency>
25+
<groupId>io.quarkus</groupId>
26+
<artifactId>quarkus-junit5</artifactId>
27+
<scope>test</scope>
28+
</dependency>
29+
</dependencies>
30+
<build>
31+
<plugins>
32+
<plugin>
33+
<groupId>io.quarkus</groupId>
34+
<artifactId>quarkus-maven-plugin</artifactId>
35+
<extensions>true</extensions>
36+
<executions>
37+
<execution>
38+
<goals>
39+
<goal>build</goal>
40+
<goal>generate-code</goal>
41+
<goal>generate-code-tests</goal>
42+
</goals>
43+
</execution>
44+
</executions>
45+
</plugin>
46+
</plugins>
47+
</build>
48+
<profiles>
49+
<profile>
50+
<id>native-image</id>
51+
<activation>
52+
<property>
53+
<name>native</name>
54+
</property>
55+
</activation>
56+
<build>
57+
<plugins>
58+
<plugin>
59+
<artifactId>maven-surefire-plugin</artifactId>
60+
<configuration>
61+
<skipTests>${native.surefire.skip}</skipTests>
62+
</configuration>
63+
</plugin>
64+
<plugin>
65+
<artifactId>maven-failsafe-plugin</artifactId>
66+
<executions>
67+
<execution>
68+
<goals>
69+
<goal>integration-test</goal>
70+
<goal>verify</goal>
71+
</goals>
72+
<configuration>
73+
<systemPropertyVariables>
74+
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
75+
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
76+
<maven.home>${maven.home}</maven.home>
77+
</systemPropertyVariables>
78+
</configuration>
79+
</execution>
80+
</executions>
81+
</plugin>
82+
</plugins>
83+
</build>
84+
<properties>
85+
<quarkus.package.type>native</quarkus.package.type>
86+
</properties>
87+
</profile>
88+
</profiles>
89+
90+
</project>

0 commit comments

Comments
 (0)