Skip to content

Now @Ignore works when both serialize and deserialize are false #41

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

Merged
merged 1 commit into from
Dec 13, 2022

Conversation

SentryMan
Copy link
Collaborator

@SentryMan SentryMan commented Dec 13, 2022

The following fails to compile.

 @Json
 @Getter
 @Setter
  public class Person() {
  @Ignore
   private   String s;
   private   Instant time;
   private   int num;
}

It seems the adapter for the ignored String field is still getting added in the generated constructor, but not the fields.

  // naming convention Match
  // s [java.lang.String] name:s ignoreSerialize ignoreDeserialize
  // time [java.time.Instant] name:time constructor
  // sgsgs [int] name:sgsgs constructor

  private final JsonAdapter<Instant> instantJsonAdapter;
  private final JsonAdapter<Integer> pintJsonAdapter;
  private final PropertyNames names;

  public HelloController$PersonJsonAdapter(Jsonb jsonb) {
    this.stringJsonAdapter = jsonb.adapter(String.class);
    this.instantJsonAdapter = jsonb.adapter(Instant.class);
    this.pintJsonAdapter = jsonb.adapter(Integer.TYPE);

  ...rest is fine

rbygrave added a commit that referenced this pull request Dec 13, 2022
@rbygrave rbygrave merged commit f6a5406 into avaje:main Dec 13, 2022
@rbygrave rbygrave self-requested a review December 13, 2022 20:23
@rbygrave rbygrave added this to the 1.1 milestone Dec 13, 2022
@rbygrave rbygrave added the bug Something isn't working label Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants