private static @Nullable String convertToYamlIfNeeded(@NotNull Language language, JsonNode jsonNode) {
    JsonFactory jacksonFactory;
    if (language.is(JsonLanguage.INSTANCE))
      jacksonFactory = new JsonFactory();
    else
      jacksonFactory = YAMLFactory.builder()
        .disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER)
        .build();

    try {
      var exampleInTargetLanguage =  new ObjectMapper(jacksonFactory)
        .writerWithDefaultPrettyPrinter()
        .writeValueAsString(jsonNode);
      return StringUtil.trimEnd(exampleInTargetLanguage, "\n");
    }
    catch (JsonProcessingException e) {
      return null;
    }
  }
private static @Nullable String convertToYamlIfNeeded(@NotNull Language language, JsonNode jsonNode)