spring-projects / spring-projects/spring-boot
Allow map binding to work with unescaped characters
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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