Tabnine Logo
ConjureParserUtils.parseConjureDef
Code IndexAdd Tabnine to your IDE (free)

How to use
parseConjureDef
method
in
com.palantir.conjure.defs.ConjureParserUtils

Best Java code snippets using com.palantir.conjure.defs.ConjureParserUtils.parseConjureDef (Showing top 4 results out of 315)

origin: palantir/conjure

  /**
   * Deserializes {@link ConjureDefinition} from their YAML representations in the given files.
   */
  public static ConjureDefinition parse(Collection<File> files) {
    return ConjureParserUtils.parseConjureDef(
        files.stream().map(ConjureParser::parse).collect(Collectors.toList()));
  }
}
origin: palantir/conjure

@Test
public void resolvesImportedAliases() {
  ConjureDefinition conjureDefinition = ConjureParserUtils.parseConjureDef(
      ImmutableList.of(ConjureParser.parse(new File("src/test/resources/example-conjure-imports.yml"))));
  assertThat(conjureDefinition.getTypes()).hasSize(1);
}
origin: palantir/conjure

  @Test
  @Ignore
  public void handlesNonJavaExternalType() {
    ConjureDefinition conjureDefinition = ConjureParserUtils.parseConjureDef(
        ImmutableList.of(ConjureParser.parse(new File("src/test/resources/example-external-types.yml"))));
  }
}
origin: palantir/conjure

@Test
public void testConjureSpec() {
  // test positive cases
  testCaseDef.positive().orElse(new TreeMap<>()).entrySet().stream().forEach(entry -> {
    String testName = String.format("positive case %s", entry.getKey());
    String yml = getYmlAsString(testName, entry.getValue().conjure());
    try {
      ConjureParserUtils.parseConjureDef(ImmutableList.of(MAPPER.readValue(yml, ConjureSourceFile.class)));
    } catch (Exception e) {
      Assertions.fail("Conjure for case should be valid according to the spec: " + testName, e);
    }
  });
  // test negative cases
  testCaseDef.negative().orElse(new TreeMap<>()).entrySet().stream().forEach(entry -> {
    String testName = String.format("negative case %s", entry.getKey());
    String yml = getYmlAsString(testName, entry.getValue().conjure());
    try {
      ConjureParserUtils.parseConjureDef(ImmutableList.of(MAPPER.readValue(yml, ConjureSourceFile.class)));
      Assertions.fail("Conjure for case should be invalid according to the spec: " + testName);
    } catch (Exception e) {
      Assertions.assertThat(e).withFailMessage("Failure message for case did not match expectation: "
          + testName + "\nMessage:\n" + e.getMessage() + "\ndid not contain:\n"
          + entry.getValue().expectedError()).hasMessageContaining(entry.getValue().expectedError());
    }
  });
}
com.palantir.conjure.defsConjureParserUtilsparseConjureDef

Popular methods of ConjureParserUtils

  • createTypeName
  • parseAliasType
  • parseArgs
  • parseAuthType
  • parseConjurePackage
  • parseEndpoint
  • parseEnumType
  • parseErrorType
  • parseErrors
  • parseField
  • parseFieldName
  • parseHttpPath
  • parseFieldName,
  • parseHttpPath,
  • parseImportObjects,
  • parseMarkers,
  • parseObjectType,
  • parseObjects,
  • parsePackageOrElseThrow,
  • parseParameterType,
  • parsePrimitiveType

Popular in Java

  • Making http requests using okhttp
  • startActivity (Activity)
  • putExtra (Intent)
  • getSupportFragmentManager (FragmentActivity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now