jansupol / jsonbapi

0 stars 0 forks source link

JsonbTypeDeserializer should support parameter elements #71

Open jansupol opened 6 years ago

jansupol commented 6 years ago

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.

jansupol commented 6 years ago