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

JsonbTypeDeserializer should support parameter elements #71

Closed
jsonbrobot opened this issue Feb 28, 2018 · 2 comments · Fixed by #283
Closed

JsonbTypeDeserializer should support parameter elements #71

jsonbrobot opened this issue Feb 28, 2018 · 2 comments · Fixed by #283
Labels
enhancement New feature or request
Milestone

Comments

@jsonbrobot
Copy link

I can do this:

public class Foo {
  private UUID id;
  @JsonbTypeDeserializer(UUIDDeserializer.class)
  public setId(UUID id) {
    this.id = id;
  }
}

But I can't do this:

public class Foo {
  private final UUID id;
  @JsonbCreator
  public Foo(
    @JsonbParameter("id") @JsonbTypeDeserializer(UUIDDeserializer.class) UUID id
  ) {
    this.id = id;
  }
}

Even though the above is semantically identical. The reason it doesn't work is that the @Target for the @JsonbTypeDeserializer annotation is not configured for parameter elements.

@jsonbrobot
Copy link
Author

@rmannibucau
Copy link

+1, this becomes very required with java records.
Any hope we get a new minor version of the spec with this fix - or relax the signature validation to enable vendors to do that keeping spec compliance?

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

Successfully merging a pull request may close this issue.

3 participants