Search in sources :

Example 1 with PostmanCollectionGenerator

use of com.palantir.conjure.postman.PostmanCollectionGenerator in project conjure-postman by palantir.

the class ConjurePostmanCli method generate.

static void generate(File target, File outputDirectory, GeneratorConfiguration config) {
    try {
        ConjureDefinition conjureDefinition = OBJECT_MAPPER.readValue(target, ConjureDefinition.class);
        PostmanCollectionFileWriter writer = new DefaultPostmanCollectionFileWriter(outputDirectory.toPath());
        PostmanCollectionGenerator generator = new PostmanCollectionGenerator(config);
        writer.write(generator.generate(conjureDefinition));
    } catch (IOException e) {
        throw new RuntimeException(String.format("Error parsing definition: %s", e.toString()));
    }
}
Also used : PostmanCollectionGenerator(com.palantir.conjure.postman.PostmanCollectionGenerator) DefaultPostmanCollectionFileWriter(com.palantir.conjure.postman.writer.DefaultPostmanCollectionFileWriter) PostmanCollectionFileWriter(com.palantir.conjure.postman.writer.PostmanCollectionFileWriter) DefaultPostmanCollectionFileWriter(com.palantir.conjure.postman.writer.DefaultPostmanCollectionFileWriter) ConjureDefinition(com.palantir.conjure.spec.ConjureDefinition) IOException(java.io.IOException)

Aggregations

PostmanCollectionGenerator (com.palantir.conjure.postman.PostmanCollectionGenerator)1 DefaultPostmanCollectionFileWriter (com.palantir.conjure.postman.writer.DefaultPostmanCollectionFileWriter)1 PostmanCollectionFileWriter (com.palantir.conjure.postman.writer.PostmanCollectionFileWriter)1 ConjureDefinition (com.palantir.conjure.spec.ConjureDefinition)1 IOException (java.io.IOException)1