forked from quarkusio/quarkus
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Register enclosing class for reflection when used as JAX-RS return type
This is needed when a JAX-RS resource returns a parameterized type that is meant to be an enclosing class Fixes: quarkusio#3538
- Loading branch information
Showing
5 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
integration-tests/main/src/main/java/io/quarkus/it/rest/EnvelopeClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.quarkus.it.rest; | ||
|
||
public class EnvelopeClass<T> { | ||
|
||
private T content; | ||
|
||
public EnvelopeClass(T content) { | ||
this.content = content; | ||
} | ||
|
||
public T getContent() { | ||
return content; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
integration-tests/main/src/main/java/io/quarkus/it/rest/EnvelopeClassResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.quarkus.it.rest; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
|
||
@Path("/envelope") | ||
public class EnvelopeClassResource { | ||
|
||
@Path("/payload") | ||
@GET | ||
@Produces("application/json") | ||
public EnvelopeClass<PayloadClass> payloadClass() { | ||
return new EnvelopeClass<>(new PayloadClass("hello")); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
integration-tests/main/src/main/java/io/quarkus/it/rest/PayloadClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.quarkus.it.rest; | ||
|
||
public class PayloadClass { | ||
|
||
private final String message; | ||
|
||
public PayloadClass(String message) { | ||
this.message = message; | ||
} | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters