params) {
+ super(params);
+ }
+
+ public PIPESParams(String... params) {
+ super(params);
+ }
+
+ @Override
+ public String toString() {
+ return StringUtil.join(params.toArray(new String[0]), "|");
+ }
+ }
+
+}
diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/StringUtil.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/StringUtil.java
new file mode 100644
index 00000000000..ab160d65a19
--- /dev/null
+++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/StringUtil.java
@@ -0,0 +1,42 @@
+package io.swagger.client;
+
+@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-01-21T16:52:39.577+01:00")
+public class StringUtil {
+ /**
+ * Check if the given array contains the given value (with case-insensitive comparison).
+ *
+ * @param array The array
+ * @param value The value to search
+ * @return true if the array contains the value
+ */
+ public static boolean containsIgnoreCase(String[] array, String value) {
+ for (String str : array) {
+ if (value == null && str == null) return true;
+ if (value != null && value.equalsIgnoreCase(str)) return true;
+ }
+ return false;
+ }
+
+ /**
+ * Join an array of strings with the given separator.
+ *
+ * Note: This might be replaced by utility method from commons-lang or guava someday
+ * if one of those libraries is added as dependency.
+ *
+ *
+ * @param array The array of strings
+ * @param separator The separator
+ * @return the resulting string
+ */
+ public static String join(String[] array, String separator) {
+ int len = array.length;
+ if (len == 0) return "";
+
+ StringBuilder out = new StringBuilder();
+ out.append(array[0]);
+ for (int i = 1; i < len; i++) {
+ out.append(separator).append(array[i]);
+ }
+ return out.toString();
+ }
+}
diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java
new file mode 100644
index 00000000000..7caa426e18d
--- /dev/null
+++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java
@@ -0,0 +1,155 @@
+package io.swagger.client.api;
+
+import io.swagger.client.CollectionFormats.*;
+
+import rx.Observable;
+
+import retrofit.http.*;
+
+import com.squareup.okhttp.RequestBody;
+
+import io.swagger.client.model.Pet;
+import java.io.File;
+
+import java.util.*;
+
+public interface PetApi {
+
+ /**
+ * Update an existing pet
+ *
+ * @param body Pet object that needs to be added to the store
+ * @return Call
+ */
+
+ @PUT("pet")
+ Observable updatePet(
+ @Body Pet body
+ );
+
+
+ /**
+ * Add a new pet to the store
+ *
+ * @param body Pet object that needs to be added to the store
+ * @return Call
+ */
+
+ @POST("pet")
+ Observable addPet(
+ @Body Pet body
+ );
+
+
+ /**
+ * Finds Pets by status
+ * Multiple status values can be provided with comma seperated strings
+ * @param status Status values that need to be considered for filter
+ * @return Call>
+ */
+
+ @GET("pet/findByStatus")
+ Observable> findPetsByStatus(
+ @Query("status") List status
+ );
+
+
+ /**
+ * Finds Pets by tags
+ * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
+ * @param tags Tags to filter by
+ * @return Call>
+ */
+
+ @GET("pet/findByTags")
+ Observable> findPetsByTags(
+ @Query("tags") List tags
+ );
+
+
+ /**
+ * Find pet by ID
+ * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
+ * @param petId ID of pet that needs to be fetched
+ * @return Call
+ */
+
+ @GET("pet/{petId}")
+ Observable getPetById(
+ @Path("petId") Long petId
+ );
+
+
+ /**
+ * Updates a pet in the store with form data
+ *
+ * @param petId ID of pet that needs to be updated
+ * @param name Updated name of the pet
+ * @param status Updated status of the pet
+ * @return Call
+ */
+
+ @FormUrlEncoded
+ @POST("pet/{petId}")
+ Observable updatePetWithForm(
+ @Path("petId") String petId, @Field("name") String name, @Field("status") String status
+ );
+
+
+ /**
+ * Deletes a pet
+ *
+ * @param petId Pet id to delete
+ * @param apiKey
+ * @return Call
+ */
+
+ @DELETE("pet/{petId}")
+ Observable deletePet(
+ @Path("petId") Long petId, @Header("api_key") String apiKey
+ );
+
+
+ /**
+ * uploads an image
+ *
+ * @param petId ID of pet to update
+ * @param additionalMetadata Additional data to pass to server
+ * @param file file to upload
+ * @return Call
+ */
+
+ @Multipart
+ @POST("pet/{petId}/uploadImage")
+ Observable uploadFile(
+ @Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file\"; filename=\"file\"") RequestBody file
+ );
+
+
+ /**
+ * Fake endpoint to test byte array return by 'Find pet by ID'
+ * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
+ * @param petId ID of pet that needs to be fetched
+ * @return Call
+ */
+
+ @GET("pet/{petId}?testing_byte_array=true")
+ Observable getPetByIdWithByteArray(
+ @Path("petId") Long petId
+ );
+
+
+ /**
+ * Fake endpoint to test byte array in body parameter for adding a new pet to the store
+ *
+ * @param body Pet object in the form of byte array
+ * @return Call
+ */
+
+ @POST("pet?testing_byte_array=true")
+ Observable addPetUsingByteArray(
+ @Body byte[] body
+ );
+
+
+}
diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java
new file mode 100644
index 00000000000..20e4dbb57fa
--- /dev/null
+++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java
@@ -0,0 +1,68 @@
+package io.swagger.client.api;
+
+import io.swagger.client.CollectionFormats.*;
+
+import rx.Observable;
+
+import retrofit.http.*;
+
+import com.squareup.okhttp.RequestBody;
+
+import java.util.Map;
+import io.swagger.client.model.Order;
+
+import java.util.*;
+
+public interface StoreApi {
+
+ /**
+ * Returns pet inventories by status
+ * Returns a map of status codes to quantities
+ * @return Call