eclipse-vertx / vertx-codegen

Vert.x code generator for asynchronous polyglot APIs
Apache License 2.0
105 stars 92 forks source link

Better error messages #304

Closed pmlopes closed 4 years ago

pmlopes commented 4 years ago

A few bugs are fixed with handling serializable/deserializable on data objects. As a second step better error messages are now provided to the user. For example:

@DataObject
class DO {
}

Used on:

@VertxGen
interface MyAPI {
  void method(Handler<AsyncResult<DO>> handler);
}

Which would before fail with the message:

"type DO is not legal for use for a parameter in code generation"

Will now report:

@DataObject type DO does not declare a required serializable method when used in return

It is now clear that the DataObject contract is incomplete and the user should either implement a toJson() method or add a custom serializer annotation.

vietj commented 4 years ago

cherry-picked directly - thanks