vert-x3 / vertx-service-proxy

EventBus Proxy generation
Apache License 2.0
67 stars 58 forks source link

nulls not handled correctly in generated VertxProxyHandler #57

Closed JakePi3 closed 7 years ago

JakePi3 commented 7 years ago

I have an API roughly corresponding to:

void getResult(String key1, String key2, Handler<AsyncResult<Result>> handler);
void getBulkResults(List<JsonArray> lookup, Handler<AsyncResult<List<Result>>> handler);

The first function results in generated code that handles null values:

msg.reply(res.result() == null ? null : res.result().toJson());

But the generated code for the second function assumes all elements in the list are non-null:

msg.reply(new JsonArray(res.result().stream().map(Result::toJson).collect(Collectors.toList())));

Ideally there'd be consistency in the generated code. In this case return nulls inside the list (and serialize as [ ..., null, ... ]