Search in sources :

Example 6 with Documentation

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);
}
Also used : Documentation(com.palantir.conjure.spec.Documentation) UnionDefinition(com.palantir.conjure.spec.UnionDefinition)

Example 7 with Documentation

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);
}
Also used : Documentation(com.palantir.conjure.spec.Documentation) EnumDefinition(com.palantir.conjure.spec.EnumDefinition)

Aggregations

Documentation (com.palantir.conjure.spec.Documentation)7 ImmutableList (com.google.common.collect.ImmutableList)2 ParameterName (com.palantir.conjure.parser.services.ParameterName)2 ArgumentDefinition (com.palantir.conjure.spec.ArgumentDefinition)2 ArgumentName (com.palantir.conjure.spec.ArgumentName)2 BodyParameterType (com.palantir.conjure.spec.BodyParameterType)2 EnumValueDefinition (com.palantir.conjure.spec.EnumValueDefinition)2 HeaderParameterType (com.palantir.conjure.spec.HeaderParameterType)2 ObjectDefinition (com.palantir.conjure.spec.ObjectDefinition)2 ParameterType (com.palantir.conjure.spec.ParameterType)2 PathParameterType (com.palantir.conjure.spec.PathParameterType)2 QueryParameterType (com.palantir.conjure.spec.QueryParameterType)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ReferenceTypeResolver (com.palantir.conjure.defs.ConjureTypeParserVisitor.ReferenceTypeResolver)1 ConjureDefinitionValidator (com.palantir.conjure.defs.validator.ConjureDefinitionValidator)1 EndpointDefinitionValidator (com.palantir.conjure.defs.validator.EndpointDefinitionValidator)1 EnumDefinitionValidator (com.palantir.conjure.defs.validator.EnumDefinitionValidator)1 EnumValueDefinitionValidator (com.palantir.conjure.defs.validator.EnumValueDefinitionValidator)1 ErrorDefinitionValidator (com.palantir.conjure.defs.validator.ErrorDefinitionValidator)1