Decathlon / Decathlon/tzatziki
dotNotationToYamlObject breaks content
- Dominant language
- Java
- Stars
- 87
- Forks
- 42
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 32
Description
**Description:**
com.decathlon.tzatziki.utils.Mapper#dotNotationToYamlObject:
When passing as argument an array of XMLs the conversion of dotNotationToYamlObject splits the xml.
For example the yaml:
```
- "\n\n\t"
```
will be returned as
```
- "\n\n\t"
```
This is because the regex for the dot notations is too permissive: (?>([ \-]*))(?![ "']*\?e)([^.:]+)\.((?>[^:]+)(?([ \\-]*))" + matchOnlyIfNonRegexFlag + "(\\w+)\\.((?>[^:]+)(?\\n\\n\\t"]
""".trim().stripIndent(),
Mapper.toYaml("""
- "\\n\\n\\t"
""".trim().stripIndent()));
}
```
- Implement read() for lists in TestMapperDelegate
```java
@Override
public E read(String content, Class clazz) {
if (clazz == List.class) {
return (E) readAsList(content);
}
return null;
}
public List readAsList(String content) {
return List.of(content);
}
```
**Workaround**
use `Mapper.shouldConvertDotPropertiesToObject(false);` in your local steps
Contributor guide
Assessment
This issue has not been assessed yet.