spring-projects / spring-projects/spring-boot

Allow map binding to work with unescaped characters

Open
#13,404 16 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

theme: config-data type: enhancement
Dominant language
Java
Stars
81.5k
Forks
42.7k
Avg merge
2d 4h
Merged PRs (30d)
65

Description

Spring boot version: 2.0.2 (1.5.13 is normal)

Problem Description:

If the map key is with “/”, it cannot be parsed normally. Others are normal.

Example:

application.yml 

shiro:
  testMap:
    /test1: test1
    /test2: test2

Configuration class

@Data
@ConfigurationProperties(prefix="shiro")
public class ShiroProperties {
	private Map<String,String> testMap;
}

Test class

@Transactional
@RunWith(SpringRunner.class)
@SpringBootTest(classes=DataManage.class)
public class ShiroTest extends BaseTransactionalTest{

	@Autowired
	private ShiroProperties shiroConfig;
	
	@Test
	public void read() {
		System.out.println(shiroConfig.toString());
	}
	
}

console info:

ShiroProperties(testMap={test1=test1, test2=test2})

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the application.yml example and the ShiroProperties and ShiroTest reproducer shown in the issue. Run the binding test against the affected Spring Boot version, then trace the configuration-properties map binding behavior. Done means map keys containing unescaped '/' are retained while existing keys continue to bind normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.