make map format checker for workload specific to map structures

This commit is contained in:
Jonathan Shook
2023-12-10 21:17:29 -06:00
parent 309cb67587
commit a0eaf9758b

View File

@@ -164,8 +164,8 @@ public class OpsLoader {
// into the parsers in a non-exception way // into the parsers in a non-exception way
public static boolean isYaml(String workload) { public static boolean isYaml(String workload) {
try { try {
new Load(LoadSettings.builder().build()).loadFromString(workload); Object result = new Load(LoadSettings.builder().build()).loadFromString(workload);
return true; return (result instanceof Map);
} catch (Exception e) { } catch (Exception e) {
return false; return false;
} }