question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistent binding from environment varaibles to maps

See original GitHub issue

I’ve noticed an inconsistency in properties binding from an ENV variable and property defined in application.properties

Consider following example:

@ConfigurationProperties("com.test")
public class Props {
    private Map<String, Map<String, String>> property;
}

application.properties <- binding works correctly

com.test.property.foo.bar=value

Environment variable <- binding fails

export COM_TEST_PROPERTY_CCC_DDD=VALUE

I would expect that the same binding behavior for an externalized configuration. Any idea how to resolve this issue using Spring Boot 1.5.2?


I am using Spring Boot 1.5.2, Linux Mint 18.1, Java 8 (“1.8.0_121”) Demo application available: https://github.com/peterjurkovic/spring-boot-binding-demo

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mkucharekcommented, Dec 28, 2017

I’ve just hit a similar issue with Eureka default zone with Spring Boot 2.0.0.M7 - it doesn’t seem to correctly handle camel cases when binding map elements…

1reaction
dturanskicommented, Apr 17, 2017

@philwebb This is a great test case: compound prefix with nested maps. If 2.0 can bind this correctly it can likely handle anything.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to customize properties binding from environment ...
I would like to get binded properties from environment variable to a map. If a property is defined in application.properties binding works ...
Read more >
Spring Boot Features
As an alternative to environment variables, many cloud platforms now allow you to map configuration into mounted data volumes.
Read more >
Environment variables - SideFX
These mappings are used when a given opened path fails to find fallbacks. Mappings can map one directory to another directory. The key...
Read more >
Docker Compose release notes
Fixed compose down to respect COMPOSE_REMOVE_ORPHANS environment variable. Fixes #9562. Fixed project-level bind mount volumes. Fixes docker/for-mac#6317. Fixed ...
Read more >
show spanning-tree inconsistent-ports (MSTP) - Aruba Networks
Shows ports blocked by STP protection functions such as Root guard, Loop guard, BPDU guard, and RPVST guard in addition to MSTI information....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found