Skip to content

"get" appearing in property names with 2.6.x #224

Open
@wuservices

Description

@wuservices

Filed from discussion with @christophercurrie in #217.

Here's a possible pattern (not 100% sure). I think using @JsonProperty without a value is causing this. I've confirmed that the issue goes away when I don't register the Scala module.

I'm building JSON for a class named Product. @JsonAutoDetect is set up on Surface so nothing is autodetected so I have to whitelist properties with @JsonProperty.

@JsonAutoDetect(creatorVisibility = JsonAutoDetect.Visibility.NONE,
  fieldVisibility = JsonAutoDetect.Visibility.NONE,
  getterVisibility = JsonAutoDetect.Visibility.NONE,
  isGetterVisibility = JsonAutoDetect.Visibility.NONE,
  setterVisibility = JsonAutoDetect.Visibility.NONE)
public interface Surface { ... }

public abstract class AbstractSurface implements Surface { ... }

public class Product extends AbstractSurface implements Comparable<Product> { ... }

Some of my properties come from AbstractSurface and other come from Product, but I think that the ones that have the unexpected get prefix have @JsonProperty without a value.

Sorry, no test case right now but hopefully that points you in the right direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions