homeport / dyff

/ˈdʏf/ - diff tool for YAML files, and sometimes JSON
MIT License
1.31k stars 65 forks source link

Dyff doesn't preserve the string type for quoted integers #384

Open ramasai1 opened 3 months ago

ramasai1 commented 3 months ago

I have two YAML files here:

---
kindTwo:
  bool: "true"
  value: "20"

and

---
kindOne:
  bool: "false"
  value: "10"

Running dyff between dyffone.yaml dyfftwo.yaml returns:

$ dyff between dyffone.yaml dyfftwo.yaml
     _        __  __
   _| |_   _ / _|/ _|  between dyffone.yaml
 / _' | | | | |_| |_       and dyfftwo.yaml
| (_| | |_| |  _|  _|
 \__,_|\__, |_| |_|   returned one difference
        |___/

(root level)
- one map entry removed:   + one map entry added:
  kindOne:                   kindTwo:
  │ bool: "false"            │ bool: "true"
  │ value: 10                │ value: 20

The integers 10 and 20 are unquoted even though they are quoted in the original YAML. The tool should report the output with the type preserved without implicitly removing the quotes.