Skip to content

@JsonIgnoreProperties not working with @JsonValue #3647

@ThatSneakyRaccoon

Description

@ThatSneakyRaccoon

When serializing the class Bar using the default ObjectMapper

class Foo {
     
     String p1 = "hello";
     String p2 = "world";
     
}
class Bar {

     @JsonValue
     @JsonIgnoreProperties( "p1" )
     Foo foo = new Foo();
    
}

The output is

{
  "p1" : "hello",
  "p2" : "world"
}

I would expect it to be

{
  "p2" : "world"
}

Tested on version 2.13.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    has-failing-testIndicates that there exists a test case (under `failing/`) to reproduce the issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions