Is there any way to validate YAML but not JSON? I specifically wanted to check if the response is in YAML but not in JSON or Plain Text. Is there any way to do this? I do not want to do this checking the content-type
I tried using YAML.load() available in the js-yaml library but this is parsing any type of file format to YAML but does not fail in any case. I check to test if the response is YAML. Is there any way to validate the structure of YAML? Or any other way? The output should fail if we pass any file format other than yaml.