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

config-server should allow version to be empty #12

Closed
duke-cliff opened this issue Jun 23, 2017 · 2 comments
Closed

config-server should allow version to be empty #12

duke-cliff opened this issue Jun 23, 2017 · 2 comments

Comments

@duke-cliff
Copy link

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
Copy link
Member

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants