diff --git a/conjure-java-core/src/main/java/com/palantir/conjure/java/services/JerseyServiceGenerator.java b/conjure-java-core/src/main/java/com/palantir/conjure/java/services/JerseyServiceGenerator.java index 0cf9a5e3e..4345cabad 100644 --- a/conjure-java-core/src/main/java/com/palantir/conjure/java/services/JerseyServiceGenerator.java +++ b/conjure-java-core/src/main/java/com/palantir/conjure/java/services/JerseyServiceGenerator.java @@ -23,8 +23,7 @@ import com.google.common.collect.Lists; import com.palantir.conjure.java.ConjureAnnotations; import com.palantir.conjure.java.FeatureFlags; -import com.palantir.conjure.java.types.JerseyMethodTypeClassNameVisitor; -import com.palantir.conjure.java.types.JerseyReturnTypeClassNameVisitor; +import com.palantir.conjure.java.types.BinaryResolvingClassNameVisitor; import com.palantir.conjure.java.types.TypeMapper; import com.palantir.conjure.spec.ArgumentDefinition; import com.palantir.conjure.spec.AuthType; @@ -53,6 +52,7 @@ import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.ParameterSpec; import com.squareup.javapoet.TypeSpec; +import java.io.InputStream; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -65,9 +65,12 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import javax.lang.model.element.Modifier; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.StreamingOutput; import org.apache.commons.lang3.StringUtils; public final class JerseyServiceGenerator implements ServiceGenerator { + private static final ClassName NOT_NULL = ClassName.get("javax.validation.constraints", "NotNull"); private final Set experimentalFeatures; @@ -82,11 +85,15 @@ public JerseyServiceGenerator(Set experimentalFeatures) { @Override public Set generate(ConjureDefinition conjureDefinition) { + Class binaryReturnType = experimentalFeatures.contains(FeatureFlags.JerseyBinaryAsResponse) + ? Response.class + : StreamingOutput.class; TypeMapper returnTypeMapper = new TypeMapper( conjureDefinition.getTypes(), - types -> new JerseyReturnTypeClassNameVisitor(types, experimentalFeatures)); + BinaryResolvingClassNameVisitor.createFactory(binaryReturnType)); TypeMapper methodTypeMapper = new TypeMapper( - conjureDefinition.getTypes(), JerseyMethodTypeClassNameVisitor::new); + conjureDefinition.getTypes(), + BinaryResolvingClassNameVisitor.createFactory(InputStream.class)); return conjureDefinition.getServices().stream() .map(serviceDef -> generateService(serviceDef, returnTypeMapper, methodTypeMapper)) .collect(Collectors.toSet()); diff --git a/conjure-java-core/src/main/java/com/palantir/conjure/java/services/Retrofit2ServiceGenerator.java b/conjure-java-core/src/main/java/com/palantir/conjure/java/services/Retrofit2ServiceGenerator.java index f9893ad4d..f78a63d1c 100644 --- a/conjure-java-core/src/main/java/com/palantir/conjure/java/services/Retrofit2ServiceGenerator.java +++ b/conjure-java-core/src/main/java/com/palantir/conjure/java/services/Retrofit2ServiceGenerator.java @@ -23,8 +23,7 @@ import com.google.common.collect.Lists; import com.palantir.conjure.java.ConjureAnnotations; import com.palantir.conjure.java.FeatureFlags; -import com.palantir.conjure.java.types.Retrofit2MethodTypeClassNameVisitor; -import com.palantir.conjure.java.types.Retrofit2ReturnTypeClassNameVisitor; +import com.palantir.conjure.java.types.BinaryResolvingClassNameVisitor; import com.palantir.conjure.java.types.TypeMapper; import com.palantir.conjure.spec.ArgumentDefinition; import com.palantir.conjure.spec.ArgumentName; @@ -69,6 +68,7 @@ public final class Retrofit2ServiceGenerator implements ServiceGenerator { private static final ClassName CALL_TYPE = ClassName.get("retrofit2", "Call"); private static final String AUTH_HEADER_NAME = "Authorization"; + private static final ClassName BINARY_METHOD_TYPE = ClassName.get("okhttp3", "RequestBody"); private static final ClassName BINARY_RETURN_TYPE = ClassName.get("okhttp3", "ResponseBody"); private static final Logger log = LoggerFactory.getLogger(Retrofit2ServiceGenerator.class); @@ -85,10 +85,12 @@ public Retrofit2ServiceGenerator(Set experimentalFeatures) { @Override public Set generate(ConjureDefinition conjureDefinition) { - TypeMapper returnTypeMapper = - new TypeMapper(conjureDefinition.getTypes(), Retrofit2ReturnTypeClassNameVisitor::new); - TypeMapper methodTypeMapper = - new TypeMapper(conjureDefinition.getTypes(), Retrofit2MethodTypeClassNameVisitor::new); + TypeMapper returnTypeMapper = new TypeMapper( + conjureDefinition.getTypes(), + BinaryResolvingClassNameVisitor.createFactory(BINARY_RETURN_TYPE)); + TypeMapper methodTypeMapper = new TypeMapper( + conjureDefinition.getTypes(), + BinaryResolvingClassNameVisitor.createFactory(BINARY_METHOD_TYPE)); return conjureDefinition.getServices().stream() .map(serviceDef -> generateService(serviceDef, returnTypeMapper, methodTypeMapper)) .collect(Collectors.toSet()); diff --git a/conjure-java-core/src/main/java/com/palantir/conjure/java/types/Retrofit2ReturnTypeClassNameVisitor.java b/conjure-java-core/src/main/java/com/palantir/conjure/java/types/BinaryResolvingClassNameVisitor.java similarity index 63% rename from conjure-java-core/src/main/java/com/palantir/conjure/java/types/Retrofit2ReturnTypeClassNameVisitor.java rename to conjure-java-core/src/main/java/com/palantir/conjure/java/types/BinaryResolvingClassNameVisitor.java index 27276d05d..4929db269 100644 --- a/conjure-java-core/src/main/java/com/palantir/conjure/java/types/Retrofit2ReturnTypeClassNameVisitor.java +++ b/conjure-java-core/src/main/java/com/palantir/conjure/java/types/BinaryResolvingClassNameVisitor.java @@ -16,13 +16,13 @@ package com.palantir.conjure.java.types; -import com.palantir.conjure.java.util.BinaryReturnTypeResolver; import com.palantir.conjure.spec.ExternalReference; import com.palantir.conjure.spec.ListType; import com.palantir.conjure.spec.MapType; import com.palantir.conjure.spec.OptionalType; import com.palantir.conjure.spec.PrimitiveType; import com.palantir.conjure.spec.SetType; +import com.palantir.conjure.spec.Type; import com.palantir.conjure.spec.TypeDefinition; import com.palantir.conjure.visitor.TypeDefinitionVisitor; import com.squareup.javapoet.ClassName; @@ -32,17 +32,26 @@ import java.util.function.Function; import java.util.stream.Collectors; -public final class Retrofit2ReturnTypeClassNameVisitor implements ClassNameVisitor { - - private static final ClassName RESPONSE_BODY_TYPE = ClassName.get("okhttp3", "ResponseBody"); +public final class BinaryResolvingClassNameVisitor implements ClassNameVisitor { private final DefaultClassNameVisitor delegate; private final Map types; + private final ClassName binaryClassName; + + public static Factory createFactory(Class binaryClass) { + return createFactory(ClassName.get(binaryClass)); + } + + public static Factory createFactory(ClassName binaryClassName) { + return types -> new BinaryResolvingClassNameVisitor(types, binaryClassName); + } - public Retrofit2ReturnTypeClassNameVisitor(List types) { - this.types = types.stream().collect( - Collectors.toMap(t -> t.accept(TypeDefinitionVisitor.TYPE_NAME), Function.identity())); + private BinaryResolvingClassNameVisitor(List types, ClassName binaryClassName) { this.delegate = new DefaultClassNameVisitor(types); + this.types = types.stream().collect(Collectors.toMap( + t -> t.accept(TypeDefinitionVisitor.TYPE_NAME), + Function.identity())); + this.binaryClassName = binaryClassName; } @Override @@ -63,7 +72,7 @@ public TypeName visitOptional(OptionalType type) { @Override public TypeName visitPrimitive(PrimitiveType type) { if (type.get() == PrimitiveType.Value.BINARY) { - return RESPONSE_BODY_TYPE; + return binaryClassName; } else { return delegate.visitPrimitive(type); } @@ -71,7 +80,20 @@ public TypeName visitPrimitive(PrimitiveType type) { @Override public TypeName visitReference(com.palantir.conjure.spec.TypeName type) { - return BinaryReturnTypeResolver.resolveReturnReferenceType(types, type, RESPONSE_BODY_TYPE); + if (!types.containsKey(type)) { + throw new IllegalStateException("Unknown LocalReferenceType type: " + type); + } + + TypeDefinition def = types.get(type); + if (def.accept(TypeDefinitionVisitor.IS_ALIAS)) { + Type aliasType = def.accept(TypeDefinitionVisitor.ALIAS).getAlias(); + TypeName aliasClassName = aliasType.accept(this); + if (aliasClassName.equals(binaryClassName)) { + return binaryClassName; + } + } + + return delegate.visitReference(type); } @Override @@ -83,5 +105,4 @@ public TypeName visitExternal(ExternalReference type) { public TypeName visitSet(SetType type) { return delegate.visitSet(type); } - } diff --git a/conjure-java-core/src/main/java/com/palantir/conjure/java/types/JerseyMethodTypeClassNameVisitor.java b/conjure-java-core/src/main/java/com/palantir/conjure/java/types/JerseyMethodTypeClassNameVisitor.java deleted file mode 100644 index a033805ae..000000000 --- a/conjure-java-core/src/main/java/com/palantir/conjure/java/types/JerseyMethodTypeClassNameVisitor.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.palantir.conjure.java.types; - -import com.palantir.conjure.spec.ExternalReference; -import com.palantir.conjure.spec.ListType; -import com.palantir.conjure.spec.MapType; -import com.palantir.conjure.spec.OptionalType; -import com.palantir.conjure.spec.PrimitiveType; -import com.palantir.conjure.spec.SetType; -import com.palantir.conjure.spec.TypeDefinition; -import com.squareup.javapoet.ClassName; -import com.squareup.javapoet.TypeName; -import java.io.InputStream; -import java.util.List; - -public final class JerseyMethodTypeClassNameVisitor implements ClassNameVisitor { - - private final DefaultClassNameVisitor delegate; - - public JerseyMethodTypeClassNameVisitor(List types) { - this.delegate = new DefaultClassNameVisitor(types); - } - - @Override - public TypeName visitList(ListType type) { - return delegate.visitList(type); - } - - @Override - public TypeName visitMap(MapType type) { - return delegate.visitMap(type); - } - - @Override - public TypeName visitOptional(OptionalType type) { - return delegate.visitOptional(type); - } - - @Override - public TypeName visitPrimitive(PrimitiveType type) { - if (type.get() == PrimitiveType.Value.BINARY) { - return ClassName.get(InputStream.class); - } else { - return delegate.visitPrimitive(type); - } - } - - @Override - public TypeName visitReference(com.palantir.conjure.spec.TypeName type) { - return delegate.visitReference(type); - } - - @Override - public TypeName visitExternal(ExternalReference type) { - return delegate.visitExternal(type); - } - - @Override - public TypeName visitSet(SetType type) { - return delegate.visitSet(type); - } -} diff --git a/conjure-java-core/src/main/java/com/palantir/conjure/java/types/JerseyReturnTypeClassNameVisitor.java b/conjure-java-core/src/main/java/com/palantir/conjure/java/types/JerseyReturnTypeClassNameVisitor.java deleted file mode 100644 index 6088f20e2..000000000 --- a/conjure-java-core/src/main/java/com/palantir/conjure/java/types/JerseyReturnTypeClassNameVisitor.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.palantir.conjure.java.types; - -import com.palantir.conjure.java.FeatureFlags; -import com.palantir.conjure.java.util.BinaryReturnTypeResolver; -import com.palantir.conjure.spec.ExternalReference; -import com.palantir.conjure.spec.ListType; -import com.palantir.conjure.spec.MapType; -import com.palantir.conjure.spec.OptionalType; -import com.palantir.conjure.spec.PrimitiveType; -import com.palantir.conjure.spec.SetType; -import com.palantir.conjure.spec.TypeDefinition; -import com.palantir.conjure.visitor.TypeDefinitionVisitor; -import com.squareup.javapoet.ClassName; -import com.squareup.javapoet.TypeName; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.StreamingOutput; - -public final class JerseyReturnTypeClassNameVisitor implements ClassNameVisitor { - - private final boolean binaryAsResponse; - private final DefaultClassNameVisitor delegate; - private final Map types; - - public JerseyReturnTypeClassNameVisitor(List types, Set featureFlags) { - this.types = types.stream().collect( - Collectors.toMap(t -> t.accept(TypeDefinitionVisitor.TYPE_NAME), Function.identity())); - this.delegate = new DefaultClassNameVisitor(types); - this.binaryAsResponse = featureFlags.contains(FeatureFlags.JerseyBinaryAsResponse); - } - - @Override - public TypeName visitList(ListType type) { - return delegate.visitList(type); - } - - @Override - public TypeName visitMap(MapType type) { - return delegate.visitMap(type); - } - - @Override - public TypeName visitOptional(OptionalType type) { - return delegate.visitOptional(type); - } - - @Override - public TypeName visitPrimitive(PrimitiveType type) { - if (type.get() == PrimitiveType.Value.BINARY) { - if (binaryAsResponse) { - return ClassName.get(Response.class); - } else { - return ClassName.get(StreamingOutput.class); - } - } - return delegate.visitPrimitive(type); - } - - @Override - public TypeName visitReference(com.palantir.conjure.spec.TypeName type) { - return BinaryReturnTypeResolver.resolveReturnReferenceType(types, type, - binaryAsResponse ? ClassName.get(Response.class) : ClassName.get(StreamingOutput.class)); - } - - @Override - public TypeName visitExternal(ExternalReference type) { - return delegate.visitExternal(type); - } - - @Override - public TypeName visitSet(SetType type) { - return delegate.visitSet(type); - } - -} diff --git a/conjure-java-core/src/main/java/com/palantir/conjure/java/types/Retrofit2MethodTypeClassNameVisitor.java b/conjure-java-core/src/main/java/com/palantir/conjure/java/types/Retrofit2MethodTypeClassNameVisitor.java deleted file mode 100644 index 256eedc48..000000000 --- a/conjure-java-core/src/main/java/com/palantir/conjure/java/types/Retrofit2MethodTypeClassNameVisitor.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.palantir.conjure.java.types; - -import com.palantir.conjure.spec.ExternalReference; -import com.palantir.conjure.spec.ListType; -import com.palantir.conjure.spec.MapType; -import com.palantir.conjure.spec.OptionalType; -import com.palantir.conjure.spec.PrimitiveType; -import com.palantir.conjure.spec.SetType; -import com.palantir.conjure.spec.TypeDefinition; -import com.squareup.javapoet.ClassName; -import com.squareup.javapoet.TypeName; -import java.util.List; - -public final class Retrofit2MethodTypeClassNameVisitor implements ClassNameVisitor { - - private static final ClassName REQUEST_BODY_TYPE = ClassName.get("okhttp3", "RequestBody"); - - private final DefaultClassNameVisitor delegate; - - public Retrofit2MethodTypeClassNameVisitor(List types) { - this.delegate = new DefaultClassNameVisitor(types); - } - - @Override - public TypeName visitList(ListType type) { - return delegate.visitList(type); - } - - @Override - public TypeName visitMap(MapType type) { - return delegate.visitMap(type); - } - - @Override - public TypeName visitOptional(OptionalType type) { - return delegate.visitOptional(type); - } - - @Override - public TypeName visitPrimitive(PrimitiveType type) { - if (type.get() == PrimitiveType.Value.BINARY) { - return REQUEST_BODY_TYPE; - } else { - return delegate.visitPrimitive(type); - } - } - - @Override - public TypeName visitReference(com.palantir.conjure.spec.TypeName type) { - return delegate.visitReference(type); - } - - @Override - public TypeName visitExternal(ExternalReference type) { - return delegate.visitExternal(type); - } - - @Override - public TypeName visitSet(SetType type) { - return delegate.visitSet(type); - } - -} diff --git a/conjure-java-core/src/main/java/com/palantir/conjure/java/types/TypeMapper.java b/conjure-java-core/src/main/java/com/palantir/conjure/java/types/TypeMapper.java index 5f850bd48..10aa8ae27 100644 --- a/conjure-java-core/src/main/java/com/palantir/conjure/java/types/TypeMapper.java +++ b/conjure-java-core/src/main/java/com/palantir/conjure/java/types/TypeMapper.java @@ -37,8 +37,7 @@ public TypeMapper(List types) { this(types, DefaultClassNameVisitor::new); } - public TypeMapper(List types, - Factory classNameVisitorFactory) { + public TypeMapper(List types, Factory classNameVisitorFactory) { this.types = types.stream().collect( Collectors.toMap(t -> t.accept(TypeDefinitionVisitor.TYPE_NAME), Function.identity())); this.classNameVisitorFactory = classNameVisitorFactory; diff --git a/conjure-java-core/src/main/java/com/palantir/conjure/java/util/BinaryReturnTypeResolver.java b/conjure-java-core/src/main/java/com/palantir/conjure/java/util/BinaryReturnTypeResolver.java deleted file mode 100644 index f79f0ae33..000000000 --- a/conjure-java-core/src/main/java/com/palantir/conjure/java/util/BinaryReturnTypeResolver.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.palantir.conjure.java.util; - -import com.palantir.conjure.spec.AliasDefinition; -import com.palantir.conjure.spec.Type; -import com.palantir.conjure.spec.TypeDefinition; -import com.palantir.conjure.visitor.TypeDefinitionVisitor; -import com.palantir.conjure.visitor.TypeVisitor; -import com.squareup.javapoet.ClassName; -import com.squareup.javapoet.TypeName; -import java.util.Map; - -public final class BinaryReturnTypeResolver { - - private BinaryReturnTypeResolver() {} - - /** - * Recursively examines nested local alias references to see if the leaf node is of a binary type. If so, - * this method resolves it to a binary type supplied by the {@code binaryTypeName}, otherwise it returns the - * immediate local reference {@code {@link TypeName}}. - * - * @param types - a map of name to conjure definition - * @param type - the given type to be resolved - * @param binaryTypeName - the return binary type name if the leaf node is of a binary type - * @return resolved return reference type - */ - public static TypeName resolveReturnReferenceType( - Map types, - com.palantir.conjure.spec.TypeName type, - TypeName binaryTypeName) { - - if (!types.containsKey(type)) { - throw new IllegalStateException("Unknown LocalReferenceType type: " + type); - } - - TypeDefinition def = types.get(type); - while (def.accept(TypeDefinitionVisitor.IS_ALIAS)) { - AliasDefinition aliasDefinition = def.accept(TypeDefinitionVisitor.ALIAS); - Type conjureType = aliasDefinition.getAlias(); - if (conjureType.accept(TypeVisitor.IS_REFERENCE)) { - def = types.get(conjureType.accept(TypeVisitor.REFERENCE)); - } else if (conjureType.accept(TypeVisitor.IS_BINARY)) { - return binaryTypeName; - } else { - break; - } - } - - return ClassName.get(type.getPackage(), type.getName()); - } -} diff --git a/conjure-java-core/src/test/resources/test/api/TestService.java.jersey b/conjure-java-core/src/test/resources/test/api/TestService.java.jersey index d21fbd453..f3d7a0e42 100644 --- a/conjure-java-core/src/test/resources/test/api/TestService.java.jersey +++ b/conjure-java-core/src/test/resources/test/api/TestService.java.jersey @@ -2,7 +2,6 @@ package com.palantir.another; import com.palantir.product.AliasedString; import com.palantir.product.CreateDatasetRequest; -import com.palantir.product.NestedAliasedBinary; import com.palantir.product.datasets.BackingFileSystem; import com.palantir.product.datasets.Dataset; import com.palantir.redaction.Safe; @@ -92,7 +91,7 @@ public interface TestService { @Path("catalog/datasets/upload-raw-aliased") void uploadAliasedRawData( @HeaderParam("Authorization") @NotNull AuthHeader authHeader, - @NotNull NestedAliasedBinary input); + @NotNull InputStream input); @GET @Path("catalog/datasets/{datasetRid}/branches") diff --git a/conjure-java-core/src/test/resources/test/api/TestService.java.jersey_require_not_null b/conjure-java-core/src/test/resources/test/api/TestService.java.jersey_require_not_null index d21fbd453..f3d7a0e42 100644 --- a/conjure-java-core/src/test/resources/test/api/TestService.java.jersey_require_not_null +++ b/conjure-java-core/src/test/resources/test/api/TestService.java.jersey_require_not_null @@ -2,7 +2,6 @@ package com.palantir.another; import com.palantir.product.AliasedString; import com.palantir.product.CreateDatasetRequest; -import com.palantir.product.NestedAliasedBinary; import com.palantir.product.datasets.BackingFileSystem; import com.palantir.product.datasets.Dataset; import com.palantir.redaction.Safe; @@ -92,7 +91,7 @@ public interface TestService { @Path("catalog/datasets/upload-raw-aliased") void uploadAliasedRawData( @HeaderParam("Authorization") @NotNull AuthHeader authHeader, - @NotNull NestedAliasedBinary input); + @NotNull InputStream input); @GET @Path("catalog/datasets/{datasetRid}/branches") diff --git a/conjure-java-core/src/test/resources/test/api/TestServiceRetrofit.java.retrofit b/conjure-java-core/src/test/resources/test/api/TestServiceRetrofit.java.retrofit index ddc07038a..9df8b5694 100644 --- a/conjure-java-core/src/test/resources/test/api/TestServiceRetrofit.java.retrofit +++ b/conjure-java-core/src/test/resources/test/api/TestServiceRetrofit.java.retrofit @@ -2,7 +2,6 @@ package com.palantir.another; import com.palantir.product.AliasedString; import com.palantir.product.CreateDatasetRequest; -import com.palantir.product.NestedAliasedBinary; import com.palantir.product.datasets.BackingFileSystem; import com.palantir.product.datasets.Dataset; import com.palantir.ri.ResourceIdentifier; @@ -100,7 +99,7 @@ public interface TestServiceRetrofit { @POST("./catalog/datasets/upload-raw-aliased") @Headers({"hr-path-template: /catalog/datasets/upload-raw-aliased", "Accept: application/json"}) Call uploadAliasedRawData( - @Header("Authorization") AuthHeader authHeader, @Body NestedAliasedBinary input); + @Header("Authorization") AuthHeader authHeader, @Body RequestBody input); @GET("./catalog/datasets/{datasetRid}/branches") @Headers({ diff --git a/conjure-java-core/src/test/resources/test/api/TestServiceRetrofit.java.retrofit_completable_future b/conjure-java-core/src/test/resources/test/api/TestServiceRetrofit.java.retrofit_completable_future index 559c0723d..fff62b99e 100644 --- a/conjure-java-core/src/test/resources/test/api/TestServiceRetrofit.java.retrofit_completable_future +++ b/conjure-java-core/src/test/resources/test/api/TestServiceRetrofit.java.retrofit_completable_future @@ -2,7 +2,6 @@ package com.palantir.another; import com.palantir.product.AliasedString; import com.palantir.product.CreateDatasetRequest; -import com.palantir.product.NestedAliasedBinary; import com.palantir.product.datasets.BackingFileSystem; import com.palantir.product.datasets.Dataset; import com.palantir.ri.ResourceIdentifier; @@ -100,7 +99,7 @@ public interface TestServiceRetrofit { @POST("./catalog/datasets/upload-raw-aliased") @Headers({"hr-path-template: /catalog/datasets/upload-raw-aliased", "Accept: application/json"}) CompletableFuture uploadAliasedRawData( - @Header("Authorization") AuthHeader authHeader, @Body NestedAliasedBinary input); + @Header("Authorization") AuthHeader authHeader, @Body RequestBody input); @GET("./catalog/datasets/{datasetRid}/branches") @Headers({ diff --git a/conjure-java-core/src/test/resources/test/api/TestServiceRetrofit.java.retrofit_listenable_future b/conjure-java-core/src/test/resources/test/api/TestServiceRetrofit.java.retrofit_listenable_future index 98393fb4f..afcd716c3 100644 --- a/conjure-java-core/src/test/resources/test/api/TestServiceRetrofit.java.retrofit_listenable_future +++ b/conjure-java-core/src/test/resources/test/api/TestServiceRetrofit.java.retrofit_listenable_future @@ -3,7 +3,6 @@ package com.palantir.another; import com.google.common.util.concurrent.ListenableFuture; import com.palantir.product.AliasedString; import com.palantir.product.CreateDatasetRequest; -import com.palantir.product.NestedAliasedBinary; import com.palantir.product.datasets.BackingFileSystem; import com.palantir.product.datasets.Dataset; import com.palantir.ri.ResourceIdentifier; @@ -100,7 +99,7 @@ public interface TestServiceRetrofit { @POST("./catalog/datasets/upload-raw-aliased") @Headers({"hr-path-template: /catalog/datasets/upload-raw-aliased", "Accept: application/json"}) ListenableFuture uploadAliasedRawData( - @Header("Authorization") AuthHeader authHeader, @Body NestedAliasedBinary input); + @Header("Authorization") AuthHeader authHeader, @Body RequestBody input); @GET("./catalog/datasets/{datasetRid}/branches") @Headers({