use of com.palantir.conjure.spec.Documentation in project conjure by palantir.
the class ConjureParserUtils method parseUnionType.
public static TypeDefinition parseUnionType(TypeName name, com.palantir.conjure.parser.types.complex.UnionTypeDefinition def, ConjureTypeParserVisitor.ReferenceTypeResolver typeResolver) {
UnionDefinition unionType = UnionDefinition.builder().typeName(name).union(parseField(def.union(), typeResolver)).docs(def.docs().map(Documentation::of)).build();
UnionDefinitionValidator.validateAll(unionType);
return TypeDefinition.union(unionType);
}
use of com.palantir.conjure.spec.Documentation in project conjure by palantir.
the class ConjureParserUtils method parseEnumType.
public static TypeDefinition parseEnumType(TypeName name, com.palantir.conjure.parser.types.complex.EnumTypeDefinition def) {
EnumDefinition enumType = EnumDefinition.builder().typeName(name).values(def.values().stream().map(ConjureParserUtils::parseEnumValue).collect(Collectors.toList())).docs(def.docs().map(Documentation::of)).build();
EnumDefinitionValidator.validateAll(enumType);
return TypeDefinition.enum_(enumType);
}
Aggregations