Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PropertyNamingStrategyWrapper support for PropertyNamingStrategys that extend NamingBase #81

Closed
bobtiernay-okta opened this issue Jun 4, 2021 · 2 comments · Fixed by #88

Comments

@bobtiernay-okta
Copy link

bobtiernay-okta commented Jun 4, 2021

Currently this uses reflection that doesn't work well with later versions of Jackson (e.g. 2.12.3) which added new implementations:

  public PropertyNamingStrategyWrapper(PropertyNamingStrategy delegate) {
    // Doesn't support `NamingBase` decendants!
    if (delegate instanceof PropertyNamingStrategyBase) {
      this.delegate = (PropertyNamingStrategyBase) delegate;
    } else if (delegate == PropertyNamingStrategy.LOWER_CAMEL_CASE) {
      this.delegate = NO_OP;
    } else {
      this.delegate = SNAKE_TO_CAMEL;
    }
  }

So if this is used:

var mapper = new ObjectMapper().registerModule(new ProtobufModule()).setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
var value = mapper.convertValue(...);

will incorrectly result in value to have SNAKE_TO_CAMEL being applied.

@jhaber
Copy link
Member

jhaber commented Jan 21, 2022

Should be fixed by #88

@michielboekhoff
Copy link

Could this please be released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants