Technica-Engineering / kalash

Test runner made for scalable automation based on standard Python's `unittest`
GNU General Public License v3.0
3 stars 0 forks source link

[FEATURE] JSON support #8

Closed kjczarne closed 2 years ago

kjczarne commented 2 years ago

Is your feature request related to a problem? Please describe.

7 - this means we can win JSON support for free.

Describe the solution you'd like

Describe alternatives you've considered N/A

Additional context N/A

kayoub5 commented 2 years ago

@kjczarne I am not sure if you are aware, but any valid JSON is also valid YAML, so you can use the yaml parser to also parse JSON

kjczarne commented 2 years ago

@kayoub5 yes, the packages in Python are separate for YAML and JSON but they yield the identical data structure. All I need to do is use the json module on JSON files and pyyaml on YAML files and feed it directly to the data model. And hence we can use the JSON schema (#7) to validate both YAML and JSON at the same time 😉

kayoub5 commented 2 years ago

@kjczarne you don't get what I mean, yaml.parse accept json input

kjczarne commented 2 years ago

Hmm, I wasn't aware of that. I'll try parsing a JSON with pyyaml then to check.

kjczarne commented 2 years ago

Ok, this is embarrassing. It works perfectly. Years of developing in Python and I didn't know PyYaml had this ability 😆