Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Abstract DataObject as property type generate an impossible converter

Open
#114 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
tooling

Research direction

Start by reproducing the generated converter shown for TestObjectWithInterfaceField, TestInterface, and TestInterfaceImpl, then trace the code-generation path that handles abstract DataObject property types. Done means generation no longer emits an impossible interface construction and the resulting converter has defined JSON behavior for the interface field.

Written by the indexing model from the issue text.

Description

If you make a DataObject of this kind

@DataObject(generateConverter = true)
public class TestObjectWithInterfaceField {

  private TestInterface anInterface = new TestInterfaceImpl();

  public TestObjectWithInterfaceField() {
  }

  public TestObjectWithInterfaceField(JsonObject object){

  }

  public TestInterface getAnInterface() {
    return anInterface;
  }

  public void setAnInterface(TestInterface anInterface) {
    this.anInterface = anInterface;
  }
}

with TestInterface as :

@DataObject
public interface TestInterface {

  String getString();

}

the generated converted is :

public class TestObjectWithInterfaceFieldConverter {

  public static void fromJson(JsonObject json, TestObjectWithInterfaceField obj) {
    if (json.getValue("anInterface") instanceof JsonObject) {
      obj.setAnInterface(new TestInterface((JsonObject)json.getValue("anInterface")));
    }
  }

  public static void toJson(TestObjectWithInterfaceField obj, JsonObject json) {
  }
}

Obviously, converter isn't usable, even valid... is it fixable?

Dominant language
Java
Stars
111
Forks
88
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from eclipse-vertx/vertx-codegen

All issues in eclipse-vertx/vertx-codegen

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.