Issue #390 invalid

Incorrect parsing of List values with 2 numeric digit after colon

taran1109
created an issue

I don't know if it is some parsing standard... please let me know.

Yaml 1: (Correct Conversion)

service:
  ports: 
      - 3:123

Output JSON conversion:

{
  "service": {
    "ports": [
      "3:123"
    ]
  }
}

Yaml 2: (Incorrect Conversion)

service:
  ports: 
      - 3:12

Output JSON conversion:

{
  "service": {
    "ports": [
      192
    ]
  }
}

Comments (2)

  1. Simon Greatrix

    Looks like the value has been parsed as a time but output as an integer? "3:12" could be seen as indicating 3*60+12 = 192 minutes or seconds. As YAML understands times but JSON does not, some confusion seems likely. You could probably emphasise the textual nature of the "3:12" by writing it as:

    • !!str 3:12

    or

    • "3:12"
  2. Log in to comment