SnakeYAML: how to disable underline highlighting when parsing?

Here is my problem. I have a YAML document containing the following pair:

run_ID: 2010_03_31_101

When it is sorted out, org.yaml.snakeyaml.constructor.SafeConstructor.ConstructYamlInt:159 underscores become stripped, and the constructor returns Long 20100331101 instead of the unmodified String "2010_03_31_101"one that I really need.

QUESTION: How can I disable this behavior and force the parser to use the String constructor instead of Long?

+3
source share
1 answer

OK Got a response on my mailing list. Here

, (http://yaml.org/type/int.html): "_" ,

. 1) , ( ) run_ID: '2010_03_31_101'

2) ( ) 1 2

3) int 3

, YAML. .

+5

Source: https://habr.com/ru/post/1743028/


All Articles