Quarkus: Quarkus is not handling annontation @JsonView properly

Created on 19 Feb 2020  路  6Comments  路  Source: quarkusio/quarkus

For @JsonView I have an app that defines the annotation.

@JsonView(TestJsonView.class)
private String annotatedValue;

@JsonView({TestJsonView.class, TestJsonView2.class})
private String annotatedValue2;

The endpoint sets the values and returns this object

public static Something SOMETHING =
new Something("annotated value", "annotated value 2", "not annotated value");

@GET
@Produces("application/json")
@JsonView(TestJsonView2.class)
@Path("/something_w_view2")
public Something getSomethingWithView2()
{
return SOMETHING;

}

The return value should be
annotatedValue = null
annotatedValue = annotated value 2
notAnnotatedValue = not annotated value
but is
annotatedValue = annotated value
annotatedValue = annotated value 2
notAnnotatedValue = not annotated value

Execution env.
jdk 11.0.2
mvn 3.6.0
quarkus 999-SNAPSHOT

The following project demonstrates the issue
https://github.com/rsearls/quarkus-JsonView-annotation.git

Follow the directions in the README file to setup and run the test

kinenhancement

Most helpful comment

Hello, I would like to know if there is any roadmap regarding a fix to this issue or if there is any viable workaround

All 6 comments

You need to include the extension quarkus-resteasy-jackson in your pom.xml.

I added quarkus-resteasy-jackson to the provided sample project and got the same error.

Hello, I would like to know if there is any roadmap regarding a fix to this issue or if there is any viable workaround

Is this still the case?

Yes it still fails. I have updated the test case to quarkus version 1.9.0.Final

Thanks for checking

Was this page helpful?
0 / 5 - 0 ratings

Related issues

emmanuelbernard picture emmanuelbernard  路  50Comments

gsmet picture gsmet  路  47Comments

galderz picture galderz  路  80Comments

maxandersen picture maxandersen  路  55Comments

mariofusco picture mariofusco  路  115Comments