public static String convertYamlToJson ( Reader yamlReader ) { try ( Reader reader = yamlReader ) { Object yaml = new ObjectMapper ( new YAMLFactory ( ) ) . readValue ( reader , Object . class ) ; return new ObjectMapper ( ) . writeValueAsString ( yaml ) ; } catch ( IOException e ) { throw new YamlRuntimeException ( e ) ; } }
Convert yaml to json