public static String convertJsonToYaml(Reader jsonReader) {
        try (Reader reader = jsonReader) {
            JsonNode json = new ObjectMapper().readTree(reader);

            return new YAMLMapper().writeValueAsString(json);
        } catch (IOException e) {
            throw new YamlRuntimeException(e);
        }
    }
public static String convertJsonToYaml ( Reader jsonReader ) { try ( Reader reader = jsonReader ) { JsonNode json = new ObjectMapper ( ) . readTree ( reader ) ; return new YAMLMapper ( ) . writeValueAsString ( json ) ; } catch ( IOException e ) { throw new YamlRuntimeException ( e ) ; } }
Convert json to yaml
@param jsonReader the reader of json
@return the text of yaml