Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class QuteTemplatingEngineAdapter extends AbstractTemplatingEngineAdapter

private static final String IDENTIFIER = "qute";
private static final String[] DEFAULT_TEMPLATES = {
"suppressWarnings.qute",
"additionalEnumTypeAnnotations.qute",
"additionalEnumTypeUnexpectedMember.qute",
"additionalModelTypeAnnotations.qute",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {imp.import};
{#for apiAnnotation in additionalApiTypeAnnotations.orEmpty}
{apiAnnotation}
{/for}
{#include suppressWarnings.qute/}
public interface {classname} {

{#for op in operations.operation}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package {apiPackage}.auth;
@io.quarkiverse.openapi.generator.markers.ApiKeyAuthenticationMarker(name="{auth.name}", openApiSpecId="{quarkus-generator.openApiSpecId}", apiKeyIn=io.quarkiverse.openapi.generator.providers.ApiKeyIn.cookie, apiKeyName="{auth.keyParamName}")
{/if}
{/for}
{#include suppressWarnings.qute/}
public class CompositeAuthenticationProvider implements jakarta.ws.rs.client.ClientRequestFilter {

@jakarta.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package {apiPackage}.auth;

{#include suppressWarnings.qute/}
public class AuthenticationPropagationHeadersFactory extends io.quarkiverse.openapi.generator.providers.AbstractAuthenticationPropagationHeadersFactory {

@jakarta.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{#include suppressWarnings.qute/}
public static class {op.operationIdCamelCase}MultipartForm {
{#for p in op.formParams}
@jakarta.ws.rs.FormParam("{p.baseName}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
{#else}
@com.fasterxml.jackson.annotation.JsonIgnoreProperties(ignoreUnknown = true)
{/if}
{#include suppressWarnings.qute/}
public class {m.classname} {#if m.parent}extends {m.parent}{/if}{#if serializableModel} implements java.io.Serializable{/if} {

{#for v in m.vars}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{/if}
@com.fasterxml.jackson.annotation.JsonIgnoreProperties(ignoreUnknown = true)
{#include additionalModelTypeAnnotations.qute m=m/}
{#include suppressWarnings.qute/}
public static class {m.classname}QueryParam {#if m.parent}extends {m.parent}{/if}{#if serializableModel} implements java.io.Serializable{/if} {

{#for v in m.vars}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" })
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I previously worked on the PR that added @JsonProperty to pojo setters but realized I made the file extension of a json file yaml instead. Kinda breaks one of the checkboxes for the PR ("Pull Request does not include fixes for issues other than the main ticket") so I can pop off this commit if you guys are strict about it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why this passed the integration tests then. I wonder if we are trying to parse to JSON first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually took a look at this last night because I was wondering the same thing. I had traced it down to here: https://github.com/swagger-api/swagger-parser/blob/ef2cf163dfdf19af5a5a8dc1ab6651dcfcd43924/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/DeserializationUtils.java#L245

Looks like it just tries the json parser if the yaml is invalid

Not 100% sure that's actually the reason it still worked since I didn't bother step through with the debugger to verify that this is where it is parsing it, but it's my best guess.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
quarkus.openapi-generator.codegen.spec.jsonproperty_openapi_yaml.base-package=org.acme.jsonproperty.gettersetter
quarkus.openapi-generator.codegen.spec.jsonproperty_openapi_json.base-package=org.acme.jsonproperty.gettersetter
1 change: 1 addition & 0 deletions client/integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<module>equals-hashcode</module>
<module>override-credential-provider</module>
<module>jsonproperty-getter-and-setter</module>
<module>suppress-warnings</module>
</modules>
<dependencyManagement>
<dependencies>
Expand Down
98 changes: 98 additions & 0 deletions client/integration-tests/suppress-warnings/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>quarkus-openapi-generator-integration-tests</artifactId>
<groupId>io.quarkiverse.openapi.generator</groupId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>quarkus-openapi-generator-it-suppress-warnings</artifactId>
<name>Quarkus - OpenAPI Generator - Integration Tests - Client - Suppress Warnings Test</name>
<description>Ensures that generated classes have the @SuppressWarnings annotation</description>

<dependencies>
<dependency>
<groupId>io.quarkiverse.openapi.generator</groupId>
<artifactId>quarkus-openapi-generator</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency><dependency>
<groupId>com.github.javaparser</groupId>
<artifactId>javaparser-symbol-solver-core</artifactId>
<version>3.27.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>native-image</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>${native.surefire.skip}</skipTests>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<native.image.path>
${project.build.directory}/${project.build.finalName}-runner
</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager
</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<quarkus.package.type>native</quarkus.package.type>
</properties>
</profile>
</profiles>

</project>
Loading