vert-x3 / vertx-config

Vert.x Configuration Service
Apache License 2.0
54 stars 64 forks source link

config-server should allow version to be empty #12

Closed duke-cliff closed 7 years ago

duke-cliff commented 7 years ago

private void parse(JsonObject body, Handler<AsyncResult> handler) { String version = body.getString("version", null); JsonArray sources = body.getJsonArray("propertySources", null); //does not use version at all. should allow version to be null if (sources == null) { handler.handle(Future.failedFuture("Invalid configuration server response, property sources missing")); } else { JsonObject configuration = new JsonObject(); for (int i = 0; i < sources.size(); i++) { JsonObject source = sources.getJsonObject(i); JsonObject content = source.getJsonObject("source"); configuration = configuration.mergeIn(content); } handler.handle(Future.succeededFuture(Buffer.buffer(configuration.encode()))); }

cescoffier commented 7 years ago

Can you provide a reproducer for this issue?

Making version optional makes sense, I just need to be sure it's a bug and have a way to test it.

duke-cliff commented 7 years ago

Yes. Some of our microservices are still using spring boot, including our config server is using "spring boot cloud config". The default cloud config when you setup is not including version in the json response. You can give it a try. Thanks.