Skip to content

@Patch Method doesn't work as expected when using Jackson + @Consumes(MediaType.APPLICATION_JSON_PATCH_JSON) or @Consumes("application/merge-patch+json") #33186

Open
@onkarsghotra

Description

Describe the bug

As per the below documentation, I should be able to patch a resource using @consumes(MediaType.APPLICATION_JSON_PATCH_JSON) or @consumes("application/merge-patch+json") and a @get method. This doesn't work when using quarkus-resteasy-jackson, only works with quarkus-reast-jsonb

https://docs.jboss.org/resteasy/docs/4.7.0.Final/userguide/html/JAX-RS_2.1_additions.html

This is not working since Quarkus 2.1.0.

Expected behavior

should receive a patched resource as a parameter to method annotated with @patch

Actual behavior

doesn't receive a patched resource as a parameter to method annotated with @patch

How to Reproduce?

    @GET
    @Path("/user/{id}")
    public UserProfile getUser(@PathParam("id") Integer id) {
        var user = new UserProfile();
        user.setName("name");
        return user;
    }

    @PATCH
    @Path("/user/{id}")
    @Consumes("application/merge-patch+json")
    public UserProfile patcherUser(@PathParam("id") Integer id, UserProfile user) {
            return user;
    }

Output of uname -a or ver

Darwin MacBook-Pro.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Mar 20 21:32:30 PDT 2023; root:xnu-8020.240.18.700.8~2/RELEASE_X86_64 x86_64

Output of java -version

openjdk version "20" 2023-03-21 OpenJDK Runtime Environment Homebrew (build 20) OpenJDK 64-Bit Server VM Homebrew (build 20, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.1.0 onwards

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

This doesn't work when using quarkus-resteasy-jackson extention.

Either I need to include quarkus-resteasy-jsonb or resteasy.patchfilter.legacy=true when using quarkus-resteasy-jackson extention

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions