diff --git a/encoding/gjson/gjson_api_new_load.go b/encoding/gjson/gjson_api_new_load.go index 9320a2b0a..4b1bf0d04 100644 --- a/encoding/gjson/gjson_api_new_load.go +++ b/encoding/gjson/gjson_api_new_load.go @@ -207,7 +207,8 @@ func checkDataType(content []byte) string { return "json" } else if gregex.IsMatch(`^<.+>[\S\s]+<.+>$`, content) { return "xml" - } else if gregex.IsMatch(`[\s\t\n]*[\w\-]+\s*:\s*.+`, content) { + } else if gregex.IsMatch(`[\s\t\n]*[\w\-]+\s*:\s*".+"`, content) || + gregex.IsMatch(`[\s\t\n]*[\w\-]+\s*:\s*\w+`, content) { return "yml" } else if gregex.IsMatch(`\[[\w]+\]`, content) && gregex.IsMatch(`[\s\t\n\[\]]*[\w\-]+\s*=\s*.+`, content) &&