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

[Question] hasJsonConstructor in vertx/codegen/DataObjectModel.java #257

Open
bebsworthy opened this issue May 22, 2019 · 2 comments
Open

Comments

@bebsworthy
Copy link

Hello,

More of a question,

I'm trying to customize the vertx-proxygen templates to not use a constructor that requires a JsonObject but I get stopped by this bit here.

With this bit removed and by using custom templates for proxy gen that uses static factory method I don't seem to have any issues.

vertx/codegen/DataObjectModel.java

    boolean hasJsonConstructor = (constructors & 2) == 2;

    if (concrete && !hasJsonConstructor) {
      throw new GenException(modelElt, "Data object " + modelElt + " class does not have a constructor " + modelElt.getSimpleName() + "(" + JsonObject.class.getSimpleName() + ")");
    }

Alternatively does anyone have a working example of using kotlin data class with proxy-gen? The only way I could get it to work was to hack out this bit above and change the template to use jackson deserialization instead of new T(JsonObject).

on v3.7.0

@rgmz
Copy link
Contributor

rgmz commented Jun 5, 2019

Not Vertx-specific but Spring recently added support for data classes (29.5). It might be worth looking into how they accomplished that.

@slinkydeveloper
Copy link
Member

slinkydeveloper commented Jun 17, 2019

Hi, in Vert.x 4 you will be able to extend the service proxy generation using new JsonCodec feature. Let me know if you need something else

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

No branches or pull requests

3 participants