-
-
Save msavy/cc80ab47039010b7a9f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First thing to note is that fields may be missing, and we need to provide a default. | |
// It would be nice to avoid intermediary null-check steps in this case. | |
// See also: https://github.com/jayway/JsonPath | |
"registry": { | |
"class": "io.apiman.gateway.engine.es.ESRegistry", | |
"config": { | |
"client.type": "jest", | |
"client.cluster-name": "elasticsearch_msavy", | |
"client.host": "localhost", | |
"client.port": "9201" | |
} | |
}, | |
// Pseudo-code; get item at path, else default. No intermediary null checking necessary. | |
e.g. String clientType = apimanConfig("registry.config.client.type", String.class) || "transport"; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Optional clientType = apimanConfig("registry.config.client.type", String.class).orElse("transport") perhaps?