Skip to content

Allow map binding to work with unescaped characters #13404

Open
@yygnay

Description

@yygnay

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})

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions