public static String yamlToJson(String yaml) throws HyscaleException {
        if(StringUtils.isBlank(yaml)){
            return yaml;
        }
        ObjectMapper yamlReader = ObjectMapperFactory.yamlMapper();
        Object obj;
        try {
            obj = yamlReader.readValue(yaml, Object.class);
            ObjectMapper jsonWriter = ObjectMapperFactory.jsonMapper();
            return jsonWriter.writeValueAsString(obj);
        } catch (IOException e) {
            LOGGER.error(e.getMessage());
            HyscaleException ex = new HyscaleException(e, CommonErrorCode.YAML_TO_JSON_CONVERSION_FAILURE,e.getMessage());
            throw ex;
        }
    }
Converts the given String to Json.

@param yaml String input
@return Json String
@throws HyscaleException if any IO Exception occurs while conversion.
commons/src/main/java/io/hyscale/commons/utils/DataFormatConverter.java