use of com.palantir.conjure.parser.types.names.ConjurePackage in project conjure by palantir.
the class ConjureParserUtils method parseErrors.
static List<ErrorDefinition> parseErrors(NamedTypesDefinition defs, ConjureTypeParserVisitor.ReferenceTypeResolver typeResolver) {
Optional<String> defaultPackage = defs.defaultConjurePackage().map(ConjurePackage::name);
ImmutableList.Builder<ErrorDefinition> errorsBuidler = ImmutableList.builder();
errorsBuidler.addAll(defs.errors().entrySet().stream().map(entry -> {
TypeName typeName = TypeName.of(entry.getKey().name(), parsePackageOrElseThrow(entry.getValue().conjurePackage(), defaultPackage));
return parseErrorType(typeName, entry.getValue(), typeResolver);
}).collect(Collectors.toList()));
return errorsBuidler.build();
}
Aggregations