code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
public static ConjureDefinition parse(ConjureArgs args) {
Map<String, AnnotatedConjureSourceFile> sourceFiles = ConjureParser.parseAnnotated(args.definitions());
ConjureDefinition ir = ConjureParserUtils.parseConjureDef(sourceFiles, args.safetyDeclarations());
return NormalizeDefinition.normaliz... | Deserializes {@link ConjureDefinition} from their YAML representations in the given files. | parse | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/Conjure.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/Conjure.java | Apache-2.0 |
static Builder builder() {
return new Builder();
} | If {@link SafetyDeclarationRequirements#REQUIRED}, all components
which allow safety declarations must declare safety. | builder | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureArgs.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureArgs.java | Apache-2.0 |
public static String parseConjurePackage(ConjurePackage parsed) {
return parsed.name();
} | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseConjurePackage | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
public static String parsePackageOrElseThrow(
Optional<ConjurePackage> conjurePackage, Optional<String> defaultPackage) {
String packageName = conjurePackage
.map(ConjurePackage::name)
.orElseGet(() -> defaultPackage.orElseThrow(() -> new SafeIllegalArgumentException(... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parsePackageOrElseThrow | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
public static ErrorDefinition parseErrorType(
TypeName name,
com.palantir.conjure.parser.types.complex.ErrorTypeDefinition def,
ConjureTypeParserVisitor.ReferenceTypeResolver typeResolver) {
ErrorDefinition errorType = ErrorDefinition.builder()
.errorName(name... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseErrorType | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
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(ConjureParserU... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseEnumType | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
public static TypeDefinition parseUnionType(
TypeName name,
com.palantir.conjure.parser.types.complex.UnionTypeDefinition def,
ConjureTypeParserVisitor.ReferenceTypeResolver typeResolver) {
UnionDefinition unionType = UnionDefinition.builder()
.typeName(name)
... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseUnionType | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
public static TypeDefinition parseObjectType(
TypeName name,
com.palantir.conjure.parser.types.complex.ObjectTypeDefinition def,
ConjureTypeParserVisitor.ReferenceTypeResolver typeResolver) {
ObjectDefinition objectType = ObjectDefinition.builder()
.typeName(n... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseObjectType | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
public static TypeDefinition parseAliasType(
TypeName name,
com.palantir.conjure.parser.types.reference.AliasTypeDefinition def,
ConjureTypeParserVisitor.ReferenceTypeResolver typeResolver) {
return TypeDefinition.alias(AliasDefinition.builder()
.typeName(name... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseAliasType | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
public static Type parsePrimitiveType(com.palantir.conjure.parser.types.primitive.PrimitiveType primitiveType) {
return Type.primitive(PrimitiveType.valueOf(primitiveType.name()));
} | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parsePrimitiveType | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
static Type parseExternalType(ExternalTypeDefinition externalType, String conjurePackage, String typeName) {
if (isBearerToken(externalType) && externalType.safety().isPresent()) {
throw new ConjureRuntimeException(
"Cannot mark safety of external import with base type BearerToke... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseExternalType | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
private static boolean isBearerToken(ExternalTypeDefinition externalTypeDefinition) {
return externalTypeDefinition
.baseType()
.equals(com.palantir.conjure.parser.types.primitive.PrimitiveType.BEARERTOKEN);
} | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | isBearerToken | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
public static TypeName createTypeName(
String name,
com.palantir.conjure.parser.types.BaseObjectTypeDefinition def,
Optional<String> defaultPackage) {
TypeName type = TypeName.of(name, parsePackageOrElseThrow(def.conjurePackage(), defaultPackage));
TypeNameValidator.v... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | createTypeName | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
@Deprecated
static ConjureDefinition parseConjureDef(Collection<AnnotatedConjureSourceFile> annotatedParsedDefs) {
return parseConjureDef(annotatedParsedDefs.stream()
.collect(Collectors.toMap(source -> source.sourceFile().getAbsolutePath(), Function.identity())));
} | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseConjureDef | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
@Deprecated
static ConjureDefinition parseConjureDef(Map<String, AnnotatedConjureSourceFile> annotatedParsedDefs) {
return parseConjureDef(annotatedParsedDefs, SafetyDeclarationRequirements.ALLOWED);
} | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseConjureDef | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
static ConjureDefinition parseConjureDef(
Map<String, AnnotatedConjureSourceFile> annotatedParsedDefs,
SafetyDeclarationRequirements safetyDeclarations) {
ImmutableList.Builder<ServiceDefinition> servicesBuilder = ImmutableList.builder();
ImmutableList.Builder<ErrorDefinition> er... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseConjureDef | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
private static Map<TypeName, TypeDefinition> parseImportObjects(
Map<Namespace, ConjureImports> conjureImports, Map<String, AnnotatedConjureSourceFile> externalTypes) {
return innerParseImportObjects(conjureImports, externalTypes, new HashSet<>());
} | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseImportObjects | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
private static Map<TypeName, TypeDefinition> innerParseImportObjects(
Map<Namespace, ConjureImports> conjureImports,
Map<String, AnnotatedConjureSourceFile> externalTypes,
Set<String> loadedFiles) {
Map<TypeName, TypeDefinition> allDefinitions = new HashMap<>();
conju... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | innerParseImportObjects | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
static ServiceDefinition parseService(
com.palantir.conjure.parser.services.ServiceDefinition parsed,
TypeName serviceName,
ReferenceTypeResolver typeResolver,
EndpointErrorResolver endpointErrorResolver,
DealiasingTypeVisitor dealiasingVisitor) {
List... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseService | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
static Map<TypeName, TypeDefinition> parseObjects(
com.palantir.conjure.parser.types.TypesDefinition parsed,
ConjureTypeParserVisitor.ReferenceTypeResolver typeResolver) {
Optional<String> defaultPackage =
parsed.definitions().defaultConjurePackage().map(ConjurePackage::n... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseObjects | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
static List<ErrorDefinition> parseErrors(
NamedTypesDefinition defs, ConjureTypeParserVisitor.ReferenceTypeResolver typeResolver) {
Optional<String> defaultPackage = defs.defaultConjurePackage().map(ConjurePackage::name);
ImmutableList.Builder<ErrorDefinition> errorsBuidler = ImmutableList.b... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseErrors | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
private static EnumValueDefinition parseEnumValue(
com.palantir.conjure.parser.types.complex.EnumValueDefinition def) {
EnumValueDefinition enumValue = EnumValueDefinition.builder()
.value(def.value())
.docs(def.docs().map(Documentation::of))
.deprecat... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseEnumValue | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
static List<FieldDefinition> parseField(
Map<
com.palantir.conjure.parser.types.names.FieldName,
com.palantir.conjure.parser.types.complex.FieldDefinition>
def,
ConjureTypeParserVisitor.ReferenceTypeResolver typeResolver... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseField | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
@SuppressWarnings("for-rollout:StatementSwitchToExpressionSwitch")
private static LogSafety parseLogSafety(LogSafetyDefinition def) {
switch (def) {
case SAFE:
return LogSafety.SAFE;
case UNSAFE:
return LogSafety.UNSAFE;
case DO_NOT_LOG:
... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseLogSafety | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
private static FieldName parseFieldName(com.palantir.conjure.parser.types.names.FieldName parserFieldName) {
FieldName fieldName = FieldName.of(parserFieldName.name());
FieldNameValidator.validate(fieldName);
return fieldName;
} | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseFieldName | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
private static EndpointDefinition parseEndpoint(
String name,
com.palantir.conjure.parser.services.EndpointDefinition def,
PathString basePath,
Optional<AuthType> defaultAuth,
ReferenceTypeResolver typeResolver,
EndpointErrorResolver endpointErrorR... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseEndpoint | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
private static HttpPath parseHttpPath(
com.palantir.conjure.parser.services.EndpointDefinition def, PathString basePath) {
HttpPath httpPath = HttpPath.of(basePath.resolve(def.http().path()).toString());
HttpPathValidator.validate(httpPath);
return httpPath;
} | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseHttpPath | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
@SuppressWarnings({"for-rollout:StatementSwitchToExpressionSwitch", "for-rollout:UnnecessaryDefaultInEnumSwitch"})
private static Optional<AuthType> parseAuthType(
com.palantir.conjure.parser.services.AuthDefinition authDefinition) {
switch (authDefinition.type()) {
case HEADER:
... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseAuthType | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
private static List<ArgumentDefinition> parseArgs(
Map<ParameterName, com.palantir.conjure.parser.services.ArgumentDefinition> args,
HttpPath httpPath,
ReferenceTypeResolver typeResolver) {
ImmutableList.Builder<ArgumentDefinition> resultBuilder = ImmutableList.builder();
... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseArgs | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
@SuppressWarnings({"for-rollout:StatementSwitchToExpressionSwitch", "for-rollout:UnnecessaryDefaultInEnumSwitch"})
private static ParameterType parseParameterType(
com.palantir.conjure.parser.services.ArgumentDefinition argumentDef,
ArgumentName argName,
HttpPath httpPath) {
... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseParameterType | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
private static Set<Type> parseMarkers(
Set<com.palantir.conjure.parser.types.ConjureType> markers,
ConjureTypeParserVisitor.ReferenceTypeResolver typeResolver) {
return markers.stream()
.map(m -> m.visit(new ConjureTypeParserVisitor(typeResolver)))
.collec... | Utility methods used to parse {@code com.palantir.conjure.parser} definitions into {@code com.palantir.conjure.defs}
definitions. | parseMarkers | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureParserUtils.java | Apache-2.0 |
@Override
public Type resolve(LocalReferenceType reference) {
return resolveFromTypeName(reference.type(), types);
} | The core translator between parsed/raw types and the IR spec representation exposed to compilers. | resolve | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | Apache-2.0 |
@Override
public Type resolve(ForeignReferenceType reference) {
String namespaceFile = importProviders.get(reference.namespace());
Preconditions.checkNotNull(namespaceFile, "Import not found for namespace: %s", reference.namespace());
AnnotatedConjureSourceFile externalFile =... | The core translator between parsed/raw types and the IR spec representation exposed to compilers. | resolve | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | Apache-2.0 |
private static Type resolveFromTypeName(
com.palantir.conjure.parser.types.names.TypeName name, TypesDefinition types) {
Optional<String> defaultPackage =
types.definitions().defaultConjurePackage().map(ConjureParserUtils::parseConjurePackage);
BaseObjectTypeD... | The core translator between parsed/raw types and the IR spec representation exposed to compilers. | resolveFromTypeName | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | Apache-2.0 |
@Override
public Type visitAny(AnyType _type) {
return Type.primitive(com.palantir.conjure.spec.PrimitiveType.ANY);
} | The core translator between parsed/raw types and the IR spec representation exposed to compilers. | visitAny | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | Apache-2.0 |
@Override
public Type visitList(ListType type) {
return Type.list(com.palantir.conjure.spec.ListType.of(type.itemType().visit(this)));
} | The core translator between parsed/raw types and the IR spec representation exposed to compilers. | visitList | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | Apache-2.0 |
@Override
public Type visitMap(MapType type) {
return Type.map(com.palantir.conjure.spec.MapType.of(
type.keyType().visit(this), type.valueType().visit(this)));
} | The core translator between parsed/raw types and the IR spec representation exposed to compilers. | visitMap | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | Apache-2.0 |
@Override
public Type visitOptional(OptionalType type) {
return Type.optional(
com.palantir.conjure.spec.OptionalType.of(type.itemType().visit(this)));
} | The core translator between parsed/raw types and the IR spec representation exposed to compilers. | visitOptional | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | Apache-2.0 |
@Override
public Type visitPrimitive(PrimitiveType type) {
return ConjureParserUtils.parsePrimitiveType(type);
} | The core translator between parsed/raw types and the IR spec representation exposed to compilers. | visitPrimitive | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | Apache-2.0 |
@Override
public Type visitLocalReference(LocalReferenceType type) {
return nameResolver.resolve(type);
} | The core translator between parsed/raw types and the IR spec representation exposed to compilers. | visitLocalReference | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | Apache-2.0 |
@Override
public Type visitForeignReference(ForeignReferenceType type) {
return nameResolver.resolve(type);
} | The core translator between parsed/raw types and the IR spec representation exposed to compilers. | visitForeignReference | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | Apache-2.0 |
@Override
public Type visitSet(SetType type) {
return Type.set(com.palantir.conjure.spec.SetType.of(type.itemType().visit(this)));
} | The core translator between parsed/raw types and the IR spec representation exposed to compilers. | visitSet | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | Apache-2.0 |
@Override
public Type visitBinary(BinaryType _type) {
return Type.primitive(com.palantir.conjure.spec.PrimitiveType.BINARY);
} | The core translator between parsed/raw types and the IR spec representation exposed to compilers. | visitBinary | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | Apache-2.0 |
@Override
public Type visitDateTime(DateTimeType _type) {
return Type.primitive(com.palantir.conjure.spec.PrimitiveType.DATETIME);
} | The core translator between parsed/raw types and the IR spec representation exposed to compilers. | visitDateTime | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/ConjureTypeParserVisitor.java | Apache-2.0 |
ErrorTypeName resolve(ConjureType conjureType) {
return conjureType.visit(this);
} | Endpoint error definitions are either references to errors defined in the same file as the endpoint definition, or in
imported Conjure files. This class creates a {@link com.palantir.conjure.spec.ErrorTypeName} object from a
{@link com.palantir.conjure.parser.types.reference.ReferenceType} to a Conjure defined error de... | resolve | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | Apache-2.0 |
private ErrorTypeName resolveReferenceType(LocalReferenceType localReferenceType) {
return resolveInternal(localReferenceType.type(), parsedErrors, defaultConjurePackage);
} | Endpoint error definitions are either references to errors defined in the same file as the endpoint definition, or in
imported Conjure files. This class creates a {@link com.palantir.conjure.spec.ErrorTypeName} object from a
{@link com.palantir.conjure.parser.types.reference.ReferenceType} to a Conjure defined error de... | resolveReferenceType | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | Apache-2.0 |
private ErrorTypeName resolveReferenceType(ForeignReferenceType foreignReferenceType) {
String namespaceFile = importProviders.get(foreignReferenceType.namespace());
Preconditions.checkNotNull(
namespaceFile, "Import not found for namespace: %s", foreignReferenceType.namespace());
... | Endpoint error definitions are either references to errors defined in the same file as the endpoint definition, or in
imported Conjure files. This class creates a {@link com.palantir.conjure.spec.ErrorTypeName} object from a
{@link com.palantir.conjure.parser.types.reference.ReferenceType} to a Conjure defined error de... | resolveReferenceType | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | Apache-2.0 |
private static ErrorTypeName resolveInternal(
TypeName name,
Map<TypeName, ErrorTypeDefinition> parsedErrorDefinitions,
Optional<ConjurePackage> defaultConjurePackage) {
ErrorTypeDefinition errorDefinition = parsedErrorDefinitions.get(name);
if (errorDefinition == nul... | Endpoint error definitions are either references to errors defined in the same file as the endpoint definition, or in
imported Conjure files. This class creates a {@link com.palantir.conjure.spec.ErrorTypeName} object from a
{@link com.palantir.conjure.parser.types.reference.ReferenceType} to a Conjure defined error de... | resolveInternal | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | Apache-2.0 |
@Override
public ErrorTypeName visitAny(AnyType type) {
throw new SafeIllegalArgumentException(UNSUPPORTED_TYPE_MESSAGE, SafeArg.of("type", type));
} | Endpoint error definitions are either references to errors defined in the same file as the endpoint definition, or in
imported Conjure files. This class creates a {@link com.palantir.conjure.spec.ErrorTypeName} object from a
{@link com.palantir.conjure.parser.types.reference.ReferenceType} to a Conjure defined error de... | visitAny | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | Apache-2.0 |
@Override
public ErrorTypeName visitList(ListType type) {
throw new SafeIllegalArgumentException(UNSUPPORTED_TYPE_MESSAGE, SafeArg.of("type", type));
} | Endpoint error definitions are either references to errors defined in the same file as the endpoint definition, or in
imported Conjure files. This class creates a {@link com.palantir.conjure.spec.ErrorTypeName} object from a
{@link com.palantir.conjure.parser.types.reference.ReferenceType} to a Conjure defined error de... | visitList | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | Apache-2.0 |
@Override
public ErrorTypeName visitMap(MapType type) {
throw new SafeIllegalArgumentException(UNSUPPORTED_TYPE_MESSAGE, SafeArg.of("type", type));
} | Endpoint error definitions are either references to errors defined in the same file as the endpoint definition, or in
imported Conjure files. This class creates a {@link com.palantir.conjure.spec.ErrorTypeName} object from a
{@link com.palantir.conjure.parser.types.reference.ReferenceType} to a Conjure defined error de... | visitMap | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | Apache-2.0 |
@Override
public ErrorTypeName visitOptional(OptionalType type) {
throw new SafeIllegalArgumentException(UNSUPPORTED_TYPE_MESSAGE, SafeArg.of("type", type));
} | Endpoint error definitions are either references to errors defined in the same file as the endpoint definition, or in
imported Conjure files. This class creates a {@link com.palantir.conjure.spec.ErrorTypeName} object from a
{@link com.palantir.conjure.parser.types.reference.ReferenceType} to a Conjure defined error de... | visitOptional | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | Apache-2.0 |
@Override
public ErrorTypeName visitPrimitive(PrimitiveType type) {
throw new SafeIllegalArgumentException(UNSUPPORTED_TYPE_MESSAGE, SafeArg.of("type", type));
} | Endpoint error definitions are either references to errors defined in the same file as the endpoint definition, or in
imported Conjure files. This class creates a {@link com.palantir.conjure.spec.ErrorTypeName} object from a
{@link com.palantir.conjure.parser.types.reference.ReferenceType} to a Conjure defined error de... | visitPrimitive | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | Apache-2.0 |
@Override
public ErrorTypeName visitLocalReference(LocalReferenceType type) {
return resolveReferenceType(type);
} | Endpoint error definitions are either references to errors defined in the same file as the endpoint definition, or in
imported Conjure files. This class creates a {@link com.palantir.conjure.spec.ErrorTypeName} object from a
{@link com.palantir.conjure.parser.types.reference.ReferenceType} to a Conjure defined error de... | visitLocalReference | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | Apache-2.0 |
@Override
public ErrorTypeName visitForeignReference(ForeignReferenceType type) {
return resolveReferenceType(type);
} | Endpoint error definitions are either references to errors defined in the same file as the endpoint definition, or in
imported Conjure files. This class creates a {@link com.palantir.conjure.spec.ErrorTypeName} object from a
{@link com.palantir.conjure.parser.types.reference.ReferenceType} to a Conjure defined error de... | visitForeignReference | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | Apache-2.0 |
@Override
public ErrorTypeName visitSet(SetType type) {
throw new SafeIllegalArgumentException(UNSUPPORTED_TYPE_MESSAGE, SafeArg.of("type", type));
} | Endpoint error definitions are either references to errors defined in the same file as the endpoint definition, or in
imported Conjure files. This class creates a {@link com.palantir.conjure.spec.ErrorTypeName} object from a
{@link com.palantir.conjure.parser.types.reference.ReferenceType} to a Conjure defined error de... | visitSet | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | Apache-2.0 |
@Override
public ErrorTypeName visitBinary(BinaryType type) {
throw new SafeIllegalArgumentException(UNSUPPORTED_TYPE_MESSAGE, SafeArg.of("type", type));
} | Endpoint error definitions are either references to errors defined in the same file as the endpoint definition, or in
imported Conjure files. This class creates a {@link com.palantir.conjure.spec.ErrorTypeName} object from a
{@link com.palantir.conjure.parser.types.reference.ReferenceType} to a Conjure defined error de... | visitBinary | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | Apache-2.0 |
@Override
public ErrorTypeName visitDateTime(DateTimeType type) {
throw new SafeIllegalArgumentException(UNSUPPORTED_TYPE_MESSAGE, SafeArg.of("type", type));
} | Endpoint error definitions are either references to errors defined in the same file as the endpoint definition, or in
imported Conjure files. This class creates a {@link com.palantir.conjure.spec.ErrorTypeName} object from a
{@link com.palantir.conjure.parser.types.reference.ReferenceType} to a Conjure defined error de... | visitDateTime | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/EndpointErrorResolver.java | Apache-2.0 |
@Override
public TypeDefinition visit(AliasTypeDefinition def) {
return ConjureParserUtils.parseAliasType(
ConjureParserUtils.createTypeName(name, def, defaultPackage), def, typeResolver);
} | The core translator between parsed/raw type definitions and the IR spec representation exposed to compilers. | visit | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/TypeDefinitionParserVisitor.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/TypeDefinitionParserVisitor.java | Apache-2.0 |
@Override
public TypeDefinition visit(EnumTypeDefinition def) {
return ConjureParserUtils.parseEnumType(ConjureParserUtils.createTypeName(name, def, defaultPackage), def);
} | The core translator between parsed/raw type definitions and the IR spec representation exposed to compilers. | visit | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/TypeDefinitionParserVisitor.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/TypeDefinitionParserVisitor.java | Apache-2.0 |
@Override
public TypeDefinition visit(ObjectTypeDefinition def) {
return ConjureParserUtils.parseObjectType(
ConjureParserUtils.createTypeName(name, def, defaultPackage), def, typeResolver);
} | The core translator between parsed/raw type definitions and the IR spec representation exposed to compilers. | visit | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/TypeDefinitionParserVisitor.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/TypeDefinitionParserVisitor.java | Apache-2.0 |
@Override
public TypeDefinition visit(UnionTypeDefinition def) {
return ConjureParserUtils.parseUnionType(
ConjureParserUtils.createTypeName(name, def, defaultPackage), def, typeResolver);
} | The core translator between parsed/raw type definitions and the IR spec representation exposed to compilers. | visit | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/TypeDefinitionParserVisitor.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/TypeDefinitionParserVisitor.java | Apache-2.0 |
@Override
public void validate(EndpointDefinition definition, DealiasingTypeVisitor dealiasingTypeVisitor) {
validator.validate(definition, dealiasingTypeVisitor);
} | Simplified constructor for validators that don't need to look at the context. | validate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public void validate(EndpointDefinition definition, DealiasingTypeVisitor dealiasingTypeVisitor) {
definition.getArgs().stream()
.filter(arg -> !arg.getParamType().accept(ParameterTypeVisitor.IS_BODY))
.forEach(arg -> Preconditions.checkArgument(
... | Simplified constructor for validators that don't need to look at the context. | validate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
private static boolean validateType(Type input, DealiasingTypeVisitor dealiasingTypeVisitor) {
Optional<Type> dealiased =
dealiasingTypeVisitor.dealias(input).fold(_typeDefinition -> Optional.empty(), Optional::of);
// typeDef isn't binary
if (!dealiased.isPresent... | Simplified constructor for validators that don't need to look at the context. | validateType | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public void validate(EndpointDefinition definition) {
List<ArgumentDefinition> bodyParams = definition.getArgs().stream()
.filter(entry -> entry.getParamType().accept(ParameterTypeVisitor.IS_BODY))
.collect(Collectors.toList());
Precondi... | Simplified constructor for validators that don't need to look at the context. | validate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public void validate(EndpointDefinition definition) {
HttpMethod method = definition.getHttpMethod();
if (method.equals(HttpMethod.GET)) {
boolean hasBody = definition.getArgs().stream()
.anyMatch(entry -> entry.getParamType().accept(Para... | Simplified constructor for validators that don't need to look at the context. | validate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public void validate(EndpointDefinition definition, DealiasingTypeVisitor dealiasingTypeVisitor) {
definition.getArgs().stream()
.filter(entry -> entry.getParamType().accept(ParameterTypeVisitor.IS_BODY))
.forEach(entry -> {
b... | Simplified constructor for validators that don't need to look at the context. | validate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
private static boolean isOptionalBinary(Type type) {
return type.accept(TypeVisitor.IS_OPTIONAL)
? type.accept(TypeVisitor.OPTIONAL).getItemType().accept(TypeVisitor.IS_BINARY)
: false;
} | Simplified constructor for validators that don't need to look at the context. | isOptionalBinary | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public void validate(EndpointDefinition definition) {
String description = describe(definition);
Set<ArgumentName> pathParamIds = new HashSet<>();
definition.getArgs().stream()
.filter(entry -> entry.getParamType().accept(ParameterTypeVisitor.IS_... | Simplified constructor for validators that don't need to look at the context. | validate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public void validate(EndpointDefinition definition, DealiasingTypeVisitor dealiasingTypeVisitor) {
definition.getArgs().stream()
.filter(entry -> entry.getParamType().accept(ParameterTypeVisitor.IS_PATH))
.forEach(entry -> {
E... | Simplified constructor for validators that don't need to look at the context. | validate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public void validate(EndpointDefinition definition, DealiasingTypeVisitor dealiasingTypeVisitor) {
definition.getArgs().stream()
.filter(entry -> entry.getParamType().accept(ParameterTypeVisitor.IS_HEADER))
.forEach(headerArgDefinition -> {
... | Simplified constructor for validators that don't need to look at the context. | validate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
private static Boolean recursivelyValidate(Type type, DealiasingTypeVisitor visitor) {
return visitor.dealias(type)
.fold(typeDefinition -> typeDefinition.accept(TypeDefinitionVisitor.IS_ENUM), subType -> {
boolean definedPrimitive = subType.accept(TypeVisitor.IS_... | Simplified constructor for validators that don't need to look at the context. | recursivelyValidate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public void validate(EndpointDefinition definition, DealiasingTypeVisitor dealiasingTypeVisitor) {
definition.getArgs().stream()
.filter(entry -> entry.getParamType().accept(ParameterTypeVisitor.IS_QUERY))
.forEach(argDefinition -> {
... | Simplified constructor for validators that don't need to look at the context. | validate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
private static Boolean recursivelyValidate(Type type, DealiasingTypeVisitor visitor, boolean isNested) {
return visitor.dealias(type)
.fold(
typeDefinition -> typeDefinition.accept(TypeDefinitionVisitor.IS_ENUM),
subType -> subType.... | Simplified constructor for validators that don't need to look at the context. | recursivelyValidate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public Boolean visitPrimitive(PrimitiveType value) {
return value.get() != PrimitiveType.Value.ANY;
} | Simplified constructor for validators that don't need to look at the context. | visitPrimitive | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public Boolean visitOptional(OptionalType value) {
return !isNested && recursivelyValidate(value.getItemType(), visitor, true);
} | Simplified constructor for validators that don't need to look at the context. | visitOptional | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public Boolean visitList(ListType value) {
return !isNested && recursivelyValidate(value.getItemType(), visitor, true);
} | Simplified constructor for validators that don't need to look at the context. | visitList | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public Boolean visitSet(SetType value) {
return !isNested && recursivelyValidate(value.getItemType(), visitor, true);
} | Simplified constructor for validators that don't need to look at the context. | visitSet | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public Boolean visitMap(MapType _value) {
return false;
} | Simplified constructor for validators that don't need to look at the context. | visitMap | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public Boolean visitReference(TypeName _value) {
throw new ConjureRuntimeException(
"Unexpected type when validating query parameters");
} | Simplified constructor for validators that don't need to look at the context. | visitReference | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public Boolean visitExternal(ExternalReference _value) {
throw new ConjureRuntimeException(
"Unexpected type when validating query parameters");
} | Simplified constructor for validators that don't need to look at the context. | visitExternal | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public Boolean visitUnknown(String _unknownType) {
throw new ConjureRuntimeException(
"Unexpected type when validating query parameters");
} | Simplified constructor for validators that don't need to look at the context. | visitUnknown | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public void validate(EndpointDefinition definition, DealiasingTypeVisitor dealiasingTypeVisitor) {
definition.getArgs().stream()
.filter(entry -> entry.getParamType().accept(ParameterTypeVisitor.IS_PATH)
|| entry.getParamType().accept(Paramet... | Simplified constructor for validators that don't need to look at the context. | validate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
private static boolean validateType(Type input, DealiasingTypeVisitor dealiasingTypeVisitor) {
Optional<Type> dealiased =
dealiasingTypeVisitor.dealias(input).fold(_typeDefinition -> Optional.empty(), Optional::of);
// typeDef isn't bearertoken
if (!dealiased.isPr... | Simplified constructor for validators that don't need to look at the context. | validateType | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public void validate(EndpointDefinition definition) {
definition.getArgs().forEach(arg -> {
boolean matches = CaseConverter.CAMEL_CASE_PATTERN.matches(
arg.getArgName().get());
Preconditions.checkState(
matches... | Simplified constructor for validators that don't need to look at the context. | validate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
@SuppressWarnings("Slf4jLogsafeArgs")
public void validate(EndpointDefinition definition) {
definition.getArgs().forEach(arg -> {
ParameterType paramType = arg.getParamType();
if (paramType.accept(ParameterTypeVisitor.IS_BODY) || paramType.accept(Par... | Simplified constructor for validators that don't need to look at the context. | validate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public void validate(EndpointDefinition definition) {
Preconditions.checkState(
!HttpMethod.Value.UNKNOWN.equals(definition.getHttpMethod().get()),
"HTTP method must be (%s), but received '%s' in endpoint '%s'.",
HttpMethod.values... | Simplified constructor for validators that don't need to look at the context. | validate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
@Override
public void validate(EndpointDefinition definition) {
Set<String> endpointErrorNameAndNamespaces = new HashSet<>();
for (EndpointError endpointErrorDef : definition.getErrors()) {
ErrorTypeName errorTypeName = endpointErrorDef.getError();
String ... | Simplified constructor for validators that don't need to look at the context. | validate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
private static String describe(EndpointDefinition endpoint) {
return String.format(
"%s{http: %s %s}", endpoint.getEndpointName(), endpoint.getHttpMethod(), endpoint.getHttpPath());
} | Simplified constructor for validators that don't need to look at the context. | describe | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/EndpointDefinitionValidator.java | Apache-2.0 |
public static String capitalize(FieldName fieldName) {
return StringUtils.capitalize(fieldName.get());
} | Converts this {@link FieldName} to an upper camel case string (e.g. myVariant -> MyVariant).
Note that the resultant string is no longer a valid {@link FieldName}. | capitalize | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/FieldNameValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/FieldNameValidator.java | Apache-2.0 |
public static FieldName toCase(FieldName fieldName, CaseConverter.Case targetCase) {
return FieldName.of(nameCase(fieldName).convertTo(fieldName.get(), targetCase));
} | Converts this {@link FieldName} to a {@link FieldName} with the given case. | toCase | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/FieldNameValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/FieldNameValidator.java | Apache-2.0 |
@SuppressWarnings("Slf4jLogsafeArgs")
public static void validate(FieldName fieldName) {
boolean matchesCamelCase = CaseConverter.CAMEL_CASE_PATTERN.matches(fieldName.get());
if (!matchesCamelCase
&& !CaseConverter.KEBAB_CASE_PATTERN.matches(fieldName.get())
&& !Case... | Converts this {@link FieldName} to a {@link FieldName} with the given case. | validate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/FieldNameValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/FieldNameValidator.java | Apache-2.0 |
private static CaseConverter.Case nameCase(FieldName fieldName) {
for (CaseConverter.Case nameCase : CaseConverter.Case.values()) {
if (nameCase.getPattern().matches(fieldName.get())) {
return nameCase;
}
}
throw new IllegalStateException("Could not find c... | Converts this {@link FieldName} to a {@link FieldName} with the given case. | nameCase | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/FieldNameValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/FieldNameValidator.java | Apache-2.0 |
public static Set<ArgumentName> pathArgs(String httpPath) {
UriTemplate uriTemplate = new UriTemplate(httpPath);
return uriTemplate.getTemplateVariables().stream().map(ArgumentName::of).collect(Collectors.toSet());
} | returns path arguments of the http path. | pathArgs | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/HttpPathValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/HttpPathValidator.java | Apache-2.0 |
public static void validate(HttpPath httpPath) {
Path path = Paths.get(httpPath.get());
Preconditions.checkArgument(
path.isAbsolute(), "Conjure paths must be absolute, i.e., start with '/': %s", path);
Preconditions.checkArgument(
path.getSegments().isEmpty() || ... | validates if a new instance has the correct syntax. | validate | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/HttpPathValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/HttpPathValidator.java | Apache-2.0 |
public static String withoutLeadingSlash(String httpPath) {
if (httpPath.startsWith("/")) {
return httpPath.substring(1);
} else {
return httpPath;
}
} | validates if a new instance has the correct syntax. | withoutLeadingSlash | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/HttpPathValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/HttpPathValidator.java | Apache-2.0 |
@Override
public Boolean visitString() {
return true;
} | Returns whether the type allows safety information. | visitString | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/SafetyValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/SafetyValidator.java | Apache-2.0 |
@Override
public Boolean visitDatetime() {
return true;
} | Returns whether the type allows safety information. | visitDatetime | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/SafetyValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/SafetyValidator.java | Apache-2.0 |
@Override
public Boolean visitInteger() {
return true;
} | Returns whether the type allows safety information. | visitInteger | java | palantir/conjure | conjure-core/src/main/java/com/palantir/conjure/defs/validator/SafetyValidator.java | https://github.com/palantir/conjure/blob/master/conjure-core/src/main/java/com/palantir/conjure/defs/validator/SafetyValidator.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.