From 19f1c7e0955b429f0f986ac10d5e7e8bfc5d813b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dalibor=20Karlovi=C4=87?= Date: Thu, 29 Sep 2016 08:48:24 +0200 Subject: [PATCH 1/9] feature(PHP QA) add initial PHP client template tweaks to improve emitted code quality --- .../src/main/resources/php/ApiClient.mustache | 154 ++++++++++-------- .../main/resources/php/ApiException.mustache | 6 +- .../resources/php/ObjectSerializer.mustache | 6 +- .../src/main/resources/php/api.mustache | 29 ++-- .../src/main/resources/php/api_test.mustache | 7 - .../main/resources/php/configuration.mustache | 35 +++- .../src/main/resources/php/model.mustache | 1 + .../main/resources/php/model_generic.mustache | 6 +- 8 files changed, 138 insertions(+), 106 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache index effdbedb7f84..bbe7d20ad927 100644 --- a/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache @@ -31,13 +31,13 @@ namespace {{invokerPackage}}; */ class ApiClient { - public static $PATCH = "PATCH"; - public static $POST = "POST"; - public static $GET = "GET"; - public static $HEAD = "HEAD"; - public static $OPTIONS = "OPTIONS"; - public static $PUT = "PUT"; - public static $DELETE = "DELETE"; + public static $PATCH = 'PATCH'; + public static $POST = 'POST'; + public static $GET = 'GET'; + public static $HEAD = 'HEAD'; + public static $OPTIONS = 'OPTIONS'; + public static $PUT = 'PUT'; + public static $DELETE = 'DELETE'; /** * Configuration @@ -58,7 +58,7 @@ class ApiClient * * @param Configuration $config config for this ApiClient */ - public function __construct(\{{invokerPackage}}\Configuration $config = null) + public function __construct(Configuration $config = null) { if ($config === null) { $config = Configuration::getDefaultConfiguration(); @@ -91,7 +91,7 @@ class ApiClient /** * Get API key (with prefix if set) * - * @param string $apiKeyIdentifier name of apikey + * @param string $apiKeyIdentifier name of API key * * @return string API key with the prefix */ @@ -100,14 +100,13 @@ class ApiClient $prefix = $this->config->getApiKeyPrefix($apiKeyIdentifier); $apiKey = $this->config->getApiKey($apiKeyIdentifier); - if (!isset($apiKey)) { + if ($apiKey === null) { return null; } - if (isset($prefix)) { - $keyWithPrefix = $prefix." ".$apiKey; - } else { - $keyWithPrefix = $apiKey; + $keyWithPrefix = $apiKey; + if ($prefix !== null) { + $keyWithPrefix = $prefix.' '.$apiKey; } return $keyWithPrefix; @@ -116,19 +115,24 @@ class ApiClient /** * Make the HTTP call (Sync) * - * @param string $resourcePath path to method endpoint - * @param string $method method to call - * @param array $queryParams parameters to be place in query URL - * @param array $postData parameters to be placed in POST body - * @param array $headerParams parameters to be place in request header - * @param string $responseType expected response type of the endpoint - * @param string $endpointPath path to method endpoint before expanding parameters + * @param string $resourcePath path to method endpoint + * @param string $method method to call + * @param array $queryParams parameters to be place in query URL + * @param array|string $postData parameters to be placed in POST body + * @param array $headerParams parameters to be place in request header + * @param string $responseType expected response type of the endpoint * - * @throws \{{invokerPackage}}\ApiException on a non 2xx response + * @throws ApiException on a non 2xx response * @return mixed */ - public function callApi($resourcePath, $method, $queryParams, $postData, $headerParams, $responseType = null, $endpointPath = null) - { + public function callApi( + $resourcePath, + $method, + array $queryParams, + $postData, + array $headerParams, + $responseType = null + ) { $headers = []; // construct the http header @@ -142,10 +146,10 @@ class ApiClient } // form data - if ($postData and in_array('Content-Type: application/x-www-form-urlencoded', $headers, true)) { + if (is_array($postData) && in_array('Content-Type: application/x-www-form-urlencoded', $headers, true)) { $postData = http_build_query($postData); - } elseif ((is_object($postData) or is_array($postData)) and !in_array('Content-Type: multipart/form-data', $headers, true)) { // json model - $postData = json_encode(\{{invokerPackage}}\ObjectSerializer::sanitizeForSerialization($postData)); + } elseif ((is_object($postData) || is_array($postData)) && !in_array('Content-Type: multipart/form-data', $headers, true)) { // json model + $postData = json_encode(ObjectSerializer::sanitizeForSerialization($postData)); } $url = $this->config->getHost() . $resourcePath; @@ -161,12 +165,12 @@ class ApiClient curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); // disable SSL verification, if needed - if ($this->config->getSSLVerification() === false) { + if ($this->config->isSSLVerification() === false) { curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); } - if (!empty($queryParams)) { + if ($queryParams !== null) { $url = ($url . '?' . http_build_query($queryParams)); } @@ -176,16 +180,16 @@ class ApiClient } elseif ($method === self::$HEAD) { curl_setopt($curl, CURLOPT_NOBODY, true); } elseif ($method === self::$OPTIONS) { - curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "OPTIONS"); + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'OPTIONS'); curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); } elseif ($method === self::$PATCH) { - curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH"); + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PATCH'); curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); } elseif ($method === self::$PUT) { - curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT"); + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT'); curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); } elseif ($method === self::$DELETE) { - curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE"); + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'DELETE'); curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); } elseif ($method !== self::$GET) { throw new ApiException('Method ' . $method . ' is not recognized.'); @@ -196,8 +200,12 @@ class ApiClient curl_setopt($curl, CURLOPT_USERAGENT, $this->config->getUserAgent()); // debugging for curl - if ($this->config->getDebug()) { - error_log("[DEBUG] HTTP Request body ~BEGIN~".PHP_EOL.print_r($postData, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile()); + if ($this->config->isDebug()) { + error_log( + '[DEBUG] HTTP Request body ~BEGIN~'.PHP_EOL.print_r($postData, true).PHP_EOL.'~END~'.PHP_EOL, + 3, + $this->config->getDebugFile() + ); curl_setopt($curl, CURLOPT_VERBOSE, 1); curl_setopt($curl, CURLOPT_STDERR, fopen($this->config->getDebugFile(), 'a')); @@ -210,55 +218,59 @@ class ApiClient // Make the request $response = curl_exec($curl); - $http_header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE); - $http_header = $this->httpParseHeaders(substr($response, 0, $http_header_size)); - $http_body = substr($response, $http_header_size); - $response_info = curl_getinfo($curl); + $httpHeaderSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE); + $httpHeader = $this->httpParseHeaders(substr($response, 0, $httpHeaderSize)); + $httpBody = substr($response, $httpHeaderSize); + $responseInfo = curl_getinfo($curl); // debug HTTP response body - if ($this->config->getDebug()) { - error_log("[DEBUG] HTTP Response body ~BEGIN~".PHP_EOL.print_r($http_body, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile()); + if ($this->config->isDebug()) { + error_log( + '[DEBUG] HTTP Response body ~BEGIN~'.PHP_EOL.print_r($httpBody, true).PHP_EOL.'~END~'.PHP_EOL, + 3, + $this->config->getDebugFile() + ); } // Handle the response - if ($response_info['http_code'] === 0) { - $curl_error_message = curl_error($curl); + if ($responseInfo['http_code'] === 0) { + $curlErrorMessage = curl_error($curl); // curl_exec can sometimes fail but still return a blank message from curl_error(). - if (!empty($curl_error_message)) { - $error_message = "API call to $url failed: $curl_error_message"; + if ($curlErrorMessage !== '') { + $errorMessage = 'API call to '.$url.' failed: '.$curlErrorMessage; } else { - $error_message = "API call to $url failed, but for an unknown reason. " . - "This could happen if you are disconnected from the network."; + $errorMessage = 'API call to '.$url.' failed, but for an unknown reason. ' . + 'This could happen if you are disconnected from the network.'; } - $exception = new ApiException($error_message, 0, null, null); - $exception->setResponseObject($response_info); + $exception = new ApiException($errorMessage, 0, null, null); + $exception->setResponseObject($responseInfo); throw $exception; - } elseif ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299) { + } elseif ($responseInfo['http_code'] >= 200 && $responseInfo['http_code'] <= 299) { // return raw body if response is a file if ($responseType === '\SplFileObject' || $responseType === 'string') { - return [$http_body, $response_info['http_code'], $http_header]; + return [$httpBody, $responseInfo['http_code'], $httpHeader]; } - $data = json_decode($http_body); + $data = json_decode($httpBody); if (json_last_error() > 0) { // if response is a string - $data = $http_body; + $data = $httpBody; } } else { - $data = json_decode($http_body); + $data = json_decode($httpBody); if (json_last_error() > 0) { // if response is a string - $data = $http_body; + $data = $httpBody; } throw new ApiException( - "[".$response_info['http_code']."] Error connecting to the API ($url)", - $response_info['http_code'], - $http_header, + '['.$responseInfo['http_code'].'] Error connecting to the API ('.$url.')', + $responseInfo['http_code'], + $httpHeader, $data ); } - return [$data, $response_info['http_code'], $http_header]; + return [$data, $responseInfo['http_code'], $httpHeader]; } /** @@ -270,9 +282,9 @@ class ApiClient */ public function selectHeaderAccept($accept) { - if (count($accept) === 0 or (count($accept) === 1 and $accept[0] === '')) { + if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { return null; - } elseif (preg_grep("/application\/json/i", $accept)) { + } elseif (preg_grep('/application\\/json/i', $accept)) { return 'application/json'; } else { return implode(',', $accept); @@ -282,35 +294,35 @@ class ApiClient /** * Return the content type based on an array of content-type provided * - * @param string[] $content_type Array fo content-type + * @param string[] $contentType Array for Content-type * * @return string Content-Type (e.g. application/json) */ - public function selectHeaderContentType($content_type) + public function selectHeaderContentType($contentType) { - if (count($content_type) === 0 or (count($content_type) === 1 and $content_type[0] === '')) { + if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { return 'application/json'; - } elseif (preg_grep("/application\/json/i", $content_type)) { + } elseif (preg_grep('/application\\/json/i', $contentType)) { return 'application/json'; } else { - return implode(',', $content_type); + return implode(',', $contentType); } } /** * Return an array of HTTP response headers * - * @param string $raw_headers A string of raw HTTP response headers + * @param string $rawHeaders A string of raw HTTP response headers * - * @return string[] Array of HTTP response heaers + * @return string[] Array of HTTP response headers */ - protected function httpParseHeaders($raw_headers) + protected function httpParseHeaders($rawHeaders) { // ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986 $headers = []; $key = ''; - foreach (explode("\n", $raw_headers) as $h) { + foreach (explode("\n", $rawHeaders) as $h) { $h = explode(':', $h, 2); if (isset($h[1])) { @@ -324,7 +336,7 @@ class ApiClient $key = $h[0]; } else { - if (substr($h[0], 0, 1) === "\t") { + if (strpos($h[0], "\t") === 0) { $headers[$key] .= "\r\n\t".trim($h[0]); } elseif (!$key) { $headers[0] = trim($h[0]); diff --git a/modules/swagger-codegen/src/main/resources/php/ApiException.mustache b/modules/swagger-codegen/src/main/resources/php/ApiException.mustache index f99a793fbc6a..2ec9079d555d 100644 --- a/modules/swagger-codegen/src/main/resources/php/ApiException.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ApiException.mustache @@ -62,7 +62,7 @@ class ApiException extends Exception * @param string $responseHeaders HTTP response header * @param mixed $responseBody HTTP body of the server response either as Json or string */ - public function __construct($message = "", $code = 0, $responseHeaders = null, $responseBody = null) + public function __construct($message = '', $code = 0, $responseHeaders = null, $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; @@ -90,7 +90,7 @@ class ApiException extends Exception } /** - * Sets the deseralized response object (during deserialization) + * Sets the deserialized response object (during deserialization) * * @param mixed $obj Deserialized response object * @@ -102,7 +102,7 @@ class ApiException extends Exception } /** - * Gets the deseralized response object (during deserialization) + * Gets the deserialized response object (during deserialization) * * @return mixed the deserialized response object */ diff --git a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache index 7208e4c77845..5495b4f46112 100644 --- a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache @@ -213,7 +213,7 @@ class ObjectSerializer } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] $inner = substr($class, 4, -1); $deserialized = []; - if (strrpos($inner, ",") !== false) { + if (strrpos($inner, ',') !== false) { $subClass_array = explode(',', $inner, 2); $subClass = $subClass_array[1]; foreach ($data as $key => $value) { @@ -254,9 +254,9 @@ class ObjectSerializer } else { $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); } - $deserialized = new \SplFileObject($filename, "w"); + $deserialized = new \SplFileObject($filename, 'w'); $byte_written = $deserialized->fwrite($data); - if (Configuration::getDefaultConfiguration()->getDebug()) { + if (Configuration::getDefaultConfiguration()->isDebug()) { error_log("[DEBUG] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.".PHP_EOL, 3, Configuration::getDefaultConfiguration()->getDebugFile()); } diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index 26583a6f3d16..ef0139e23fe1 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -21,8 +21,6 @@ namespace {{apiPackage}}; use \{{invokerPackage}}\ApiClient; use \{{invokerPackage}}\ApiException; -use \{{invokerPackage}}\Configuration; -use \{{invokerPackage}}\ObjectSerializer; /** * {{classname}} Class Doc Comment @@ -38,29 +36,28 @@ use \{{invokerPackage}}\ObjectSerializer; /** * API Client * - * @var \{{invokerPackage}}\ApiClient instance of the ApiClient + * @var ApiClient instance of the ApiClient */ protected $apiClient; /** * Constructor * - * @param \{{invokerPackage}}\ApiClient|null $apiClient The api client to use + * @param ApiClient|null $apiClient The API client to use */ - public function __construct(\{{invokerPackage}}\ApiClient $apiClient = null) + public function __construct(ApiClient $apiClient = null) { if ($apiClient === null) { $apiClient = new ApiClient(); $apiClient->getConfig()->setHost('{{basePath}}'); } - - $this->apiClient = $apiClient; + $this->setApiClient($apiClient); } /** * Get API client * - * @return \{{invokerPackage}}\ApiClient get the API client + * @return ApiClient get the API client */ public function getApiClient() { @@ -70,11 +67,11 @@ use \{{invokerPackage}}\ObjectSerializer; /** * Set the API client * - * @param \{{invokerPackage}}\ApiClient $apiClient set the API client + * @param ApiClient $apiClient set the API client * * @return {{classname}} */ - public function setApiClient(\{{invokerPackage}}\ApiClient $apiClient) + public function setApiClient(ApiClient $apiClient) { $this->apiClient = $apiClient; return $this; @@ -115,6 +112,7 @@ use \{{invokerPackage}}\ObjectSerializer; * @param {{dataType}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} * @throws \{{invokerPackage}}\ApiException on non-2xx response + * @throws \InvalidArgumentException * @return array of {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}null{{/returnType}}, HTTP status code, HTTP response headers (array of strings) */ public function {{operationId}}WithHttpInfo({{#allParams}}${{paramName}}{{^required}} = null{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) @@ -166,7 +164,7 @@ use \{{invokerPackage}}\ObjectSerializer; {{/hasValidation}} {{/allParams}} // parse inputs - $resourcePath = "{{path}}"; + $resourcePath = '{{path}}'; $httpBody = ''; $queryParams = []; $headerParams = []; @@ -208,14 +206,14 @@ use \{{invokerPackage}}\ObjectSerializer; {{/collectionFormat}} if (${{paramName}} !== null) { $resourcePath = str_replace( - "{" . "{{baseName}}" . "}", + '{'.'{{baseName}}'.'}', $this->apiClient->getSerializer()->toPathValue(${{paramName}}), $resourcePath ); } {{/pathParams}} // default format to json - $resourcePath = str_replace("{format}", "json", $resourcePath); + $resourcePath = str_replace('{format}', 'json', $resourcePath); {{#formParams}} // form params @@ -277,12 +275,11 @@ use \{{invokerPackage}}\ObjectSerializer; $httpBody, $headerParams, {{#returnType}} - '{{returnType}}', + '{{returnType}}' {{/returnType}} {{^returnType}} - null, + null {{/returnType}} - '{{path}}' ); {{#returnType}} diff --git a/modules/swagger-codegen/src/main/resources/php/api_test.mustache b/modules/swagger-codegen/src/main/resources/php/api_test.mustache index 99ad7065c9b4..c4a549caace8 100644 --- a/modules/swagger-codegen/src/main/resources/php/api_test.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api_test.mustache @@ -19,11 +19,6 @@ namespace {{invokerPackage}}; -use \{{invokerPackage}}\Configuration; -use \{{invokerPackage}}\ApiClient; -use \{{invokerPackage}}\ApiException; -use \{{invokerPackage}}\ObjectSerializer; - /** * {{classname}}Test Class Doc Comment * @@ -35,7 +30,6 @@ use \{{invokerPackage}}\ObjectSerializer; */ {{#operations}}class {{classname}}Test extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test cases */ @@ -73,7 +67,6 @@ use \{{invokerPackage}}\ObjectSerializer; * Test case for {{{operationId}}} * * {{{summary}}}. - * */ public function test{{vendorExtensions.x-testOperationId}}() { diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index bae256b3bd39..94104b781b8a 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -31,7 +31,10 @@ namespace {{invokerPackage}}; */ class Configuration { - private static $defaultConfiguration = null; + /** + * @var Configuration + */ + private static $defaultConfiguration; /** * Associate array to store API key(s) @@ -94,7 +97,7 @@ class Configuration * * @var string */ - protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{#artifactVersion}}{{{.}}}{{/artifactVersion}}{{^artifactVersion}}1.0.0{{/artifactVersion}}/php{{/httpUserAgent}}"; + protected $userAgent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{#artifactVersion}}{{{.}}}{{/artifactVersion}}{{^artifactVersion}}1.0.0{{/artifactVersion}}/php{{/httpUserAgent}}'; /** * Debug switch (default set to false) @@ -261,6 +264,7 @@ class Configuration * @param string $headerName header name (e.g. Token) * @param string $headerValue header value (e.g. 1z8wp3) * + * @throws \InvalidArgumentException * @return Configuration */ public function addDefaultHeader($headerName, $headerValue) @@ -293,6 +297,7 @@ class Configuration public function deleteDefaultHeader($headerName) { unset($this->defaultHeaders[$headerName]); + return $this; } /** @@ -323,6 +328,7 @@ class Configuration * * @param string $userAgent the user agent of the api client * + * @throws \InvalidArgumentException * @return Configuration */ public function setUserAgent($userAgent) @@ -350,6 +356,7 @@ class Configuration * * @param integer $seconds Number of seconds before timing out [set to 0 for no timeout] * + * @throws \InvalidArgumentException * @return Configuration */ public function setCurlTimeout($seconds) @@ -390,6 +397,17 @@ class Configuration * * @return bool */ + public function isDebug() + { + return $this->debug; + } + + /** + * Gets the debug flag + * + * @return bool + * @deprecated + */ public function getDebug() { return $this->debug; @@ -459,6 +477,17 @@ class Configuration * * @return boolean True if the certificate should be validated, false otherwise */ + public function isSSLVerification() + { + return $this->sslVerification; + } + + /** + * Gets if SSL verification should be enabled or disabled + * + * @return boolean True if the certificate should be validated, false otherwise + * @deprecated + */ public function getSSLVerification() { return $this->sslVerification; @@ -479,7 +508,7 @@ class Configuration } /** - * Sets the detault configuration instance + * Sets the default configuration instance * * @param Configuration $config An instance of the Configuration Object * diff --git a/modules/swagger-codegen/src/main/resources/php/model.mustache b/modules/swagger-codegen/src/main/resources/php/model.mustache index efecdf2e5960..04f178091e56 100644 --- a/modules/swagger-codegen/src/main/resources/php/model.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model.mustache @@ -23,6 +23,7 @@ namespace {{modelPackage}}; use \ArrayAccess; +use \{{invokerPackage}}\ObjectSerializer; /** * {{classname}} Class Doc Comment diff --git a/modules/swagger-codegen/src/main/resources/php/model_generic.mustache b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache index 1e221b783775..3937e8d98388 100644 --- a/modules/swagger-codegen/src/main/resources/php/model_generic.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache @@ -183,7 +183,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple * validate all the properties in the model * return true if all passed * - * @return bool True if all properteis are valid + * @return bool True if all properties are valid */ public function valid() { @@ -365,9 +365,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(\{{invokerPackage}}\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); } - return json_encode(\{{invokerPackage}}\ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } \ No newline at end of file From 1006b0ca0af69f59d1b79162b38644986e7a7f8a Mon Sep 17 00:00:00 2001 From: Stas Shakirov Date: Mon, 10 Oct 2016 09:57:28 +0300 Subject: [PATCH 2/9] added package paths for retrofit class names --- .../src/main/resources/Java/libraries/retrofit/api.mustache | 4 ++-- .../resources/Java/libraries/retrofit/bodyParams.mustache | 2 +- .../resources/Java/libraries/retrofit/formParams.mustache | 2 +- .../resources/Java/libraries/retrofit/headerParams.mustache | 2 +- .../resources/Java/libraries/retrofit/pathParams.mustache | 2 +- .../resources/Java/libraries/retrofit/queryParams.mustache | 2 +- .../src/main/resources/Java/libraries/retrofit2/api.mustache | 2 +- .../resources/Java/libraries/retrofit2/bodyParams.mustache | 2 +- .../resources/Java/libraries/retrofit2/formParams.mustache | 2 +- .../resources/Java/libraries/retrofit2/headerParams.mustache | 2 +- .../resources/Java/libraries/retrofit2/pathParams.mustache | 2 +- .../resources/Java/libraries/retrofit2/queryParams.mustache | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/api.mustache index aa84768b47ae..e03801db6c22 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/api.mustache @@ -27,7 +27,7 @@ public interface {{classname}} { {{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} */ {{#formParams}}{{#-first}} - {{#isMultipart}}@Multipart{{/isMultipart}}{{^isMultipart}}@FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} + {{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} @{{httpMethod}}("{{path}}") {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}} {{operationId}}({{^allParams}});{{/allParams}} {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}} @@ -41,7 +41,7 @@ public interface {{classname}} { * @return void */ {{#formParams}}{{#-first}} - {{#isMultipart}}@Multipart{{/isMultipart}}{{^isMultipart}}@FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} + {{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} @{{httpMethod}}("{{path}}") void {{operationId}}( {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}, {{/allParams}}Callback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> cb diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/bodyParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/bodyParams.mustache index f8788583db5c..ed55732b053b 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/bodyParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}@Body {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}@retrofit.http.Body {{{dataType}}} {{paramName}}{{/isBodyParam}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/formParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/formParams.mustache index be9a3ca9b26a..aa92e88e7203 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{#notFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field{{/isMultipart}}("{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field{{/isMultipart}}("{{baseName}}") TypedFile {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}{{#isMultipart}}@retrofit.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit.http.Field{{/isMultipart}}("{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}{{#isMultipart}}@retrofit.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit.http.Field{{/isMultipart}}("{{baseName}}") TypedFile {{paramName}}{{/isFile}}{{/isFormParam}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/headerParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/headerParams.mustache index 29206e1546bc..336841150bb2 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/headerParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@Header("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}@retrofit.http.Header("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pathParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pathParams.mustache index 8a8bdc74c882..f779cf2fba50 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}@Path("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}@retrofit.http.Path("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/queryParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/queryParams.mustache index 3c5b1bb7e69d..913efbd82b87 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/queryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}@Query("{{baseName}}") {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}@retrofit.http.Query("{{baseName}}") {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}} {{paramName}}{{/isQueryParam}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache index 7fa42fe732c8..7682d27c9c81 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache @@ -28,7 +28,7 @@ public interface {{classname}} { {{/allParams}} * @return Call<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> */ {{#formParams}}{{#-first}} - {{#isMultipart}}@Multipart{{/isMultipart}}{{^isMultipart}}@FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} + {{#isMultipart}}@retrofit2.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit2.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} @{{httpMethod}}("{{path}}") {{#useRxJava}}Observable{{/useRxJava}}{{^useRxJava}}Call{{/useRxJava}}<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}({{^allParams}});{{/allParams}} {{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/bodyParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/bodyParams.mustache index f8788583db5c..7a0471dfbd2c 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/bodyParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}@Body {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}@retrofit2.http.Body {{{dataType}}} {{paramName}}{{/isBodyParam}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/formParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/formParams.mustache index 0620c3a21baf..b29d30d61521 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{#notFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field{{/isMultipart}}("{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field{{/isMultipart}}("{{baseName}}\"; filename=\"{{baseName}}") RequestBody {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}{{#isMultipart}}@retrofit2.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit2.http.Field{{/isMultipart}}("{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}{{#isMultipart}}@retrofit2.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit2.http.Field{{/isMultipart}}("{{baseName}}\"; filename=\"{{baseName}}") RequestBody {{paramName}}{{/isFile}}{{/isFormParam}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/headerParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/headerParams.mustache index 29206e1546bc..9d1ac8e0631e 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/headerParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@Header("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}@retrofit2.http.Header("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pathParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pathParams.mustache index 8a8bdc74c882..ea0e85de5d82 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}@Path("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}@retrofit2.http.Path("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/queryParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/queryParams.mustache index 3c5b1bb7e69d..f8d3d48ebd98 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/queryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}@Query("{{baseName}}") {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}@retrofit2.http.Query("{{baseName}}") {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}} {{paramName}}{{/isQueryParam}} From 26faf6cf4e336aabe917e1ed336155ce8f6da60d Mon Sep 17 00:00:00 2001 From: Stas Shakirov Date: Mon, 10 Oct 2016 14:42:08 +0300 Subject: [PATCH 3/9] remove newline char in *.mustache; added generated code --- .../libraries/retrofit/bodyParams.mustache | 2 +- .../libraries/retrofit/formParams.mustache | 2 +- .../libraries/retrofit/headerParams.mustache | 2 +- .../libraries/retrofit/pathParams.mustache | 2 +- .../libraries/retrofit/queryParams.mustache | 2 +- .../libraries/retrofit2/bodyParams.mustache | 2 +- .../libraries/retrofit2/formParams.mustache | 2 +- .../retrofit2/formParams.mustache.save | 1 + .../libraries/retrofit2/headerParams.mustache | 2 +- .../libraries/retrofit2/pathParams.mustache | 2 +- .../libraries/retrofit2/queryParams.mustache | 2 +- .../java/io/swagger/client/api/FakeApi.java | 252 +++++++++++++++++- .../java/io/swagger/client/api/PetApi.java | 170 ++++++++++-- .../java/io/swagger/client/api/StoreApi.java | 42 ++- .../java/io/swagger/client/api/UserApi.java | 118 +++++++- .../model/AdditionalPropertiesClass.java | 4 +- .../java/io/swagger/client/model/Animal.java | 4 +- .../io/swagger/client/model/AnimalFarm.java | 4 +- .../model/ArrayOfArrayOfNumberOnly.java | 4 +- .../client/model/ArrayOfNumberOnly.java | 4 +- .../io/swagger/client/model/ArrayTest.java | 4 +- .../java/io/swagger/client/model/Cat.java | 4 +- .../io/swagger/client/model/Category.java | 4 +- .../java/io/swagger/client/model/Client.java | 4 +- .../java/io/swagger/client/model/Dog.java | 4 +- .../io/swagger/client/model/EnumArrays.java | 4 +- .../io/swagger/client/model/EnumClass.java | 1 - .../io/swagger/client/model/EnumTest.java | 4 +- .../io/swagger/client/model/FormatTest.java | 4 +- .../swagger/client/model/HasOnlyReadOnly.java | 4 +- .../java/io/swagger/client/model/MapTest.java | 4 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../client/model/Model200Response.java | 4 +- .../client/model/ModelApiResponse.java | 4 +- .../io/swagger/client/model/ModelReturn.java | 4 +- .../java/io/swagger/client/model/Name.java | 4 +- .../io/swagger/client/model/NumberOnly.java | 4 +- .../java/io/swagger/client/model/Order.java | 4 +- .../java/io/swagger/client/model/Pet.java | 4 +- .../swagger/client/model/ReadOnlyFirst.java | 4 +- .../client/model/SpecialModelName.java | 4 +- .../java/io/swagger/client/model/Tag.java | 4 +- .../java/io/swagger/client/model/User.java | 4 +- .../petstore/java/retrofit2/docs/FakeApi.md | 6 +- .../java/io/swagger/client/api/FakeApi.java | 126 ++++++++- .../java/io/swagger/client/api/PetApi.java | 85 +++++- .../java/io/swagger/client/api/StoreApi.java | 21 +- .../java/io/swagger/client/api/UserApi.java | 59 +++- .../model/AdditionalPropertiesClass.java | 4 +- .../java/io/swagger/client/model/Animal.java | 4 +- .../io/swagger/client/model/AnimalFarm.java | 4 +- .../model/ArrayOfArrayOfNumberOnly.java | 4 +- .../client/model/ArrayOfNumberOnly.java | 4 +- .../io/swagger/client/model/ArrayTest.java | 4 +- .../java/io/swagger/client/model/Cat.java | 4 +- .../io/swagger/client/model/Category.java | 4 +- .../java/io/swagger/client/model/Client.java | 4 +- .../java/io/swagger/client/model/Dog.java | 4 +- .../io/swagger/client/model/EnumArrays.java | 4 +- .../io/swagger/client/model/EnumClass.java | 1 - .../io/swagger/client/model/EnumTest.java | 4 +- .../io/swagger/client/model/FormatTest.java | 4 +- .../swagger/client/model/HasOnlyReadOnly.java | 4 +- .../java/io/swagger/client/model/MapTest.java | 4 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../client/model/Model200Response.java | 4 +- .../client/model/ModelApiResponse.java | 4 +- .../io/swagger/client/model/ModelReturn.java | 4 +- .../java/io/swagger/client/model/Name.java | 4 +- .../io/swagger/client/model/NumberOnly.java | 4 +- .../java/io/swagger/client/model/Order.java | 4 +- .../java/io/swagger/client/model/Pet.java | 4 +- .../swagger/client/model/ReadOnlyFirst.java | 4 +- .../client/model/SpecialModelName.java | 4 +- .../java/io/swagger/client/model/Tag.java | 4 +- .../java/io/swagger/client/model/User.java | 4 +- .../java/io/swagger/client/api/FakeApi.java | 126 ++++++++- .../java/io/swagger/client/api/PetApi.java | 85 +++++- .../java/io/swagger/client/api/StoreApi.java | 21 +- .../java/io/swagger/client/api/UserApi.java | 59 +++- .../model/AdditionalPropertiesClass.java | 4 +- .../java/io/swagger/client/model/Animal.java | 4 +- .../io/swagger/client/model/AnimalFarm.java | 4 +- .../model/ArrayOfArrayOfNumberOnly.java | 4 +- .../client/model/ArrayOfNumberOnly.java | 4 +- .../io/swagger/client/model/ArrayTest.java | 4 +- .../java/io/swagger/client/model/Cat.java | 4 +- .../io/swagger/client/model/Category.java | 4 +- .../java/io/swagger/client/model/Client.java | 4 +- .../java/io/swagger/client/model/Dog.java | 4 +- .../io/swagger/client/model/EnumArrays.java | 4 +- .../io/swagger/client/model/EnumClass.java | 1 - .../io/swagger/client/model/EnumTest.java | 4 +- .../io/swagger/client/model/FormatTest.java | 4 +- .../swagger/client/model/HasOnlyReadOnly.java | 4 +- .../java/io/swagger/client/model/MapTest.java | 4 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../client/model/Model200Response.java | 4 +- .../client/model/ModelApiResponse.java | 4 +- .../io/swagger/client/model/ModelReturn.java | 4 +- .../java/io/swagger/client/model/Name.java | 4 +- .../io/swagger/client/model/NumberOnly.java | 4 +- .../java/io/swagger/client/model/Order.java | 4 +- .../java/io/swagger/client/model/Pet.java | 4 +- .../swagger/client/model/ReadOnlyFirst.java | 4 +- .../client/model/SpecialModelName.java | 4 +- .../java/io/swagger/client/model/Tag.java | 4 +- .../java/io/swagger/client/model/User.java | 4 +- 108 files changed, 1241 insertions(+), 277 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/formParams.mustache.save diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/bodyParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/bodyParams.mustache index ed55732b053b..81de324b691f 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/bodyParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}@retrofit.http.Body {{{dataType}}} {{paramName}}{{/isBodyParam}} +{{#isBodyParam}}@retrofit.http.Body {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/formParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/formParams.mustache index aa92e88e7203..f1f9027ae516 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{#notFile}}{{#isMultipart}}@retrofit.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit.http.Field{{/isMultipart}}("{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}{{#isMultipart}}@retrofit.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit.http.Field{{/isMultipart}}("{{baseName}}") TypedFile {{paramName}}{{/isFile}}{{/isFormParam}} +{{#isFormParam}}{{#notFile}}{{#isMultipart}}@retrofit.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit.http.Field{{/isMultipart}}("{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}{{#isMultipart}}@retrofit.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit.http.Field{{/isMultipart}}("{{baseName}}") TypedFile {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/headerParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/headerParams.mustache index 336841150bb2..5d6da4a94375 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/headerParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@retrofit.http.Header("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} +{{#isHeaderParam}}@retrofit.http.Header("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pathParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pathParams.mustache index f779cf2fba50..7b8be8442e0d 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}@retrofit.http.Path("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} +{{#isPathParam}}@retrofit.http.Path("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/queryParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/queryParams.mustache index 913efbd82b87..2a580ab34ec5 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/queryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}@retrofit.http.Query("{{baseName}}") {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}} {{paramName}}{{/isQueryParam}} +{{#isQueryParam}}@retrofit.http.Query("{{baseName}}") {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/bodyParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/bodyParams.mustache index 7a0471dfbd2c..97b03fcb7173 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/bodyParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}@retrofit2.http.Body {{{dataType}}} {{paramName}}{{/isBodyParam}} +{{#isBodyParam}}@retrofit2.http.Body {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/formParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/formParams.mustache index b29d30d61521..2e237383ee30 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{#notFile}}{{#isMultipart}}@retrofit2.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit2.http.Field{{/isMultipart}}("{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}{{#isMultipart}}@retrofit2.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit2.http.Field{{/isMultipart}}("{{baseName}}\"; filename=\"{{baseName}}") RequestBody {{paramName}}{{/isFile}}{{/isFormParam}} +{{#isFormParam}}{{#notFile}}{{#isMultipart}}@retrofit2.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit2.http.Field{{/isMultipart}}("{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}{{#isMultipart}}@retrofit2.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit2.http.Field{{/isMultipart}}("{{baseName}}\"; filename=\"{{baseName}}") RequestBody {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/formParams.mustache.save b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/formParams.mustache.save new file mode 100644 index 000000000000..a203e99a223d --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/formParams.mustache.save @@ -0,0 +1 @@ +{{#isFormParam}}{{#notFile}}{{#isMultipart}}retrofit.http@retrofit2.http.Part{{/isMultipart}}{{^isMultipart}}@Field{{/isMultipart}}("{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field{{/isMultipart}}("{{baseName}}\"; filename=\"{{baseName}}") RequestBody {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/headerParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/headerParams.mustache index 9d1ac8e0631e..c7748f3bf27c 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/headerParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@retrofit2.http.Header("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} +{{#isHeaderParam}}@retrofit2.http.Header("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pathParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pathParams.mustache index ea0e85de5d82..8fe7c380c41a 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pathParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}@retrofit2.http.Path("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} +{{#isPathParam}}@retrofit2.http.Path("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/queryParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/queryParams.mustache index f8d3d48ebd98..abb87510ecf7 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/queryParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}@retrofit2.http.Query("{{baseName}}") {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}} {{paramName}}{{/isQueryParam}} +{{#isQueryParam}}@retrofit2.http.Query("{{baseName}}") {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java index fb02bbde6902..e1c4644feea6 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java @@ -27,7 +27,12 @@ public interface FakeApi { @PATCH("/fake") Client testClientModel( - @Body Client body + + + +@retrofit.http.Body Client body + + ); /** @@ -40,7 +45,12 @@ public interface FakeApi { @PATCH("/fake") void testClientModel( - @Body Client body, Callback cb + + + +@retrofit.http.Body Client body + +, Callback cb ); /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -59,13 +69,84 @@ public interface FakeApi { * @param date None (optional) * @param dateTime None (optional) * @param password None (optional) + * @param paramCallback None (optional) * @return Void */ - @FormUrlEncoded + @retrofit.http.FormUrlEncoded @POST("/fake") Void testEndpointParameters( - @Field("number") BigDecimal number, @Field("double") Double _double, @Field("pattern_without_delimiter") String patternWithoutDelimiter, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("string") String string, @Field("binary") byte[] binary, @Field("date") LocalDate date, @Field("dateTime") DateTime dateTime, @Field("password") String password + + + + +@retrofit.http.Field("number") BigDecimal number +, + + + +@retrofit.http.Field("double") Double _double +, + + + +@retrofit.http.Field("pattern_without_delimiter") String patternWithoutDelimiter +, + + + +@retrofit.http.Field("byte") byte[] _byte +, + + + +@retrofit.http.Field("integer") Integer integer +, + + + +@retrofit.http.Field("int32") Integer int32 +, + + + +@retrofit.http.Field("int64") Long int64 +, + + + +@retrofit.http.Field("float") Float _float +, + + + +@retrofit.http.Field("string") String string +, + + + +@retrofit.http.Field("binary") byte[] binary +, + + + +@retrofit.http.Field("date") LocalDate date +, + + + +@retrofit.http.Field("dateTime") DateTime dateTime +, + + + +@retrofit.http.Field("password") String password +, + + + +@retrofit.http.Field("callback") String paramCallback + ); /** @@ -84,14 +165,85 @@ public interface FakeApi { * @param date None (optional) * @param dateTime None (optional) * @param password None (optional) + * @param paramCallback None (optional) * @param cb callback method * @return void */ - @FormUrlEncoded + @retrofit.http.FormUrlEncoded @POST("/fake") void testEndpointParameters( - @Field("number") BigDecimal number, @Field("double") Double _double, @Field("pattern_without_delimiter") String patternWithoutDelimiter, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("string") String string, @Field("binary") byte[] binary, @Field("date") LocalDate date, @Field("dateTime") DateTime dateTime, @Field("password") String password, Callback cb + + + + +@retrofit.http.Field("number") BigDecimal number +, + + + +@retrofit.http.Field("double") Double _double +, + + + +@retrofit.http.Field("pattern_without_delimiter") String patternWithoutDelimiter +, + + + +@retrofit.http.Field("byte") byte[] _byte +, + + + +@retrofit.http.Field("integer") Integer integer +, + + + +@retrofit.http.Field("int32") Integer int32 +, + + + +@retrofit.http.Field("int64") Long int64 +, + + + +@retrofit.http.Field("float") Float _float +, + + + +@retrofit.http.Field("string") String string +, + + + +@retrofit.http.Field("binary") byte[] binary +, + + + +@retrofit.http.Field("date") LocalDate date +, + + + +@retrofit.http.Field("dateTime") DateTime dateTime +, + + + +@retrofit.http.Field("password") String password +, + + + +@retrofit.http.Field("callback") String paramCallback +, Callback cb ); /** * To test enum parameters @@ -108,10 +260,50 @@ public interface FakeApi { * @return Void */ - @FormUrlEncoded + @retrofit.http.FormUrlEncoded @GET("/fake") Void testEnumParameters( - @Field("enum_form_string_array") List enumFormStringArray, @Field("enum_form_string") String enumFormString, @Header("enum_header_string_array") List enumHeaderStringArray, @Header("enum_header_string") String enumHeaderString, @Query("enum_query_string_array") CSVParams enumQueryStringArray, @Query("enum_query_string") String enumQueryString, @Query("enum_query_integer") BigDecimal enumQueryInteger, @Field("enum_query_double") Double enumQueryDouble + + + + +@retrofit.http.Field("enum_form_string_array") List enumFormStringArray +, + + + +@retrofit.http.Field("enum_form_string") String enumFormString +, + +@retrofit.http.Header("enum_header_string_array") List enumHeaderStringArray + + +, + +@retrofit.http.Header("enum_header_string") String enumHeaderString + + +, @retrofit.http.Query("enum_query_string_array") CSVParams enumQueryStringArray + + + + +, @retrofit.http.Query("enum_query_string") String enumQueryString + + + + +, @retrofit.http.Query("enum_query_integer") BigDecimal enumQueryInteger + + + + +, + + + +@retrofit.http.Field("enum_query_double") Double enumQueryDouble + ); /** @@ -129,9 +321,49 @@ public interface FakeApi { * @return void */ - @FormUrlEncoded + @retrofit.http.FormUrlEncoded @GET("/fake") void testEnumParameters( - @Field("enum_form_string_array") List enumFormStringArray, @Field("enum_form_string") String enumFormString, @Header("enum_header_string_array") List enumHeaderStringArray, @Header("enum_header_string") String enumHeaderString, @Query("enum_query_string_array") CSVParams enumQueryStringArray, @Query("enum_query_string") String enumQueryString, @Query("enum_query_integer") BigDecimal enumQueryInteger, @Field("enum_query_double") Double enumQueryDouble, Callback cb + + + + +@retrofit.http.Field("enum_form_string_array") List enumFormStringArray +, + + + +@retrofit.http.Field("enum_form_string") String enumFormString +, + +@retrofit.http.Header("enum_header_string_array") List enumHeaderStringArray + + +, + +@retrofit.http.Header("enum_header_string") String enumHeaderString + + +, @retrofit.http.Query("enum_query_string_array") CSVParams enumQueryStringArray + + + + +, @retrofit.http.Query("enum_query_string") String enumQueryString + + + + +, @retrofit.http.Query("enum_query_integer") BigDecimal enumQueryInteger + + + + +, + + + +@retrofit.http.Field("enum_query_double") Double enumQueryDouble +, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java index a019a4bf886d..eaeb49ffba41 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java @@ -26,7 +26,12 @@ public interface PetApi { @POST("/pet") Void addPet( - @Body Pet body + + + +@retrofit.http.Body Pet body + + ); /** @@ -39,7 +44,12 @@ public interface PetApi { @POST("/pet") void addPet( - @Body Pet body, Callback cb + + + +@retrofit.http.Body Pet body + +, Callback cb ); /** * Deletes a pet @@ -52,7 +62,17 @@ public interface PetApi { @DELETE("/pet/{petId}") Void deletePet( - @Path("petId") Long petId, @Header("api_key") String apiKey + +@retrofit.http.Path("petId") Long petId + + + +, + +@retrofit.http.Header("api_key") String apiKey + + + ); /** @@ -66,7 +86,17 @@ public interface PetApi { @DELETE("/pet/{petId}") void deletePet( - @Path("petId") Long petId, @Header("api_key") String apiKey, Callback cb + +@retrofit.http.Path("petId") Long petId + + + +, + +@retrofit.http.Header("api_key") String apiKey + + +, Callback cb ); /** * Finds Pets by status @@ -78,7 +108,12 @@ public interface PetApi { @GET("/pet/findByStatus") List findPetsByStatus( - @Query("status") CSVParams status + @retrofit.http.Query("status") CSVParams status + + + + + ); /** @@ -91,7 +126,12 @@ public interface PetApi { @GET("/pet/findByStatus") void findPetsByStatus( - @Query("status") CSVParams status, Callback> cb + @retrofit.http.Query("status") CSVParams status + + + + +, Callback> cb ); /** * Finds Pets by tags @@ -103,7 +143,12 @@ public interface PetApi { @GET("/pet/findByTags") List findPetsByTags( - @Query("tags") CSVParams tags + @retrofit.http.Query("tags") CSVParams tags + + + + + ); /** @@ -116,7 +161,12 @@ public interface PetApi { @GET("/pet/findByTags") void findPetsByTags( - @Query("tags") CSVParams tags, Callback> cb + @retrofit.http.Query("tags") CSVParams tags + + + + +, Callback> cb ); /** * Find pet by ID @@ -128,7 +178,12 @@ public interface PetApi { @GET("/pet/{petId}") Pet getPetById( - @Path("petId") Long petId + +@retrofit.http.Path("petId") Long petId + + + + ); /** @@ -141,7 +196,12 @@ public interface PetApi { @GET("/pet/{petId}") void getPetById( - @Path("petId") Long petId, Callback cb + +@retrofit.http.Path("petId") Long petId + + + +, Callback cb ); /** * Update an existing pet @@ -153,7 +213,12 @@ public interface PetApi { @PUT("/pet") Void updatePet( - @Body Pet body + + + +@retrofit.http.Body Pet body + + ); /** @@ -166,7 +231,12 @@ public interface PetApi { @PUT("/pet") void updatePet( - @Body Pet body, Callback cb + + + +@retrofit.http.Body Pet body + +, Callback cb ); /** * Updates a pet in the store with form data @@ -178,10 +248,25 @@ public interface PetApi { * @return Void */ - @FormUrlEncoded + @retrofit.http.FormUrlEncoded @POST("/pet/{petId}") Void updatePetWithForm( - @Path("petId") Long petId, @Field("name") String name, @Field("status") String status + +@retrofit.http.Path("petId") Long petId + + + +, + + + +@retrofit.http.Field("name") String name +, + + + +@retrofit.http.Field("status") String status + ); /** @@ -194,10 +279,25 @@ public interface PetApi { * @return void */ - @FormUrlEncoded + @retrofit.http.FormUrlEncoded @POST("/pet/{petId}") void updatePetWithForm( - @Path("petId") Long petId, @Field("name") String name, @Field("status") String status, Callback cb + +@retrofit.http.Path("petId") Long petId + + + +, + + + +@retrofit.http.Field("name") String name +, + + + +@retrofit.http.Field("status") String status +, Callback cb ); /** * uploads an image @@ -209,10 +309,25 @@ public interface PetApi { * @return ModelApiResponse */ - @Multipart + @retrofit.http.Multipart @POST("/pet/{petId}/uploadImage") ModelApiResponse uploadFile( - @Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file") TypedFile file + +@retrofit.http.Path("petId") Long petId + + + +, + + + +@retrofit.http.Part("additionalMetadata") String additionalMetadata +, + + + +@retrofit.http.Part("file") TypedFile file + ); /** @@ -225,9 +340,24 @@ public interface PetApi { * @return void */ - @Multipart + @retrofit.http.Multipart @POST("/pet/{petId}/uploadImage") void uploadFile( - @Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file") TypedFile file, Callback cb + +@retrofit.http.Path("petId") Long petId + + + +, + + + +@retrofit.http.Part("additionalMetadata") String additionalMetadata +, + + + +@retrofit.http.Part("file") TypedFile file +, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java index def4aa2efc70..f9fed4bd1cef 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java @@ -24,7 +24,12 @@ public interface StoreApi { @DELETE("/store/order/{orderId}") Void deleteOrder( - @Path("orderId") String orderId + +@retrofit.http.Path("orderId") String orderId + + + + ); /** @@ -37,7 +42,12 @@ public interface StoreApi { @DELETE("/store/order/{orderId}") void deleteOrder( - @Path("orderId") String orderId, Callback cb + +@retrofit.http.Path("orderId") String orderId + + + +, Callback cb ); /** * Returns pet inventories by status @@ -71,7 +81,12 @@ public interface StoreApi { @GET("/store/order/{orderId}") Order getOrderById( - @Path("orderId") Long orderId + +@retrofit.http.Path("orderId") Long orderId + + + + ); /** @@ -84,7 +99,12 @@ public interface StoreApi { @GET("/store/order/{orderId}") void getOrderById( - @Path("orderId") Long orderId, Callback cb + +@retrofit.http.Path("orderId") Long orderId + + + +, Callback cb ); /** * Place an order for a pet @@ -96,7 +116,12 @@ public interface StoreApi { @POST("/store/order") Order placeOrder( - @Body Order body + + + +@retrofit.http.Body Order body + + ); /** @@ -109,6 +134,11 @@ public interface StoreApi { @POST("/store/order") void placeOrder( - @Body Order body, Callback cb + + + +@retrofit.http.Body Order body + +, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/UserApi.java index 8c3380d07d4e..7de0bc3fb1a3 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/UserApi.java @@ -24,7 +24,12 @@ public interface UserApi { @POST("/user") Void createUser( - @Body User body + + + +@retrofit.http.Body User body + + ); /** @@ -37,7 +42,12 @@ public interface UserApi { @POST("/user") void createUser( - @Body User body, Callback cb + + + +@retrofit.http.Body User body + +, Callback cb ); /** * Creates list of users with given input array @@ -49,7 +59,12 @@ public interface UserApi { @POST("/user/createWithArray") Void createUsersWithArrayInput( - @Body List body + + + +@retrofit.http.Body List body + + ); /** @@ -62,7 +77,12 @@ public interface UserApi { @POST("/user/createWithArray") void createUsersWithArrayInput( - @Body List body, Callback cb + + + +@retrofit.http.Body List body + +, Callback cb ); /** * Creates list of users with given input array @@ -74,7 +94,12 @@ public interface UserApi { @POST("/user/createWithList") Void createUsersWithListInput( - @Body List body + + + +@retrofit.http.Body List body + + ); /** @@ -87,7 +112,12 @@ public interface UserApi { @POST("/user/createWithList") void createUsersWithListInput( - @Body List body, Callback cb + + + +@retrofit.http.Body List body + +, Callback cb ); /** * Delete user @@ -99,7 +129,12 @@ public interface UserApi { @DELETE("/user/{username}") Void deleteUser( - @Path("username") String username + +@retrofit.http.Path("username") String username + + + + ); /** @@ -112,7 +147,12 @@ public interface UserApi { @DELETE("/user/{username}") void deleteUser( - @Path("username") String username, Callback cb + +@retrofit.http.Path("username") String username + + + +, Callback cb ); /** * Get user by user name @@ -124,7 +164,12 @@ public interface UserApi { @GET("/user/{username}") User getUserByName( - @Path("username") String username + +@retrofit.http.Path("username") String username + + + + ); /** @@ -137,7 +182,12 @@ public interface UserApi { @GET("/user/{username}") void getUserByName( - @Path("username") String username, Callback cb + +@retrofit.http.Path("username") String username + + + +, Callback cb ); /** * Logs user into the system @@ -150,7 +200,17 @@ public interface UserApi { @GET("/user/login") String loginUser( - @Query("username") String username, @Query("password") String password + @retrofit.http.Query("username") String username + + + + +, @retrofit.http.Query("password") String password + + + + + ); /** @@ -164,7 +224,17 @@ public interface UserApi { @GET("/user/login") void loginUser( - @Query("username") String username, @Query("password") String password, Callback cb + @retrofit.http.Query("username") String username + + + + +, @retrofit.http.Query("password") String password + + + + +, Callback cb ); /** * Logs out current logged in user session @@ -199,7 +269,17 @@ public interface UserApi { @PUT("/user/{username}") Void updateUser( - @Path("username") String username, @Body User body + +@retrofit.http.Path("username") String username + + + +, + + +@retrofit.http.Body User body + + ); /** @@ -213,6 +293,16 @@ public interface UserApi { @PUT("/user/{username}") void updateUser( - @Path("username") String username, @Body User body, Callback cb + +@retrofit.http.Path("username") String username + + + +, + + +@retrofit.http.Body User body + +, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index d20b1402ce2f..81d139e630b7 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -33,12 +33,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - /** * AdditionalPropertiesClass */ -public class AdditionalPropertiesClass { +public class AdditionalPropertiesClass { @SerializedName("map_property") private Map mapProperty = new HashMap(); @@ -131,5 +130,6 @@ public class AdditionalPropertiesClass { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Animal.java index 9b1ff3df1c55..bc73c4f93cb6 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Animal.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Animal */ -public class Animal { +public class Animal { @SerializedName("className") private String className = null; @@ -118,5 +117,6 @@ public class Animal { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AnimalFarm.java index 563476ccb3db..8a50c9c6cb5f 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -30,12 +30,11 @@ import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; - /** * AnimalFarm */ -public class AnimalFarm extends ArrayList { +public class AnimalFarm extends ArrayList { @Override public boolean equals(java.lang.Object o) { @@ -72,5 +71,6 @@ public class AnimalFarm extends ArrayList { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 4c2fa22800f3..e0dde620ab43 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -33,12 +33,11 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; - /** * ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnly { +public class ArrayOfArrayOfNumberOnly { @SerializedName("ArrayArrayNumber") private List> arrayArrayNumber = new ArrayList>(); @@ -103,5 +102,6 @@ public class ArrayOfArrayOfNumberOnly { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 3c7d74dc3b5c..e529ebc4fa84 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -33,12 +33,11 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; - /** * ArrayOfNumberOnly */ -public class ArrayOfNumberOnly { +public class ArrayOfNumberOnly { @SerializedName("ArrayNumber") private List arrayNumber = new ArrayList(); @@ -103,5 +102,6 @@ public class ArrayOfNumberOnly { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java index 7e08b24fa6ed..80df1b341f51 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java @@ -33,12 +33,11 @@ import io.swagger.client.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; - /** * ArrayTest */ -public class ArrayTest { +public class ArrayTest { @SerializedName("array_of_string") private List arrayOfString = new ArrayList(); @@ -159,5 +158,6 @@ public class ArrayTest { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java index 9c5cb39f6483..10a2f2c5c8d9 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java @@ -31,12 +31,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; - /** * Cat */ -public class Cat extends Animal { +public class Cat extends Animal { @SerializedName("declawed") private Boolean declawed = null; @@ -97,5 +96,6 @@ public class Cat extends Animal { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Category.java index 44e76030effc..153df9edbfa0 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Category.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Category */ -public class Category { +public class Category { @SerializedName("id") private Long id = null; @@ -118,5 +117,6 @@ public class Category { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Client.java index 54a54647918d..1eb9e755db37 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Client.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Client */ -public class Client { +public class Client { @SerializedName("client") private String client = null; @@ -95,5 +94,6 @@ public class Client { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Dog.java index 880c159616c9..079def9ecc6e 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Dog.java @@ -31,12 +31,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; - /** * Dog */ -public class Dog extends Animal { +public class Dog extends Animal { @SerializedName("breed") private String breed = null; @@ -97,5 +96,6 @@ public class Dog extends Animal { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java index c50967387551..7eea2d2a9118 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java @@ -32,12 +32,11 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; - /** * EnumArrays */ -public class EnumArrays { +public class EnumArrays { /** * Gets or Sets justSymbol */ @@ -169,5 +168,6 @@ public class EnumArrays { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumClass.java index 7862a8b89526..a6072c381c4a 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumClass.java @@ -29,7 +29,6 @@ import java.util.Objects; import com.google.gson.annotations.SerializedName; - /** * Gets or Sets EnumClass */ diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java index 83896fbd849d..bdd3a40bb28b 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * EnumTest */ -public class EnumTest { +public class EnumTest { /** * Gets or Sets enumString */ @@ -207,5 +206,6 @@ public class EnumTest { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java index a05f1d5c811b..023042b8d967 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java @@ -33,12 +33,11 @@ import java.math.BigDecimal; import org.joda.time.DateTime; import org.joda.time.LocalDate; - /** * FormatTest */ -public class FormatTest { +public class FormatTest { @SerializedName("integer") private Integer integer = null; @@ -384,5 +383,6 @@ public class FormatTest { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index e53b1a0d8be6..43a5b6a6c92a 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * HasOnlyReadOnly */ -public class HasOnlyReadOnly { +public class HasOnlyReadOnly { @SerializedName("bar") private String bar = null; @@ -100,5 +99,6 @@ public class HasOnlyReadOnly { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java index e7d394ed035d..75586c606c94 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java @@ -33,12 +33,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - /** * MapTest */ -public class MapTest { +public class MapTest { @SerializedName("map_map_of_string") private Map> mapMapOfString = new HashMap>(); @@ -153,5 +152,6 @@ public class MapTest { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 887ba516d72a..e6b8987656af 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -35,12 +35,11 @@ import java.util.List; import java.util.Map; import org.joda.time.DateTime; - /** * MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClass { +public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName("uuid") private String uuid = null; @@ -151,5 +150,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Model200Response.java index 980bc83e8692..eabc63cd3898 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Model200Response.java @@ -30,13 +30,12 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") -public class Model200Response { +public class Model200Response { @SerializedName("name") private Integer name = null; @@ -119,5 +118,6 @@ public class Model200Response { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelApiResponse.java index f9c162a7934a..e410a24757fa 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * ModelApiResponse */ -public class ModelApiResponse { +public class ModelApiResponse { @SerializedName("code") private Integer code = null; @@ -141,5 +140,6 @@ public class ModelApiResponse { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelReturn.java index bbe7780055c2..01d69fecb681 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelReturn.java @@ -30,13 +30,12 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") -public class ModelReturn { +public class ModelReturn { @SerializedName("return") private Integer _return = null; @@ -96,5 +95,6 @@ public class ModelReturn { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Name.java index d51354ceffa8..c50f477abc3c 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Name.java @@ -30,13 +30,12 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") -public class Name { +public class Name { @SerializedName("name") private Integer name = null; @@ -147,5 +146,6 @@ public class Name { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/NumberOnly.java index 2b1817300a97..0653baec68bc 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/NumberOnly.java @@ -31,12 +31,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; - /** * NumberOnly */ -public class NumberOnly { +public class NumberOnly { @SerializedName("JustNumber") private BigDecimal justNumber = null; @@ -96,5 +95,6 @@ public class NumberOnly { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java index f52e7bd5db47..d15cca81e050 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java @@ -31,12 +31,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.joda.time.DateTime; - /** * Order */ -public class Order { +public class Order { @SerializedName("id") private Long id = null; @@ -236,5 +235,6 @@ public class Order { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java index 06443e569153..2363e9ed02ed 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java @@ -34,12 +34,11 @@ import io.swagger.client.model.Tag; import java.util.ArrayList; import java.util.List; - /** * Pet */ -public class Pet { +public class Pet { @SerializedName("id") private Long id = null; @@ -249,5 +248,6 @@ public class Pet { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 75dbc55f9f5c..f9f1503366fc 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * ReadOnlyFirst */ -public class ReadOnlyFirst { +public class ReadOnlyFirst { @SerializedName("bar") private String bar = null; @@ -109,5 +108,6 @@ public class ReadOnlyFirst { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/SpecialModelName.java index 9744ad082689..10d56096dea2 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * SpecialModelName */ -public class SpecialModelName { +public class SpecialModelName { @SerializedName("$special[property.name]") private Long specialPropertyName = null; @@ -95,5 +94,6 @@ public class SpecialModelName { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Tag.java index 9eef0141c711..11870f0f0a82 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Tag.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Tag */ -public class Tag { +public class Tag { @SerializedName("id") private Long id = null; @@ -118,5 +117,6 @@ public class Tag { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/User.java index 73584bfdccbd..b04dc861682a 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/User.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * User */ -public class User { +public class User { @SerializedName("id") private Long id = null; @@ -256,5 +255,6 @@ public class User { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/docs/FakeApi.md b/samples/client/petstore/java/retrofit2/docs/FakeApi.md index f4cfc7e19ccd..2e2b792d8d30 100644 --- a/samples/client/petstore/java/retrofit2/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2/docs/FakeApi.md @@ -54,7 +54,7 @@ No authorization required # **testEndpointParameters** -> Void testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password) +> Void testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -90,8 +90,9 @@ byte[] binary = B; // byte[] | None LocalDate date = new LocalDate(); // LocalDate | None DateTime dateTime = new DateTime(); // DateTime | None String password = "password_example"; // String | None +String paramCallback = "paramCallback_example"; // String | None try { - Void result = apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password); + Void result = apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); @@ -116,6 +117,7 @@ Name | Type | Description | Notes **date** | **LocalDate**| None | [optional] **dateTime** | **DateTime**| None | [optional] **password** | **String**| None | [optional] + **paramCallback** | **String**| None | [optional] ### Return type diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java index 25bde1256dc9..7479e230574f 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java @@ -28,7 +28,12 @@ public interface FakeApi { @PATCH("fake") Call testClientModel( - @Body Client body + + + +@retrofit2.http.Body Client body + + ); /** @@ -47,13 +52,84 @@ public interface FakeApi { * @param date None (optional) * @param dateTime None (optional) * @param password None (optional) + * @param paramCallback None (optional) * @return Call<Void> */ - @FormUrlEncoded + @retrofit2.http.FormUrlEncoded @POST("fake") Call testEndpointParameters( - @Field("number") BigDecimal number, @Field("double") Double _double, @Field("pattern_without_delimiter") String patternWithoutDelimiter, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("string") String string, @Field("binary") byte[] binary, @Field("date") LocalDate date, @Field("dateTime") DateTime dateTime, @Field("password") String password + + + + +@retrofit2.http.Field("number") BigDecimal number +, + + + +@retrofit2.http.Field("double") Double _double +, + + + +@retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter +, + + + +@retrofit2.http.Field("byte") byte[] _byte +, + + + +@retrofit2.http.Field("integer") Integer integer +, + + + +@retrofit2.http.Field("int32") Integer int32 +, + + + +@retrofit2.http.Field("int64") Long int64 +, + + + +@retrofit2.http.Field("float") Float _float +, + + + +@retrofit2.http.Field("string") String string +, + + + +@retrofit2.http.Field("binary") byte[] binary +, + + + +@retrofit2.http.Field("date") LocalDate date +, + + + +@retrofit2.http.Field("dateTime") DateTime dateTime +, + + + +@retrofit2.http.Field("password") String password +, + + + +@retrofit2.http.Field("callback") String paramCallback + ); /** @@ -70,10 +146,50 @@ public interface FakeApi { * @return Call<Void> */ - @FormUrlEncoded + @retrofit2.http.FormUrlEncoded @GET("fake") Call testEnumParameters( - @Field("enum_form_string_array") List enumFormStringArray, @Field("enum_form_string") String enumFormString, @Header("enum_header_string_array") List enumHeaderStringArray, @Header("enum_header_string") String enumHeaderString, @Query("enum_query_string_array") CSVParams enumQueryStringArray, @Query("enum_query_string") String enumQueryString, @Query("enum_query_integer") BigDecimal enumQueryInteger, @Field("enum_query_double") Double enumQueryDouble + + + + +@retrofit2.http.Field("enum_form_string_array") List enumFormStringArray +, + + + +@retrofit2.http.Field("enum_form_string") String enumFormString +, + +@retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray + + +, + +@retrofit2.http.Header("enum_header_string") String enumHeaderString + + +, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray + + + + +, @retrofit2.http.Query("enum_query_string") String enumQueryString + + + + +, @retrofit2.http.Query("enum_query_integer") BigDecimal enumQueryInteger + + + + +, + + + +@retrofit2.http.Field("enum_query_double") Double enumQueryDouble + ); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java index d5c574fbd3e2..bd13312f5816 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java @@ -27,7 +27,12 @@ public interface PetApi { @POST("pet") Call addPet( - @Body Pet body + + + +@retrofit2.http.Body Pet body + + ); /** @@ -40,7 +45,17 @@ public interface PetApi { @DELETE("pet/{petId}") Call deletePet( - @Path("petId") Long petId, @Header("api_key") String apiKey + +@retrofit2.http.Path("petId") Long petId + + + +, + +@retrofit2.http.Header("api_key") String apiKey + + + ); /** @@ -52,7 +67,12 @@ public interface PetApi { @GET("pet/findByStatus") Call> findPetsByStatus( - @Query("status") CSVParams status + @retrofit2.http.Query("status") CSVParams status + + + + + ); /** @@ -64,7 +84,12 @@ public interface PetApi { @GET("pet/findByTags") Call> findPetsByTags( - @Query("tags") CSVParams tags + @retrofit2.http.Query("tags") CSVParams tags + + + + + ); /** @@ -76,7 +101,12 @@ public interface PetApi { @GET("pet/{petId}") Call getPetById( - @Path("petId") Long petId + +@retrofit2.http.Path("petId") Long petId + + + + ); /** @@ -88,7 +118,12 @@ public interface PetApi { @PUT("pet") Call updatePet( - @Body Pet body + + + +@retrofit2.http.Body Pet body + + ); /** @@ -100,10 +135,25 @@ public interface PetApi { * @return Call<Void> */ - @FormUrlEncoded + @retrofit2.http.FormUrlEncoded @POST("pet/{petId}") Call updatePetWithForm( - @Path("petId") Long petId, @Field("name") String name, @Field("status") String status + +@retrofit2.http.Path("petId") Long petId + + + +, + + + +@retrofit2.http.Field("name") String name +, + + + +@retrofit2.http.Field("status") String status + ); /** @@ -115,10 +165,25 @@ public interface PetApi { * @return Call<ModelApiResponse> */ - @Multipart + @retrofit2.http.Multipart @POST("pet/{petId}/uploadImage") Call uploadFile( - @Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file\"; filename=\"file") RequestBody file + +@retrofit2.http.Path("petId") Long petId + + + +, + + + +@retrofit2.http.Part("additionalMetadata") String additionalMetadata +, + + + +@retrofit2.http.Part("file\"; filename=\"file") RequestBody file + ); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java index 3e19600bedb9..ebed8da8f523 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java @@ -25,7 +25,12 @@ public interface StoreApi { @DELETE("store/order/{orderId}") Call deleteOrder( - @Path("orderId") String orderId + +@retrofit2.http.Path("orderId") String orderId + + + + ); /** @@ -47,7 +52,12 @@ public interface StoreApi { @GET("store/order/{orderId}") Call getOrderById( - @Path("orderId") Long orderId + +@retrofit2.http.Path("orderId") Long orderId + + + + ); /** @@ -59,7 +69,12 @@ public interface StoreApi { @POST("store/order") Call placeOrder( - @Body Order body + + + +@retrofit2.http.Body Order body + + ); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java index 3fc76b6a1b21..1bf7d34d73ca 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java @@ -25,7 +25,12 @@ public interface UserApi { @POST("user") Call createUser( - @Body User body + + + +@retrofit2.http.Body User body + + ); /** @@ -37,7 +42,12 @@ public interface UserApi { @POST("user/createWithArray") Call createUsersWithArrayInput( - @Body List body + + + +@retrofit2.http.Body List body + + ); /** @@ -49,7 +59,12 @@ public interface UserApi { @POST("user/createWithList") Call createUsersWithListInput( - @Body List body + + + +@retrofit2.http.Body List body + + ); /** @@ -61,7 +76,12 @@ public interface UserApi { @DELETE("user/{username}") Call deleteUser( - @Path("username") String username + +@retrofit2.http.Path("username") String username + + + + ); /** @@ -73,7 +93,12 @@ public interface UserApi { @GET("user/{username}") Call getUserByName( - @Path("username") String username + +@retrofit2.http.Path("username") String username + + + + ); /** @@ -86,7 +111,17 @@ public interface UserApi { @GET("user/login") Call loginUser( - @Query("username") String username, @Query("password") String password + @retrofit2.http.Query("username") String username + + + + +, @retrofit2.http.Query("password") String password + + + + + ); /** @@ -109,7 +144,17 @@ public interface UserApi { @PUT("user/{username}") Call updateUser( - @Path("username") String username, @Body User body + +@retrofit2.http.Path("username") String username + + + +, + + +@retrofit2.http.Body User body + + ); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index d20b1402ce2f..81d139e630b7 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -33,12 +33,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - /** * AdditionalPropertiesClass */ -public class AdditionalPropertiesClass { +public class AdditionalPropertiesClass { @SerializedName("map_property") private Map mapProperty = new HashMap(); @@ -131,5 +130,6 @@ public class AdditionalPropertiesClass { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java index 9b1ff3df1c55..bc73c4f93cb6 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Animal */ -public class Animal { +public class Animal { @SerializedName("className") private String className = null; @@ -118,5 +117,6 @@ public class Animal { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AnimalFarm.java index 563476ccb3db..8a50c9c6cb5f 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -30,12 +30,11 @@ import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; - /** * AnimalFarm */ -public class AnimalFarm extends ArrayList { +public class AnimalFarm extends ArrayList { @Override public boolean equals(java.lang.Object o) { @@ -72,5 +71,6 @@ public class AnimalFarm extends ArrayList { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 4c2fa22800f3..e0dde620ab43 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -33,12 +33,11 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; - /** * ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnly { +public class ArrayOfArrayOfNumberOnly { @SerializedName("ArrayArrayNumber") private List> arrayArrayNumber = new ArrayList>(); @@ -103,5 +102,6 @@ public class ArrayOfArrayOfNumberOnly { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 3c7d74dc3b5c..e529ebc4fa84 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -33,12 +33,11 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; - /** * ArrayOfNumberOnly */ -public class ArrayOfNumberOnly { +public class ArrayOfNumberOnly { @SerializedName("ArrayNumber") private List arrayNumber = new ArrayList(); @@ -103,5 +102,6 @@ public class ArrayOfNumberOnly { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java index 7e08b24fa6ed..80df1b341f51 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java @@ -33,12 +33,11 @@ import io.swagger.client.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; - /** * ArrayTest */ -public class ArrayTest { +public class ArrayTest { @SerializedName("array_of_string") private List arrayOfString = new ArrayList(); @@ -159,5 +158,6 @@ public class ArrayTest { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java index 9c5cb39f6483..10a2f2c5c8d9 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java @@ -31,12 +31,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; - /** * Cat */ -public class Cat extends Animal { +public class Cat extends Animal { @SerializedName("declawed") private Boolean declawed = null; @@ -97,5 +96,6 @@ public class Cat extends Animal { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java index 44e76030effc..153df9edbfa0 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Category */ -public class Category { +public class Category { @SerializedName("id") private Long id = null; @@ -118,5 +117,6 @@ public class Category { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Client.java index 54a54647918d..1eb9e755db37 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Client.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Client */ -public class Client { +public class Client { @SerializedName("client") private String client = null; @@ -95,5 +94,6 @@ public class Client { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java index 880c159616c9..079def9ecc6e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java @@ -31,12 +31,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; - /** * Dog */ -public class Dog extends Animal { +public class Dog extends Animal { @SerializedName("breed") private String breed = null; @@ -97,5 +96,6 @@ public class Dog extends Animal { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java index c50967387551..7eea2d2a9118 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java @@ -32,12 +32,11 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; - /** * EnumArrays */ -public class EnumArrays { +public class EnumArrays { /** * Gets or Sets justSymbol */ @@ -169,5 +168,6 @@ public class EnumArrays { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumClass.java index 7862a8b89526..a6072c381c4a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumClass.java @@ -29,7 +29,6 @@ import java.util.Objects; import com.google.gson.annotations.SerializedName; - /** * Gets or Sets EnumClass */ diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java index 83896fbd849d..bdd3a40bb28b 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * EnumTest */ -public class EnumTest { +public class EnumTest { /** * Gets or Sets enumString */ @@ -207,5 +206,6 @@ public class EnumTest { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java index a05f1d5c811b..023042b8d967 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java @@ -33,12 +33,11 @@ import java.math.BigDecimal; import org.joda.time.DateTime; import org.joda.time.LocalDate; - /** * FormatTest */ -public class FormatTest { +public class FormatTest { @SerializedName("integer") private Integer integer = null; @@ -384,5 +383,6 @@ public class FormatTest { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index e53b1a0d8be6..43a5b6a6c92a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * HasOnlyReadOnly */ -public class HasOnlyReadOnly { +public class HasOnlyReadOnly { @SerializedName("bar") private String bar = null; @@ -100,5 +99,6 @@ public class HasOnlyReadOnly { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java index e7d394ed035d..75586c606c94 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java @@ -33,12 +33,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - /** * MapTest */ -public class MapTest { +public class MapTest { @SerializedName("map_map_of_string") private Map> mapMapOfString = new HashMap>(); @@ -153,5 +152,6 @@ public class MapTest { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 887ba516d72a..e6b8987656af 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -35,12 +35,11 @@ import java.util.List; import java.util.Map; import org.joda.time.DateTime; - /** * MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClass { +public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName("uuid") private String uuid = null; @@ -151,5 +150,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Model200Response.java index 980bc83e8692..eabc63cd3898 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Model200Response.java @@ -30,13 +30,12 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") -public class Model200Response { +public class Model200Response { @SerializedName("name") private Integer name = null; @@ -119,5 +118,6 @@ public class Model200Response { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java index f9c162a7934a..e410a24757fa 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * ModelApiResponse */ -public class ModelApiResponse { +public class ModelApiResponse { @SerializedName("code") private Integer code = null; @@ -141,5 +140,6 @@ public class ModelApiResponse { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java index bbe7780055c2..01d69fecb681 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java @@ -30,13 +30,12 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") -public class ModelReturn { +public class ModelReturn { @SerializedName("return") private Integer _return = null; @@ -96,5 +95,6 @@ public class ModelReturn { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Name.java index d51354ceffa8..c50f477abc3c 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Name.java @@ -30,13 +30,12 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") -public class Name { +public class Name { @SerializedName("name") private Integer name = null; @@ -147,5 +146,6 @@ public class Name { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java index 2b1817300a97..0653baec68bc 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java @@ -31,12 +31,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; - /** * NumberOnly */ -public class NumberOnly { +public class NumberOnly { @SerializedName("JustNumber") private BigDecimal justNumber = null; @@ -96,5 +95,6 @@ public class NumberOnly { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java index f52e7bd5db47..d15cca81e050 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java @@ -31,12 +31,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.joda.time.DateTime; - /** * Order */ -public class Order { +public class Order { @SerializedName("id") private Long id = null; @@ -236,5 +235,6 @@ public class Order { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java index 06443e569153..2363e9ed02ed 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java @@ -34,12 +34,11 @@ import io.swagger.client.model.Tag; import java.util.ArrayList; import java.util.List; - /** * Pet */ -public class Pet { +public class Pet { @SerializedName("id") private Long id = null; @@ -249,5 +248,6 @@ public class Pet { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 75dbc55f9f5c..f9f1503366fc 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * ReadOnlyFirst */ -public class ReadOnlyFirst { +public class ReadOnlyFirst { @SerializedName("bar") private String bar = null; @@ -109,5 +108,6 @@ public class ReadOnlyFirst { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/SpecialModelName.java index 9744ad082689..10d56096dea2 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * SpecialModelName */ -public class SpecialModelName { +public class SpecialModelName { @SerializedName("$special[property.name]") private Long specialPropertyName = null; @@ -95,5 +94,6 @@ public class SpecialModelName { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java index 9eef0141c711..11870f0f0a82 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Tag */ -public class Tag { +public class Tag { @SerializedName("id") private Long id = null; @@ -118,5 +117,6 @@ public class Tag { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java index 73584bfdccbd..b04dc861682a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * User */ -public class User { +public class User { @SerializedName("id") private Long id = null; @@ -256,5 +255,6 @@ public class User { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java index 2bf3ea9e8392..924c81ff6dc8 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java @@ -28,7 +28,12 @@ public interface FakeApi { @PATCH("fake") Observable testClientModel( - @Body Client body + + + +@retrofit2.http.Body Client body + + ); /** @@ -47,13 +52,84 @@ public interface FakeApi { * @param date None (optional) * @param dateTime None (optional) * @param password None (optional) + * @param paramCallback None (optional) * @return Call<Void> */ - @FormUrlEncoded + @retrofit2.http.FormUrlEncoded @POST("fake") Observable testEndpointParameters( - @Field("number") BigDecimal number, @Field("double") Double _double, @Field("pattern_without_delimiter") String patternWithoutDelimiter, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("string") String string, @Field("binary") byte[] binary, @Field("date") LocalDate date, @Field("dateTime") DateTime dateTime, @Field("password") String password + + + + +@retrofit2.http.Field("number") BigDecimal number +, + + + +@retrofit2.http.Field("double") Double _double +, + + + +@retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter +, + + + +@retrofit2.http.Field("byte") byte[] _byte +, + + + +@retrofit2.http.Field("integer") Integer integer +, + + + +@retrofit2.http.Field("int32") Integer int32 +, + + + +@retrofit2.http.Field("int64") Long int64 +, + + + +@retrofit2.http.Field("float") Float _float +, + + + +@retrofit2.http.Field("string") String string +, + + + +@retrofit2.http.Field("binary") byte[] binary +, + + + +@retrofit2.http.Field("date") LocalDate date +, + + + +@retrofit2.http.Field("dateTime") DateTime dateTime +, + + + +@retrofit2.http.Field("password") String password +, + + + +@retrofit2.http.Field("callback") String paramCallback + ); /** @@ -70,10 +146,50 @@ public interface FakeApi { * @return Call<Void> */ - @FormUrlEncoded + @retrofit2.http.FormUrlEncoded @GET("fake") Observable testEnumParameters( - @Field("enum_form_string_array") List enumFormStringArray, @Field("enum_form_string") String enumFormString, @Header("enum_header_string_array") List enumHeaderStringArray, @Header("enum_header_string") String enumHeaderString, @Query("enum_query_string_array") CSVParams enumQueryStringArray, @Query("enum_query_string") String enumQueryString, @Query("enum_query_integer") BigDecimal enumQueryInteger, @Field("enum_query_double") Double enumQueryDouble + + + + +@retrofit2.http.Field("enum_form_string_array") List enumFormStringArray +, + + + +@retrofit2.http.Field("enum_form_string") String enumFormString +, + +@retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray + + +, + +@retrofit2.http.Header("enum_header_string") String enumHeaderString + + +, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray + + + + +, @retrofit2.http.Query("enum_query_string") String enumQueryString + + + + +, @retrofit2.http.Query("enum_query_integer") BigDecimal enumQueryInteger + + + + +, + + + +@retrofit2.http.Field("enum_query_double") Double enumQueryDouble + ); } 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 index 77cfd8ae3de1..cc6a867c7557 100644 --- 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 @@ -27,7 +27,12 @@ public interface PetApi { @POST("pet") Observable addPet( - @Body Pet body + + + +@retrofit2.http.Body Pet body + + ); /** @@ -40,7 +45,17 @@ public interface PetApi { @DELETE("pet/{petId}") Observable deletePet( - @Path("petId") Long petId, @Header("api_key") String apiKey + +@retrofit2.http.Path("petId") Long petId + + + +, + +@retrofit2.http.Header("api_key") String apiKey + + + ); /** @@ -52,7 +67,12 @@ public interface PetApi { @GET("pet/findByStatus") Observable> findPetsByStatus( - @Query("status") CSVParams status + @retrofit2.http.Query("status") CSVParams status + + + + + ); /** @@ -64,7 +84,12 @@ public interface PetApi { @GET("pet/findByTags") Observable> findPetsByTags( - @Query("tags") CSVParams tags + @retrofit2.http.Query("tags") CSVParams tags + + + + + ); /** @@ -76,7 +101,12 @@ public interface PetApi { @GET("pet/{petId}") Observable getPetById( - @Path("petId") Long petId + +@retrofit2.http.Path("petId") Long petId + + + + ); /** @@ -88,7 +118,12 @@ public interface PetApi { @PUT("pet") Observable updatePet( - @Body Pet body + + + +@retrofit2.http.Body Pet body + + ); /** @@ -100,10 +135,25 @@ public interface PetApi { * @return Call<Void> */ - @FormUrlEncoded + @retrofit2.http.FormUrlEncoded @POST("pet/{petId}") Observable updatePetWithForm( - @Path("petId") Long petId, @Field("name") String name, @Field("status") String status + +@retrofit2.http.Path("petId") Long petId + + + +, + + + +@retrofit2.http.Field("name") String name +, + + + +@retrofit2.http.Field("status") String status + ); /** @@ -115,10 +165,25 @@ public interface PetApi { * @return Call<ModelApiResponse> */ - @Multipart + @retrofit2.http.Multipart @POST("pet/{petId}/uploadImage") Observable uploadFile( - @Path("petId") Long petId, @Part("additionalMetadata") String additionalMetadata, @Part("file\"; filename=\"file") RequestBody file + +@retrofit2.http.Path("petId") Long petId + + + +, + + + +@retrofit2.http.Part("additionalMetadata") String additionalMetadata +, + + + +@retrofit2.http.Part("file\"; filename=\"file") RequestBody file + ); } 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 index 4e93813692d0..f763e317070d 100644 --- 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 @@ -25,7 +25,12 @@ public interface StoreApi { @DELETE("store/order/{orderId}") Observable deleteOrder( - @Path("orderId") String orderId + +@retrofit2.http.Path("orderId") String orderId + + + + ); /** @@ -47,7 +52,12 @@ public interface StoreApi { @GET("store/order/{orderId}") Observable getOrderById( - @Path("orderId") Long orderId + +@retrofit2.http.Path("orderId") Long orderId + + + + ); /** @@ -59,7 +69,12 @@ public interface StoreApi { @POST("store/order") Observable placeOrder( - @Body Order body + + + +@retrofit2.http.Body Order body + + ); } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java index 24a05ec40b8f..4f13893a8f83 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java @@ -25,7 +25,12 @@ public interface UserApi { @POST("user") Observable createUser( - @Body User body + + + +@retrofit2.http.Body User body + + ); /** @@ -37,7 +42,12 @@ public interface UserApi { @POST("user/createWithArray") Observable createUsersWithArrayInput( - @Body List body + + + +@retrofit2.http.Body List body + + ); /** @@ -49,7 +59,12 @@ public interface UserApi { @POST("user/createWithList") Observable createUsersWithListInput( - @Body List body + + + +@retrofit2.http.Body List body + + ); /** @@ -61,7 +76,12 @@ public interface UserApi { @DELETE("user/{username}") Observable deleteUser( - @Path("username") String username + +@retrofit2.http.Path("username") String username + + + + ); /** @@ -73,7 +93,12 @@ public interface UserApi { @GET("user/{username}") Observable getUserByName( - @Path("username") String username + +@retrofit2.http.Path("username") String username + + + + ); /** @@ -86,7 +111,17 @@ public interface UserApi { @GET("user/login") Observable loginUser( - @Query("username") String username, @Query("password") String password + @retrofit2.http.Query("username") String username + + + + +, @retrofit2.http.Query("password") String password + + + + + ); /** @@ -109,7 +144,17 @@ public interface UserApi { @PUT("user/{username}") Observable updateUser( - @Path("username") String username, @Body User body + +@retrofit2.http.Path("username") String username + + + +, + + +@retrofit2.http.Body User body + + ); } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index d20b1402ce2f..81d139e630b7 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -33,12 +33,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - /** * AdditionalPropertiesClass */ -public class AdditionalPropertiesClass { +public class AdditionalPropertiesClass { @SerializedName("map_property") private Map mapProperty = new HashMap(); @@ -131,5 +130,6 @@ public class AdditionalPropertiesClass { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java index 9b1ff3df1c55..bc73c4f93cb6 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Animal */ -public class Animal { +public class Animal { @SerializedName("className") private String className = null; @@ -118,5 +117,6 @@ public class Animal { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AnimalFarm.java index 563476ccb3db..8a50c9c6cb5f 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -30,12 +30,11 @@ import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; - /** * AnimalFarm */ -public class AnimalFarm extends ArrayList { +public class AnimalFarm extends ArrayList { @Override public boolean equals(java.lang.Object o) { @@ -72,5 +71,6 @@ public class AnimalFarm extends ArrayList { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 4c2fa22800f3..e0dde620ab43 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -33,12 +33,11 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; - /** * ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnly { +public class ArrayOfArrayOfNumberOnly { @SerializedName("ArrayArrayNumber") private List> arrayArrayNumber = new ArrayList>(); @@ -103,5 +102,6 @@ public class ArrayOfArrayOfNumberOnly { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 3c7d74dc3b5c..e529ebc4fa84 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -33,12 +33,11 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; - /** * ArrayOfNumberOnly */ -public class ArrayOfNumberOnly { +public class ArrayOfNumberOnly { @SerializedName("ArrayNumber") private List arrayNumber = new ArrayList(); @@ -103,5 +102,6 @@ public class ArrayOfNumberOnly { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java index 7e08b24fa6ed..80df1b341f51 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java @@ -33,12 +33,11 @@ import io.swagger.client.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; - /** * ArrayTest */ -public class ArrayTest { +public class ArrayTest { @SerializedName("array_of_string") private List arrayOfString = new ArrayList(); @@ -159,5 +158,6 @@ public class ArrayTest { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java index 9c5cb39f6483..10a2f2c5c8d9 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java @@ -31,12 +31,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; - /** * Cat */ -public class Cat extends Animal { +public class Cat extends Animal { @SerializedName("declawed") private Boolean declawed = null; @@ -97,5 +96,6 @@ public class Cat extends Animal { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java index 44e76030effc..153df9edbfa0 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Category */ -public class Category { +public class Category { @SerializedName("id") private Long id = null; @@ -118,5 +117,6 @@ public class Category { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Client.java index 54a54647918d..1eb9e755db37 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Client.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Client */ -public class Client { +public class Client { @SerializedName("client") private String client = null; @@ -95,5 +94,6 @@ public class Client { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java index 880c159616c9..079def9ecc6e 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java @@ -31,12 +31,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; - /** * Dog */ -public class Dog extends Animal { +public class Dog extends Animal { @SerializedName("breed") private String breed = null; @@ -97,5 +96,6 @@ public class Dog extends Animal { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java index c50967387551..7eea2d2a9118 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java @@ -32,12 +32,11 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; - /** * EnumArrays */ -public class EnumArrays { +public class EnumArrays { /** * Gets or Sets justSymbol */ @@ -169,5 +168,6 @@ public class EnumArrays { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumClass.java index 7862a8b89526..a6072c381c4a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumClass.java @@ -29,7 +29,6 @@ import java.util.Objects; import com.google.gson.annotations.SerializedName; - /** * Gets or Sets EnumClass */ diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java index 83896fbd849d..bdd3a40bb28b 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * EnumTest */ -public class EnumTest { +public class EnumTest { /** * Gets or Sets enumString */ @@ -207,5 +206,6 @@ public class EnumTest { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java index a05f1d5c811b..023042b8d967 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java @@ -33,12 +33,11 @@ import java.math.BigDecimal; import org.joda.time.DateTime; import org.joda.time.LocalDate; - /** * FormatTest */ -public class FormatTest { +public class FormatTest { @SerializedName("integer") private Integer integer = null; @@ -384,5 +383,6 @@ public class FormatTest { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index e53b1a0d8be6..43a5b6a6c92a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * HasOnlyReadOnly */ -public class HasOnlyReadOnly { +public class HasOnlyReadOnly { @SerializedName("bar") private String bar = null; @@ -100,5 +99,6 @@ public class HasOnlyReadOnly { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java index e7d394ed035d..75586c606c94 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java @@ -33,12 +33,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - /** * MapTest */ -public class MapTest { +public class MapTest { @SerializedName("map_map_of_string") private Map> mapMapOfString = new HashMap>(); @@ -153,5 +152,6 @@ public class MapTest { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 887ba516d72a..e6b8987656af 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -35,12 +35,11 @@ import java.util.List; import java.util.Map; import org.joda.time.DateTime; - /** * MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClass { +public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName("uuid") private String uuid = null; @@ -151,5 +150,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Model200Response.java index 980bc83e8692..eabc63cd3898 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Model200Response.java @@ -30,13 +30,12 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") -public class Model200Response { +public class Model200Response { @SerializedName("name") private Integer name = null; @@ -119,5 +118,6 @@ public class Model200Response { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java index f9c162a7934a..e410a24757fa 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * ModelApiResponse */ -public class ModelApiResponse { +public class ModelApiResponse { @SerializedName("code") private Integer code = null; @@ -141,5 +140,6 @@ public class ModelApiResponse { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java index bbe7780055c2..01d69fecb681 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java @@ -30,13 +30,12 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") -public class ModelReturn { +public class ModelReturn { @SerializedName("return") private Integer _return = null; @@ -96,5 +95,6 @@ public class ModelReturn { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Name.java index d51354ceffa8..c50f477abc3c 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Name.java @@ -30,13 +30,12 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") -public class Name { +public class Name { @SerializedName("name") private Integer name = null; @@ -147,5 +146,6 @@ public class Name { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java index 2b1817300a97..0653baec68bc 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java @@ -31,12 +31,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; - /** * NumberOnly */ -public class NumberOnly { +public class NumberOnly { @SerializedName("JustNumber") private BigDecimal justNumber = null; @@ -96,5 +95,6 @@ public class NumberOnly { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java index f52e7bd5db47..d15cca81e050 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java @@ -31,12 +31,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.joda.time.DateTime; - /** * Order */ -public class Order { +public class Order { @SerializedName("id") private Long id = null; @@ -236,5 +235,6 @@ public class Order { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java index 06443e569153..2363e9ed02ed 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java @@ -34,12 +34,11 @@ import io.swagger.client.model.Tag; import java.util.ArrayList; import java.util.List; - /** * Pet */ -public class Pet { +public class Pet { @SerializedName("id") private Long id = null; @@ -249,5 +248,6 @@ public class Pet { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 75dbc55f9f5c..f9f1503366fc 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * ReadOnlyFirst */ -public class ReadOnlyFirst { +public class ReadOnlyFirst { @SerializedName("bar") private String bar = null; @@ -109,5 +108,6 @@ public class ReadOnlyFirst { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/SpecialModelName.java index 9744ad082689..10d56096dea2 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * SpecialModelName */ -public class SpecialModelName { +public class SpecialModelName { @SerializedName("$special[property.name]") private Long specialPropertyName = null; @@ -95,5 +94,6 @@ public class SpecialModelName { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java index 9eef0141c711..11870f0f0a82 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Tag */ -public class Tag { +public class Tag { @SerializedName("id") private Long id = null; @@ -118,5 +117,6 @@ public class Tag { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java index 73584bfdccbd..b04dc861682a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java @@ -30,12 +30,11 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * User */ -public class User { +public class User { @SerializedName("id") private Long id = null; @@ -256,5 +255,6 @@ public class User { } return o.toString().replace("\n", "\n "); } + } From da6e829c8e1bbcdd48a3bc69370ef04595252821 Mon Sep 17 00:00:00 2001 From: Oliver Vidovic Date: Tue, 11 Oct 2016 11:43:54 -0400 Subject: [PATCH 4/9] issue-890 correct fix for deprecated Jersey method additionally - fixed EnumValueTest to the directory structure based on the declared package - regenerated samples/client/java/jersey1 --- .../src/main/resources/Java/ApiClient.mustache | 2 +- samples/client/petstore/java/jersey1/docs/FakeApi.md | 6 ++++-- .../jersey1/src/main/java/io/swagger/client/ApiClient.java | 2 +- .../src/main/java/io/swagger/client/RFC3339DateFormat.java | 2 +- .../src/main/java/io/swagger/client/api/FakeApi.java | 5 ++++- .../io/swagger/client/model/AdditionalPropertiesClass.java | 4 ++-- .../src/main/java/io/swagger/client/model/Animal.java | 4 ++-- .../src/main/java/io/swagger/client/model/AnimalFarm.java | 4 ++-- .../io/swagger/client/model/ArrayOfArrayOfNumberOnly.java | 4 ++-- .../java/io/swagger/client/model/ArrayOfNumberOnly.java | 4 ++-- .../src/main/java/io/swagger/client/model/ArrayTest.java | 4 ++-- .../jersey1/src/main/java/io/swagger/client/model/Cat.java | 4 ++-- .../src/main/java/io/swagger/client/model/Category.java | 4 ++-- .../src/main/java/io/swagger/client/model/Client.java | 4 ++-- .../jersey1/src/main/java/io/swagger/client/model/Dog.java | 4 ++-- .../src/main/java/io/swagger/client/model/EnumArrays.java | 4 ++-- .../src/main/java/io/swagger/client/model/EnumClass.java | 1 - .../src/main/java/io/swagger/client/model/EnumTest.java | 4 ++-- .../src/main/java/io/swagger/client/model/FormatTest.java | 4 ++-- .../main/java/io/swagger/client/model/HasOnlyReadOnly.java | 4 ++-- .../src/main/java/io/swagger/client/model/MapTest.java | 4 ++-- .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 4 ++-- .../main/java/io/swagger/client/model/Model200Response.java | 4 ++-- .../main/java/io/swagger/client/model/ModelApiResponse.java | 4 ++-- .../src/main/java/io/swagger/client/model/ModelReturn.java | 4 ++-- .../jersey1/src/main/java/io/swagger/client/model/Name.java | 4 ++-- .../src/main/java/io/swagger/client/model/NumberOnly.java | 4 ++-- .../src/main/java/io/swagger/client/model/Order.java | 4 ++-- .../jersey1/src/main/java/io/swagger/client/model/Pet.java | 4 ++-- .../main/java/io/swagger/client/model/ReadOnlyFirst.java | 4 ++-- .../main/java/io/swagger/client/model/SpecialModelName.java | 4 ++-- .../jersey1/src/main/java/io/swagger/client/model/Tag.java | 4 ++-- .../jersey1/src/main/java/io/swagger/client/model/User.java | 4 ++-- .../io/swagger/client/{api => }/model/EnumValueTest.java | 0 34 files changed, 65 insertions(+), 61 deletions(-) rename samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/{api => }/model/EnumValueTest.java (100%) diff --git a/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache index 3209498e2346..c34dd51dcea9 100644 --- a/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache @@ -609,7 +609,7 @@ public class ApiClient { statusCode = response.getStatusInfo().getStatusCode(); responseHeaders = response.getHeaders(); - if(response.getStatusInfo() == ClientResponse.Status.NO_CONTENT) { + if(response.getStatusInfo().getStatusCode() == ClientResponse.Status.NO_CONTENT.getStatusCode()) { return null; } else if (response.getStatusInfo().getFamily() == Family.SUCCESSFUL) { if (returnType == null) diff --git a/samples/client/petstore/java/jersey1/docs/FakeApi.md b/samples/client/petstore/java/jersey1/docs/FakeApi.md index 9012aff618e2..29813bd93492 100644 --- a/samples/client/petstore/java/jersey1/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey1/docs/FakeApi.md @@ -54,7 +54,7 @@ No authorization required # **testEndpointParameters** -> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password) +> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -90,8 +90,9 @@ byte[] binary = B; // byte[] | None LocalDate date = new LocalDate(); // LocalDate | None DateTime dateTime = new DateTime(); // DateTime | None String password = "password_example"; // String | None +String paramCallback = "paramCallback_example"; // String | None try { - apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password); + apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); e.printStackTrace(); @@ -115,6 +116,7 @@ Name | Type | Description | Notes **date** | **LocalDate**| None | [optional] **dateTime** | **DateTime**| None | [optional] **password** | **String**| None | [optional] + **paramCallback** | **String**| None | [optional] ### Return type diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java index f371fe400cf5..040449d3e4be 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java @@ -622,7 +622,7 @@ public class ApiClient { statusCode = response.getStatusInfo().getStatusCode(); responseHeaders = response.getHeaders(); - if(response.getStatusInfo() == ClientResponse.Status.NO_CONTENT) { + if(response.getStatusInfo().getStatusCode() == ClientResponse.Status.NO_CONTENT.getStatusCode()) { return null; } else if (response.getStatusInfo().getFamily() == Family.SUCCESSFUL) { if (returnType == null) diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/RFC3339DateFormat.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/RFC3339DateFormat.java index 3d287008be5c..d662f9457d7a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/RFC3339DateFormat.java @@ -1,4 +1,4 @@ -/** +/* * Swagger Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java index bbf7b7115139..bfa6f66e56d5 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java @@ -120,9 +120,10 @@ public class FakeApi { * @param date None (optional) * @param dateTime None (optional) * @param password None (optional) + * @param paramCallback None (optional) * @throws ApiException if fails to make API call */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, DateTime dateTime, String password) throws ApiException { + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, DateTime dateTime, String password, String paramCallback) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'number' is set @@ -181,6 +182,8 @@ if (dateTime != null) localVarFormParams.put("dateTime", dateTime); if (password != null) localVarFormParams.put("password", password); +if (paramCallback != null) + localVarFormParams.put("callback", paramCallback); final String[] localVarAccepts = { "application/xml; charset=utf-8", "application/json; charset=utf-8" diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 2da13804a0d6..db74fca66a7c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -34,12 +34,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - /** * AdditionalPropertiesClass */ -public class AdditionalPropertiesClass { +public class AdditionalPropertiesClass { @JsonProperty("map_property") private Map mapProperty = new HashMap(); @@ -132,5 +131,6 @@ public class AdditionalPropertiesClass { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Animal.java index 346da224ad12..6799afd7bebf 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Animal.java @@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Animal */ -public class Animal { +public class Animal { @JsonProperty("className") private String className = null; @@ -119,5 +118,6 @@ public class Animal { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AnimalFarm.java index 563476ccb3db..8a50c9c6cb5f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -30,12 +30,11 @@ import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; - /** * AnimalFarm */ -public class AnimalFarm extends ArrayList { +public class AnimalFarm extends ArrayList { @Override public boolean equals(java.lang.Object o) { @@ -72,5 +71,6 @@ public class AnimalFarm extends ArrayList { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index a99f20093850..e57ce230767d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,12 +34,11 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; - /** * ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnly { +public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") private List> arrayArrayNumber = new ArrayList>(); @@ -104,5 +103,6 @@ public class ArrayOfArrayOfNumberOnly { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 1aaf27b9921d..6dafaf06c62d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -34,12 +34,11 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; - /** * ArrayOfNumberOnly */ -public class ArrayOfNumberOnly { +public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") private List arrayNumber = new ArrayList(); @@ -104,5 +103,6 @@ public class ArrayOfNumberOnly { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java index 124d8bfa3a1f..8bb3d0c57b7b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java @@ -34,12 +34,11 @@ import io.swagger.client.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; - /** * ArrayTest */ -public class ArrayTest { +public class ArrayTest { @JsonProperty("array_of_string") private List arrayOfString = new ArrayList(); @@ -160,5 +159,6 @@ public class ArrayTest { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java index 41dc312a10f4..949df4491993 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java @@ -32,12 +32,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; - /** * Cat */ -public class Cat extends Animal { +public class Cat extends Animal { @JsonProperty("declawed") private Boolean declawed = null; @@ -98,5 +97,6 @@ public class Cat extends Animal { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Category.java index ba4ce89c2975..b8e278b2a749 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Category.java @@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Category */ -public class Category { +public class Category { @JsonProperty("id") private Long id = null; @@ -119,5 +118,6 @@ public class Category { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Client.java index 43ade4b6fcb7..024f8cb3b72b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Client.java @@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Client */ -public class Client { +public class Client { @JsonProperty("client") private String client = null; @@ -96,5 +95,6 @@ public class Client { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Dog.java index 788aee5c2262..00e981ab4346 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Dog.java @@ -32,12 +32,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.client.model.Animal; - /** * Dog */ -public class Dog extends Animal { +public class Dog extends Animal { @JsonProperty("breed") private String breed = null; @@ -98,5 +97,6 @@ public class Dog extends Animal { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java index 45295c524f60..140473801800 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java @@ -33,12 +33,11 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; - /** * EnumArrays */ -public class EnumArrays { +public class EnumArrays { /** * Gets or Sets justSymbol */ @@ -186,5 +185,6 @@ public class EnumArrays { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumClass.java index f9887c69340e..c2f4ae537357 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumClass.java @@ -27,7 +27,6 @@ package io.swagger.client.model; import java.util.Objects; - import com.fasterxml.jackson.annotation.JsonCreator; /** diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumTest.java index a7268316c401..53665518adb3 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumTest.java @@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * EnumTest */ -public class EnumTest { +public class EnumTest { /** * Gets or Sets enumString */ @@ -232,5 +231,6 @@ public class EnumTest { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/FormatTest.java index 2b5b42042812..b7f9513f03c6 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/FormatTest.java @@ -34,12 +34,11 @@ import java.math.BigDecimal; import org.joda.time.DateTime; import org.joda.time.LocalDate; - /** * FormatTest */ -public class FormatTest { +public class FormatTest { @JsonProperty("integer") private Integer integer = null; @@ -385,5 +384,6 @@ public class FormatTest { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index d874a5452448..1cd90edaae84 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * HasOnlyReadOnly */ -public class HasOnlyReadOnly { +public class HasOnlyReadOnly { @JsonProperty("bar") private String bar = null; @@ -101,5 +100,6 @@ public class HasOnlyReadOnly { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java index f8cf1ad5d1a5..60751c48d8c3 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java @@ -34,12 +34,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - /** * MapTest */ -public class MapTest { +public class MapTest { @JsonProperty("map_map_of_string") private Map> mapMapOfString = new HashMap>(); @@ -162,5 +161,6 @@ public class MapTest { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 20958fd50d8a..b738c397191f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -36,12 +36,11 @@ import java.util.List; import java.util.Map; import org.joda.time.DateTime; - /** * MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClass { +public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") private String uuid = null; @@ -152,5 +151,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Model200Response.java index 8f48dd8020e0..849f208ff7ae 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Model200Response.java @@ -31,13 +31,12 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") -public class Model200Response { +public class Model200Response { @JsonProperty("name") private Integer name = null; @@ -120,5 +119,6 @@ public class Model200Response { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelApiResponse.java index 70ee2a834c01..79d704bc1bfd 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * ModelApiResponse */ -public class ModelApiResponse { +public class ModelApiResponse { @JsonProperty("code") private Integer code = null; @@ -142,5 +141,6 @@ public class ModelApiResponse { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelReturn.java index 28294a150909..0d85efb9884d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelReturn.java @@ -31,13 +31,12 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") -public class ModelReturn { +public class ModelReturn { @JsonProperty("return") private Integer _return = null; @@ -97,5 +96,6 @@ public class ModelReturn { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Name.java index 4b70e8df1a61..cc3e7252197e 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Name.java @@ -31,13 +31,12 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") -public class Name { +public class Name { @JsonProperty("name") private Integer name = null; @@ -148,5 +147,6 @@ public class Name { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/NumberOnly.java index ad74058d2e51..c7eb42d616cd 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/NumberOnly.java @@ -32,12 +32,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; - /** * NumberOnly */ -public class NumberOnly { +public class NumberOnly { @JsonProperty("JustNumber") private BigDecimal justNumber = null; @@ -97,5 +96,6 @@ public class NumberOnly { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java index 1616b030b9dc..6dd1a55c5431 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java @@ -32,12 +32,11 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.joda.time.DateTime; - /** * Order */ -public class Order { +public class Order { @JsonProperty("id") private Long id = null; @@ -244,5 +243,6 @@ public class Order { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java index a89e0ea3e050..06e43f726f34 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java @@ -35,12 +35,11 @@ import io.swagger.client.model.Tag; import java.util.ArrayList; import java.util.List; - /** * Pet */ -public class Pet { +public class Pet { @JsonProperty("id") private Long id = null; @@ -257,5 +256,6 @@ public class Pet { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 63e11bf14fde..5c7ed3ec0a6c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * ReadOnlyFirst */ -public class ReadOnlyFirst { +public class ReadOnlyFirst { @JsonProperty("bar") private String bar = null; @@ -110,5 +109,6 @@ public class ReadOnlyFirst { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/SpecialModelName.java index f8c5c06ca40a..74695119c3e1 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * SpecialModelName */ -public class SpecialModelName { +public class SpecialModelName { @JsonProperty("$special[property.name]") private Long specialPropertyName = null; @@ -96,5 +95,6 @@ public class SpecialModelName { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Tag.java index 27be94678da8..a886efeac4b7 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Tag.java @@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * Tag */ -public class Tag { +public class Tag { @JsonProperty("id") private Long id = null; @@ -119,5 +118,6 @@ public class Tag { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/User.java index 84e3b147049e..f73fff70097f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/User.java @@ -31,12 +31,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - /** * User */ -public class User { +public class User { @JsonProperty("id") private Long id = null; @@ -257,5 +256,6 @@ public class User { } return o.toString().replace("\n", "\n "); } + } diff --git a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/model/EnumValueTest.java b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/model/EnumValueTest.java similarity index 100% rename from samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/model/EnumValueTest.java rename to samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/model/EnumValueTest.java From 0a2d62a8ba2ecfd479ee2a4449f3af40c036a931 Mon Sep 17 00:00:00 2001 From: Jason Gavris Date: Tue, 11 Oct 2016 12:44:53 -0400 Subject: [PATCH 5/9] [Swift] Add / as enum separator --- .../main/java/io/swagger/codegen/languages/SwiftCodegen.java | 4 ++-- .../test/java/io/swagger/codegen/swift/SwiftCodegenTest.java | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java index dc5969fc4b3f..b9595c163a68 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java @@ -396,8 +396,8 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig { return value; } - char[] separators = {'-', '_', ' ', ':'}; - return WordUtils.capitalizeFully(StringUtils.lowerCase(value), separators).replaceAll("[-_ :]", ""); + char[] separators = {'-', '_', ' ', ':', '/'}; + return WordUtils.capitalizeFully(StringUtils.lowerCase(value), separators).replaceAll("[-_ :/]", ""); } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/swift/SwiftCodegenTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/swift/SwiftCodegenTest.java index 0fbfcf5efea3..62a6fb58482a 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/swift/SwiftCodegenTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/swift/SwiftCodegenTest.java @@ -49,6 +49,11 @@ public class SwiftCodegenTest { Assert.assertEquals(swiftCodegen.toSwiftyEnumName("entry_name"), "EntryName"); } + @Test + public void testSlash() throws Exception { + Assert.assertEquals(swiftCodegen.toSwiftyEnumName("application/x-tar"), "ApplicationXTar"); + } + @Test(description = "returns NSData when response format is binary") public void binaryDataTest() { final Swagger model = new SwaggerParser().read("src/test/resources/2_0/binaryDataTest.json"); From 823ce72e2e0748172d9c7e7265f5f2c719a99fa8 Mon Sep 17 00:00:00 2001 From: Nick Maynard Date: Wed, 12 Oct 2016 08:43:44 +0100 Subject: [PATCH 6/9] jaxrs-cxf-cdi POM template (#3958) * Don't refer to missing class in Impl classes * Add POM for jaxrs-cxf-cdi * Correct jaxrs-cxf-cdi artifactId * Update samples for jaxrs-cxf-cdi * Regenerate jaxrs-cxf-cdi samples --- .../JavaJAXRSCXFCDIServerCodegen.java | 29 ++++--- .../JavaJaxRS/cxf-cdi/apiServiceImpl.mustache | 2 +- .../resources/JavaJaxRS/cxf-cdi/pom.mustache | 82 +++++++++++++++++++ samples/server/petstore/jaxrs-cxf-cdi/pom.xml | 82 +++++++++++++++++++ .../java/io/swagger/api/PetApiService.java | 2 +- .../java/io/swagger/api/StoreApiService.java | 2 +- .../java/io/swagger/api/UserApiService.java | 2 +- .../swagger/api/impl/PetApiServiceImpl.java | 19 ++--- .../swagger/api/impl/StoreApiServiceImpl.java | 11 ++- .../swagger/api/impl/UserApiServiceImpl.java | 19 ++--- 10 files changed, 208 insertions(+), 42 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache create mode 100644 samples/server/petstore/jaxrs-cxf-cdi/pom.xml diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java index ba6737388dc2..6dcf3f580759 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java @@ -1,5 +1,6 @@ package io.swagger.codegen.languages; +import io.swagger.codegen.*; import io.swagger.codegen.CodegenModel; import io.swagger.codegen.CodegenProperty; @@ -9,17 +10,19 @@ public class JavaJAXRSCXFCDIServerCodegen extends JavaJAXRSSpecServerCodegen { public JavaJAXRSCXFCDIServerCodegen() { - sourceFolder = "src" + File.separator + "gen" + File.separator + "java"; + artifactId = "swagger-jaxrs-cxf-cdi-server"; - // Three API templates to support CDI injection - apiTemplateFiles.put("apiService.mustache", ".java"); - apiTemplateFiles.put("apiServiceImpl.mustache", ".java"); + sourceFolder = "src" + File.separator + "gen" + File.separator + "java"; - // Use standard types - typeMapping.put("DateTime", "java.util.Date"); + // Three API templates to support CDI injection + apiTemplateFiles.put("apiService.mustache", ".java"); + apiTemplateFiles.put("apiServiceImpl.mustache", ".java"); - // Updated template directory - embeddedTemplateDir = templateDir = JAXRS_TEMPLATE_DIRECTORY_NAME + File.separator + "cxf-cdi"; + // Use standard types + typeMapping.put("DateTime", "java.util.Date"); + + // Updated template directory + embeddedTemplateDir = templateDir = JAXRS_TEMPLATE_DIRECTORY_NAME + File.separator + "cxf-cdi"; } @Override @@ -34,20 +37,22 @@ public class JavaJAXRSCXFCDIServerCodegen extends JavaJAXRSSpecServerCodegen super.processOpts(); supportingFiles.clear(); // Don't need extra files provided by AbstractJAX-RS & Java Codegen + + writeOptional(outputFolder, new SupportingFile("pom.mustache", "", "pom.xml")); } @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { - super.postProcessModelProperty(model, property); + super.postProcessModelProperty(model, property); - // Reinstate JsonProperty - model.imports.add("JsonProperty"); + // Reinstate JsonProperty + model.imports.add("JsonProperty"); } @Override public String getHelp() { - return "Generates a Java JAXRS Server according to JAXRS 2.0 specification, assuming an Apache CXF runtime and a Java EE runtime with CDI enabled."; + return "Generates a Java JAXRS Server according to JAXRS 2.0 specification, assuming an Apache CXF runtime and a Java EE runtime with CDI enabled."; } } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/apiServiceImpl.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/apiServiceImpl.mustache index 86c0d8722917..bce7fe5e9307 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/apiServiceImpl.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/apiServiceImpl.mustache @@ -24,7 +24,7 @@ public class {{classname}}ServiceImpl implements {{classname}}Service { @Override public Response {{nickname}}({{#allParams}}{{>serviceQueryParams}}{{>servicePathParams}}{{>serviceHeaderParams}}{{>serviceBodyParams}}{{>serviceFormParams}}, {{/allParams}}SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } {{/operation}} } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache new file mode 100644 index 000000000000..a5a683b9748d --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache @@ -0,0 +1,82 @@ + + 4.0.0 + {{groupId}} + {{artifactId}} + war + {{artifactId}} + {{artifactVersion}} + + + + src/main/java + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + + + + maven-war-plugin + 3.0.0 + + false + + + + + + + + + + javax + javaee-api + 7.0 + provided + + + + + org.apache.cxf + cxf-rt-frontend-jaxrs + + + 3.0.2 + provided + + + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + [2.8.3,3) + + + + + io.swagger + swagger-annotations + [1.5.3,2) + + + + + \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/pom.xml b/samples/server/petstore/jaxrs-cxf-cdi/pom.xml new file mode 100644 index 000000000000..4534f2961ac3 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf-cdi/pom.xml @@ -0,0 +1,82 @@ + + 4.0.0 + io.swagger + swagger-jaxrs-cxf-cdi-server + war + swagger-jaxrs-cxf-cdi-server + 1.0.0 + + + + src/main/java + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + + + + maven-war-plugin + 3.0.0 + + false + + + + + + + + + + javax + javaee-api + 7.0 + provided + + + + + org.apache.cxf + cxf-rt-frontend-jaxrs + + + 3.0.2 + provided + + + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + [2.8.3,3) + + + + + io.swagger + swagger-annotations + [1.5.3,2) + + + + + \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java index b982f07c1e0a..2505bbee827c 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/PetApiService.java @@ -16,7 +16,7 @@ import java.io.InputStream; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-10-07T11:14:51.064+01:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-10-11T07:40:42.070+01:00") public interface PetApiService { public Response addPet(Pet body, SecurityContext securityContext); public Response deletePet(Long petId, String apiKey, SecurityContext securityContext); diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java index 5f3c38f2fbc4..2dc8535c8e52 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/StoreApiService.java @@ -15,7 +15,7 @@ import java.io.InputStream; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-10-07T11:14:51.064+01:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-10-11T07:40:42.070+01:00") public interface StoreApiService { public Response deleteOrder(String orderId, SecurityContext securityContext); public Response getInventory(SecurityContext securityContext); diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java index 5a8b782cd6b6..f8c61f5f0a02 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/api/UserApiService.java @@ -15,7 +15,7 @@ import java.io.InputStream; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-10-07T11:14:51.064+01:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-10-11T07:40:42.070+01:00") public interface UserApiService { public Response createUser(User body, SecurityContext securityContext); public Response createUsersWithArrayInput(List body, SecurityContext securityContext); diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java index cac1469aca1e..7923a562ad6c 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/PetApiServiceImpl.java @@ -10,7 +10,6 @@ import io.swagger.model.ModelApiResponse; import java.io.File; import java.util.List; -import io.swagger.api.NotFoundException; import java.io.InputStream; @@ -19,46 +18,46 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; @RequestScoped -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-10-06T16:59:45.939+01:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-10-11T07:40:42.070+01:00") public class PetApiServiceImpl implements PetApiService { @Override public Response addPet(Pet body, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } @Override public Response deletePet(Long petId, String apiKey, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } @Override public Response findPetsByStatus(List status, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } @Override public Response findPetsByTags(List tags, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } @Override public Response getPetById(Long petId, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } @Override public Response updatePet(Pet body, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } @Override public Response updatePetWithForm(Long petId, String name, String status, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } @Override public Response uploadFile(Long petId, String additionalMetadata, InputStream fileInputStream, Attachment fileDetail, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java index 75ac7c475df4..9dfc758effd2 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/StoreApiServiceImpl.java @@ -9,7 +9,6 @@ import java.util.Map; import io.swagger.model.Order; import java.util.List; -import io.swagger.api.NotFoundException; import java.io.InputStream; @@ -18,26 +17,26 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; @RequestScoped -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-10-06T16:59:45.939+01:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-10-11T07:40:42.070+01:00") public class StoreApiServiceImpl implements StoreApiService { @Override public Response deleteOrder(String orderId, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } @Override public Response getInventory(SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } @Override public Response getOrderById(Long orderId, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } @Override public Response placeOrder(Order body, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java index c05deea0ad2c..cf89da4b47a0 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java @@ -9,7 +9,6 @@ import io.swagger.model.User; import java.util.List; import java.util.List; -import io.swagger.api.NotFoundException; import java.io.InputStream; @@ -18,46 +17,46 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; @RequestScoped -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-10-06T16:59:45.939+01:00") +@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen", date = "2016-10-11T07:40:42.070+01:00") public class UserApiServiceImpl implements UserApiService { @Override public Response createUser(User body, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } @Override public Response createUsersWithArrayInput(List body, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } @Override public Response createUsersWithListInput(List body, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } @Override public Response deleteUser(String username, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } @Override public Response getUserByName(String username, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } @Override public Response loginUser(String username, String password, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } @Override public Response logoutUser(SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } @Override public Response updateUser(String username, User body, SecurityContext securityContext) { // do some magic! - return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + return Response.ok().entity("magic!").build(); } } From 47d3c3a7678ccd92d829f09d2b8b95a49a38f263 Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 12 Oct 2016 15:48:34 +0800 Subject: [PATCH 7/9] update retrofit1,2 samples --- .../client/petstore/java/retrofit/gradlew.bat | 180 ++++++------- .../java/io/swagger/client/api/FakeApi.java | 244 +----------------- .../java/io/swagger/client/api/PetApi.java | 160 ++---------- .../java/io/swagger/client/api/StoreApi.java | 42 +-- .../java/io/swagger/client/api/UserApi.java | 118 +-------- .../petstore/java/retrofit2/gradlew.bat | 180 ++++++------- .../java/io/swagger/client/api/FakeApi.java | 123 +-------- .../java/io/swagger/client/api/PetApi.java | 79 +----- .../java/io/swagger/client/api/StoreApi.java | 21 +- .../java/io/swagger/client/api/UserApi.java | 59 +---- .../petstore/java/retrofit2rx/docs/FakeApi.md | 6 +- .../petstore/java/retrofit2rx/gradlew.bat | 180 ++++++------- .../java/io/swagger/client/api/FakeApi.java | 123 +-------- .../java/io/swagger/client/api/PetApi.java | 79 +----- .../java/io/swagger/client/api/StoreApi.java | 21 +- .../java/io/swagger/client/api/UserApi.java | 59 +---- 16 files changed, 358 insertions(+), 1316 deletions(-) diff --git a/samples/client/petstore/java/retrofit/gradlew.bat b/samples/client/petstore/java/retrofit/gradlew.bat index 72d362dafd89..5f192121eb4f 100644 --- a/samples/client/petstore/java/retrofit/gradlew.bat +++ b/samples/client/petstore/java/retrofit/gradlew.bat @@ -1,90 +1,90 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java index e1c4644feea6..0f8f39758144 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java @@ -8,8 +8,8 @@ import retrofit.mime.*; import io.swagger.client.model.Client; import org.joda.time.LocalDate; -import java.math.BigDecimal; import org.joda.time.DateTime; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; @@ -27,12 +27,7 @@ public interface FakeApi { @PATCH("/fake") Client testClientModel( - - - -@retrofit.http.Body Client body - - + @retrofit.http.Body Client body ); /** @@ -45,12 +40,7 @@ public interface FakeApi { @PATCH("/fake") void testClientModel( - - - -@retrofit.http.Body Client body - -, Callback cb + @retrofit.http.Body Client body, Callback cb ); /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -76,77 +66,7 @@ public interface FakeApi { @retrofit.http.FormUrlEncoded @POST("/fake") Void testEndpointParameters( - - - - -@retrofit.http.Field("number") BigDecimal number -, - - - -@retrofit.http.Field("double") Double _double -, - - - -@retrofit.http.Field("pattern_without_delimiter") String patternWithoutDelimiter -, - - - -@retrofit.http.Field("byte") byte[] _byte -, - - - -@retrofit.http.Field("integer") Integer integer -, - - - -@retrofit.http.Field("int32") Integer int32 -, - - - -@retrofit.http.Field("int64") Long int64 -, - - - -@retrofit.http.Field("float") Float _float -, - - - -@retrofit.http.Field("string") String string -, - - - -@retrofit.http.Field("binary") byte[] binary -, - - - -@retrofit.http.Field("date") LocalDate date -, - - - -@retrofit.http.Field("dateTime") DateTime dateTime -, - - - -@retrofit.http.Field("password") String password -, - - - -@retrofit.http.Field("callback") String paramCallback - + @retrofit.http.Field("number") BigDecimal number, @retrofit.http.Field("double") Double _double, @retrofit.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit.http.Field("byte") byte[] _byte, @retrofit.http.Field("integer") Integer integer, @retrofit.http.Field("int32") Integer int32, @retrofit.http.Field("int64") Long int64, @retrofit.http.Field("float") Float _float, @retrofit.http.Field("string") String string, @retrofit.http.Field("binary") byte[] binary, @retrofit.http.Field("date") LocalDate date, @retrofit.http.Field("dateTime") DateTime dateTime, @retrofit.http.Field("password") String password, @retrofit.http.Field("callback") String paramCallback ); /** @@ -173,77 +93,7 @@ public interface FakeApi { @retrofit.http.FormUrlEncoded @POST("/fake") void testEndpointParameters( - - - - -@retrofit.http.Field("number") BigDecimal number -, - - - -@retrofit.http.Field("double") Double _double -, - - - -@retrofit.http.Field("pattern_without_delimiter") String patternWithoutDelimiter -, - - - -@retrofit.http.Field("byte") byte[] _byte -, - - - -@retrofit.http.Field("integer") Integer integer -, - - - -@retrofit.http.Field("int32") Integer int32 -, - - - -@retrofit.http.Field("int64") Long int64 -, - - - -@retrofit.http.Field("float") Float _float -, - - - -@retrofit.http.Field("string") String string -, - - - -@retrofit.http.Field("binary") byte[] binary -, - - - -@retrofit.http.Field("date") LocalDate date -, - - - -@retrofit.http.Field("dateTime") DateTime dateTime -, - - - -@retrofit.http.Field("password") String password -, - - - -@retrofit.http.Field("callback") String paramCallback -, Callback cb + @retrofit.http.Field("number") BigDecimal number, @retrofit.http.Field("double") Double _double, @retrofit.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit.http.Field("byte") byte[] _byte, @retrofit.http.Field("integer") Integer integer, @retrofit.http.Field("int32") Integer int32, @retrofit.http.Field("int64") Long int64, @retrofit.http.Field("float") Float _float, @retrofit.http.Field("string") String string, @retrofit.http.Field("binary") byte[] binary, @retrofit.http.Field("date") LocalDate date, @retrofit.http.Field("dateTime") DateTime dateTime, @retrofit.http.Field("password") String password, @retrofit.http.Field("callback") String paramCallback, Callback cb ); /** * To test enum parameters @@ -263,47 +113,7 @@ public interface FakeApi { @retrofit.http.FormUrlEncoded @GET("/fake") Void testEnumParameters( - - - - -@retrofit.http.Field("enum_form_string_array") List enumFormStringArray -, - - - -@retrofit.http.Field("enum_form_string") String enumFormString -, - -@retrofit.http.Header("enum_header_string_array") List enumHeaderStringArray - - -, - -@retrofit.http.Header("enum_header_string") String enumHeaderString - - -, @retrofit.http.Query("enum_query_string_array") CSVParams enumQueryStringArray - - - - -, @retrofit.http.Query("enum_query_string") String enumQueryString - - - - -, @retrofit.http.Query("enum_query_integer") BigDecimal enumQueryInteger - - - - -, - - - -@retrofit.http.Field("enum_query_double") Double enumQueryDouble - + @retrofit.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit.http.Field("enum_form_string") String enumFormString, @retrofit.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit.http.Header("enum_header_string") String enumHeaderString, @retrofit.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit.http.Query("enum_query_string") String enumQueryString, @retrofit.http.Query("enum_query_integer") BigDecimal enumQueryInteger, @retrofit.http.Field("enum_query_double") Double enumQueryDouble ); /** @@ -324,46 +134,6 @@ public interface FakeApi { @retrofit.http.FormUrlEncoded @GET("/fake") void testEnumParameters( - - - - -@retrofit.http.Field("enum_form_string_array") List enumFormStringArray -, - - - -@retrofit.http.Field("enum_form_string") String enumFormString -, - -@retrofit.http.Header("enum_header_string_array") List enumHeaderStringArray - - -, - -@retrofit.http.Header("enum_header_string") String enumHeaderString - - -, @retrofit.http.Query("enum_query_string_array") CSVParams enumQueryStringArray - - - - -, @retrofit.http.Query("enum_query_string") String enumQueryString - - - - -, @retrofit.http.Query("enum_query_integer") BigDecimal enumQueryInteger - - - - -, - - - -@retrofit.http.Field("enum_query_double") Double enumQueryDouble -, Callback cb + @retrofit.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit.http.Field("enum_form_string") String enumFormString, @retrofit.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit.http.Header("enum_header_string") String enumHeaderString, @retrofit.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit.http.Query("enum_query_string") String enumQueryString, @retrofit.http.Query("enum_query_integer") BigDecimal enumQueryInteger, @retrofit.http.Field("enum_query_double") Double enumQueryDouble, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java index eaeb49ffba41..eaaac18845fb 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java @@ -7,8 +7,8 @@ import retrofit.http.*; import retrofit.mime.*; import io.swagger.client.model.Pet; -import io.swagger.client.model.ModelApiResponse; import java.io.File; +import io.swagger.client.model.ModelApiResponse; import java.util.ArrayList; import java.util.HashMap; @@ -26,12 +26,7 @@ public interface PetApi { @POST("/pet") Void addPet( - - - -@retrofit.http.Body Pet body - - + @retrofit.http.Body Pet body ); /** @@ -44,12 +39,7 @@ public interface PetApi { @POST("/pet") void addPet( - - - -@retrofit.http.Body Pet body - -, Callback cb + @retrofit.http.Body Pet body, Callback cb ); /** * Deletes a pet @@ -62,17 +52,7 @@ public interface PetApi { @DELETE("/pet/{petId}") Void deletePet( - -@retrofit.http.Path("petId") Long petId - - - -, - -@retrofit.http.Header("api_key") String apiKey - - - + @retrofit.http.Path("petId") Long petId, @retrofit.http.Header("api_key") String apiKey ); /** @@ -86,17 +66,7 @@ public interface PetApi { @DELETE("/pet/{petId}") void deletePet( - -@retrofit.http.Path("petId") Long petId - - - -, - -@retrofit.http.Header("api_key") String apiKey - - -, Callback cb + @retrofit.http.Path("petId") Long petId, @retrofit.http.Header("api_key") String apiKey, Callback cb ); /** * Finds Pets by status @@ -109,11 +79,6 @@ public interface PetApi { @GET("/pet/findByStatus") List findPetsByStatus( @retrofit.http.Query("status") CSVParams status - - - - - ); /** @@ -126,12 +91,7 @@ public interface PetApi { @GET("/pet/findByStatus") void findPetsByStatus( - @retrofit.http.Query("status") CSVParams status - - - - -, Callback> cb + @retrofit.http.Query("status") CSVParams status, Callback> cb ); /** * Finds Pets by tags @@ -144,11 +104,6 @@ public interface PetApi { @GET("/pet/findByTags") List findPetsByTags( @retrofit.http.Query("tags") CSVParams tags - - - - - ); /** @@ -161,12 +116,7 @@ public interface PetApi { @GET("/pet/findByTags") void findPetsByTags( - @retrofit.http.Query("tags") CSVParams tags - - - - -, Callback> cb + @retrofit.http.Query("tags") CSVParams tags, Callback> cb ); /** * Find pet by ID @@ -178,12 +128,7 @@ public interface PetApi { @GET("/pet/{petId}") Pet getPetById( - -@retrofit.http.Path("petId") Long petId - - - - + @retrofit.http.Path("petId") Long petId ); /** @@ -196,12 +141,7 @@ public interface PetApi { @GET("/pet/{petId}") void getPetById( - -@retrofit.http.Path("petId") Long petId - - - -, Callback cb + @retrofit.http.Path("petId") Long petId, Callback cb ); /** * Update an existing pet @@ -213,12 +153,7 @@ public interface PetApi { @PUT("/pet") Void updatePet( - - - -@retrofit.http.Body Pet body - - + @retrofit.http.Body Pet body ); /** @@ -231,12 +166,7 @@ public interface PetApi { @PUT("/pet") void updatePet( - - - -@retrofit.http.Body Pet body - -, Callback cb + @retrofit.http.Body Pet body, Callback cb ); /** * Updates a pet in the store with form data @@ -251,22 +181,7 @@ public interface PetApi { @retrofit.http.FormUrlEncoded @POST("/pet/{petId}") Void updatePetWithForm( - -@retrofit.http.Path("petId") Long petId - - - -, - - - -@retrofit.http.Field("name") String name -, - - - -@retrofit.http.Field("status") String status - + @retrofit.http.Path("petId") Long petId, @retrofit.http.Field("name") String name, @retrofit.http.Field("status") String status ); /** @@ -282,22 +197,7 @@ public interface PetApi { @retrofit.http.FormUrlEncoded @POST("/pet/{petId}") void updatePetWithForm( - -@retrofit.http.Path("petId") Long petId - - - -, - - - -@retrofit.http.Field("name") String name -, - - - -@retrofit.http.Field("status") String status -, Callback cb + @retrofit.http.Path("petId") Long petId, @retrofit.http.Field("name") String name, @retrofit.http.Field("status") String status, Callback cb ); /** * uploads an image @@ -312,22 +212,7 @@ public interface PetApi { @retrofit.http.Multipart @POST("/pet/{petId}/uploadImage") ModelApiResponse uploadFile( - -@retrofit.http.Path("petId") Long petId - - - -, - - - -@retrofit.http.Part("additionalMetadata") String additionalMetadata -, - - - -@retrofit.http.Part("file") TypedFile file - + @retrofit.http.Path("petId") Long petId, @retrofit.http.Part("additionalMetadata") String additionalMetadata, @retrofit.http.Part("file") TypedFile file ); /** @@ -343,21 +228,6 @@ public interface PetApi { @retrofit.http.Multipart @POST("/pet/{petId}/uploadImage") void uploadFile( - -@retrofit.http.Path("petId") Long petId - - - -, - - - -@retrofit.http.Part("additionalMetadata") String additionalMetadata -, - - - -@retrofit.http.Part("file") TypedFile file -, Callback cb + @retrofit.http.Path("petId") Long petId, @retrofit.http.Part("additionalMetadata") String additionalMetadata, @retrofit.http.Part("file") TypedFile file, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java index f9fed4bd1cef..c29f87ef9cc8 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/StoreApi.java @@ -24,12 +24,7 @@ public interface StoreApi { @DELETE("/store/order/{orderId}") Void deleteOrder( - -@retrofit.http.Path("orderId") String orderId - - - - + @retrofit.http.Path("orderId") String orderId ); /** @@ -42,12 +37,7 @@ public interface StoreApi { @DELETE("/store/order/{orderId}") void deleteOrder( - -@retrofit.http.Path("orderId") String orderId - - - -, Callback cb + @retrofit.http.Path("orderId") String orderId, Callback cb ); /** * Returns pet inventories by status @@ -81,12 +71,7 @@ public interface StoreApi { @GET("/store/order/{orderId}") Order getOrderById( - -@retrofit.http.Path("orderId") Long orderId - - - - + @retrofit.http.Path("orderId") Long orderId ); /** @@ -99,12 +84,7 @@ public interface StoreApi { @GET("/store/order/{orderId}") void getOrderById( - -@retrofit.http.Path("orderId") Long orderId - - - -, Callback cb + @retrofit.http.Path("orderId") Long orderId, Callback cb ); /** * Place an order for a pet @@ -116,12 +96,7 @@ public interface StoreApi { @POST("/store/order") Order placeOrder( - - - -@retrofit.http.Body Order body - - + @retrofit.http.Body Order body ); /** @@ -134,11 +109,6 @@ public interface StoreApi { @POST("/store/order") void placeOrder( - - - -@retrofit.http.Body Order body - -, Callback cb + @retrofit.http.Body Order body, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/UserApi.java index 7de0bc3fb1a3..43876970c3f8 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/UserApi.java @@ -24,12 +24,7 @@ public interface UserApi { @POST("/user") Void createUser( - - - -@retrofit.http.Body User body - - + @retrofit.http.Body User body ); /** @@ -42,12 +37,7 @@ public interface UserApi { @POST("/user") void createUser( - - - -@retrofit.http.Body User body - -, Callback cb + @retrofit.http.Body User body, Callback cb ); /** * Creates list of users with given input array @@ -59,12 +49,7 @@ public interface UserApi { @POST("/user/createWithArray") Void createUsersWithArrayInput( - - - -@retrofit.http.Body List body - - + @retrofit.http.Body List body ); /** @@ -77,12 +62,7 @@ public interface UserApi { @POST("/user/createWithArray") void createUsersWithArrayInput( - - - -@retrofit.http.Body List body - -, Callback cb + @retrofit.http.Body List body, Callback cb ); /** * Creates list of users with given input array @@ -94,12 +74,7 @@ public interface UserApi { @POST("/user/createWithList") Void createUsersWithListInput( - - - -@retrofit.http.Body List body - - + @retrofit.http.Body List body ); /** @@ -112,12 +87,7 @@ public interface UserApi { @POST("/user/createWithList") void createUsersWithListInput( - - - -@retrofit.http.Body List body - -, Callback cb + @retrofit.http.Body List body, Callback cb ); /** * Delete user @@ -129,12 +99,7 @@ public interface UserApi { @DELETE("/user/{username}") Void deleteUser( - -@retrofit.http.Path("username") String username - - - - + @retrofit.http.Path("username") String username ); /** @@ -147,12 +112,7 @@ public interface UserApi { @DELETE("/user/{username}") void deleteUser( - -@retrofit.http.Path("username") String username - - - -, Callback cb + @retrofit.http.Path("username") String username, Callback cb ); /** * Get user by user name @@ -164,12 +124,7 @@ public interface UserApi { @GET("/user/{username}") User getUserByName( - -@retrofit.http.Path("username") String username - - - - + @retrofit.http.Path("username") String username ); /** @@ -182,12 +137,7 @@ public interface UserApi { @GET("/user/{username}") void getUserByName( - -@retrofit.http.Path("username") String username - - - -, Callback cb + @retrofit.http.Path("username") String username, Callback cb ); /** * Logs user into the system @@ -200,17 +150,7 @@ public interface UserApi { @GET("/user/login") String loginUser( - @retrofit.http.Query("username") String username - - - - -, @retrofit.http.Query("password") String password - - - - - + @retrofit.http.Query("username") String username, @retrofit.http.Query("password") String password ); /** @@ -224,17 +164,7 @@ public interface UserApi { @GET("/user/login") void loginUser( - @retrofit.http.Query("username") String username - - - - -, @retrofit.http.Query("password") String password - - - - -, Callback cb + @retrofit.http.Query("username") String username, @retrofit.http.Query("password") String password, Callback cb ); /** * Logs out current logged in user session @@ -269,17 +199,7 @@ public interface UserApi { @PUT("/user/{username}") Void updateUser( - -@retrofit.http.Path("username") String username - - - -, - - -@retrofit.http.Body User body - - + @retrofit.http.Path("username") String username, @retrofit.http.Body User body ); /** @@ -293,16 +213,6 @@ public interface UserApi { @PUT("/user/{username}") void updateUser( - -@retrofit.http.Path("username") String username - - - -, - - -@retrofit.http.Body User body - -, Callback cb + @retrofit.http.Path("username") String username, @retrofit.http.Body User body, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit2/gradlew.bat b/samples/client/petstore/java/retrofit2/gradlew.bat index 72d362dafd89..5f192121eb4f 100644 --- a/samples/client/petstore/java/retrofit2/gradlew.bat +++ b/samples/client/petstore/java/retrofit2/gradlew.bat @@ -1,90 +1,90 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java index 7479e230574f..d1068513f0ea 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java @@ -10,8 +10,8 @@ import okhttp3.RequestBody; import io.swagger.client.model.Client; import org.joda.time.LocalDate; -import java.math.BigDecimal; import org.joda.time.DateTime; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; @@ -28,12 +28,7 @@ public interface FakeApi { @PATCH("fake") Call testClientModel( - - - -@retrofit2.http.Body Client body - - + @retrofit2.http.Body Client body ); /** @@ -59,77 +54,7 @@ public interface FakeApi { @retrofit2.http.FormUrlEncoded @POST("fake") Call testEndpointParameters( - - - - -@retrofit2.http.Field("number") BigDecimal number -, - - - -@retrofit2.http.Field("double") Double _double -, - - - -@retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter -, - - - -@retrofit2.http.Field("byte") byte[] _byte -, - - - -@retrofit2.http.Field("integer") Integer integer -, - - - -@retrofit2.http.Field("int32") Integer int32 -, - - - -@retrofit2.http.Field("int64") Long int64 -, - - - -@retrofit2.http.Field("float") Float _float -, - - - -@retrofit2.http.Field("string") String string -, - - - -@retrofit2.http.Field("binary") byte[] binary -, - - - -@retrofit2.http.Field("date") LocalDate date -, - - - -@retrofit2.http.Field("dateTime") DateTime dateTime -, - - - -@retrofit2.http.Field("password") String password -, - - - -@retrofit2.http.Field("callback") String paramCallback - + @retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") byte[] binary, @retrofit2.http.Field("date") LocalDate date, @retrofit2.http.Field("dateTime") DateTime dateTime, @retrofit2.http.Field("password") String password, @retrofit2.http.Field("callback") String paramCallback ); /** @@ -149,47 +74,7 @@ public interface FakeApi { @retrofit2.http.FormUrlEncoded @GET("fake") Call testEnumParameters( - - - - -@retrofit2.http.Field("enum_form_string_array") List enumFormStringArray -, - - - -@retrofit2.http.Field("enum_form_string") String enumFormString -, - -@retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray - - -, - -@retrofit2.http.Header("enum_header_string") String enumHeaderString - - -, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray - - - - -, @retrofit2.http.Query("enum_query_string") String enumQueryString - - - - -, @retrofit2.http.Query("enum_query_integer") BigDecimal enumQueryInteger - - - - -, - - - -@retrofit2.http.Field("enum_query_double") Double enumQueryDouble - + @retrofit2.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString, @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") BigDecimal enumQueryInteger, @retrofit2.http.Field("enum_query_double") Double enumQueryDouble ); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java index bd13312f5816..3f61279a66bc 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java @@ -9,8 +9,8 @@ import retrofit2.http.*; import okhttp3.RequestBody; import io.swagger.client.model.Pet; -import io.swagger.client.model.ModelApiResponse; import java.io.File; +import io.swagger.client.model.ModelApiResponse; import java.util.ArrayList; import java.util.HashMap; @@ -27,12 +27,7 @@ public interface PetApi { @POST("pet") Call addPet( - - - -@retrofit2.http.Body Pet body - - + @retrofit2.http.Body Pet body ); /** @@ -45,17 +40,7 @@ public interface PetApi { @DELETE("pet/{petId}") Call deletePet( - -@retrofit2.http.Path("petId") Long petId - - - -, - -@retrofit2.http.Header("api_key") String apiKey - - - + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Header("api_key") String apiKey ); /** @@ -68,11 +53,6 @@ public interface PetApi { @GET("pet/findByStatus") Call> findPetsByStatus( @retrofit2.http.Query("status") CSVParams status - - - - - ); /** @@ -85,11 +65,6 @@ public interface PetApi { @GET("pet/findByTags") Call> findPetsByTags( @retrofit2.http.Query("tags") CSVParams tags - - - - - ); /** @@ -101,12 +76,7 @@ public interface PetApi { @GET("pet/{petId}") Call getPetById( - -@retrofit2.http.Path("petId") Long petId - - - - + @retrofit2.http.Path("petId") Long petId ); /** @@ -118,12 +88,7 @@ public interface PetApi { @PUT("pet") Call updatePet( - - - -@retrofit2.http.Body Pet body - - + @retrofit2.http.Body Pet body ); /** @@ -138,22 +103,7 @@ public interface PetApi { @retrofit2.http.FormUrlEncoded @POST("pet/{petId}") Call updatePetWithForm( - -@retrofit2.http.Path("petId") Long petId - - - -, - - - -@retrofit2.http.Field("name") String name -, - - - -@retrofit2.http.Field("status") String status - + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Field("name") String name, @retrofit2.http.Field("status") String status ); /** @@ -168,22 +118,7 @@ public interface PetApi { @retrofit2.http.Multipart @POST("pet/{petId}/uploadImage") Call uploadFile( - -@retrofit2.http.Path("petId") Long petId - - - -, - - - -@retrofit2.http.Part("additionalMetadata") String additionalMetadata -, - - - -@retrofit2.http.Part("file\"; filename=\"file") RequestBody file - + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part("file\"; filename=\"file") RequestBody file ); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java index ebed8da8f523..f9df7d8e8d6f 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java @@ -25,12 +25,7 @@ public interface StoreApi { @DELETE("store/order/{orderId}") Call deleteOrder( - -@retrofit2.http.Path("orderId") String orderId - - - - + @retrofit2.http.Path("orderId") String orderId ); /** @@ -52,12 +47,7 @@ public interface StoreApi { @GET("store/order/{orderId}") Call getOrderById( - -@retrofit2.http.Path("orderId") Long orderId - - - - + @retrofit2.http.Path("orderId") Long orderId ); /** @@ -69,12 +59,7 @@ public interface StoreApi { @POST("store/order") Call placeOrder( - - - -@retrofit2.http.Body Order body - - + @retrofit2.http.Body Order body ); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java index 1bf7d34d73ca..ee1114dc2dc8 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java @@ -25,12 +25,7 @@ public interface UserApi { @POST("user") Call createUser( - - - -@retrofit2.http.Body User body - - + @retrofit2.http.Body User body ); /** @@ -42,12 +37,7 @@ public interface UserApi { @POST("user/createWithArray") Call createUsersWithArrayInput( - - - -@retrofit2.http.Body List body - - + @retrofit2.http.Body List body ); /** @@ -59,12 +49,7 @@ public interface UserApi { @POST("user/createWithList") Call createUsersWithListInput( - - - -@retrofit2.http.Body List body - - + @retrofit2.http.Body List body ); /** @@ -76,12 +61,7 @@ public interface UserApi { @DELETE("user/{username}") Call deleteUser( - -@retrofit2.http.Path("username") String username - - - - + @retrofit2.http.Path("username") String username ); /** @@ -93,12 +73,7 @@ public interface UserApi { @GET("user/{username}") Call getUserByName( - -@retrofit2.http.Path("username") String username - - - - + @retrofit2.http.Path("username") String username ); /** @@ -111,17 +86,7 @@ public interface UserApi { @GET("user/login") Call loginUser( - @retrofit2.http.Query("username") String username - - - - -, @retrofit2.http.Query("password") String password - - - - - + @retrofit2.http.Query("username") String username, @retrofit2.http.Query("password") String password ); /** @@ -144,17 +109,7 @@ public interface UserApi { @PUT("user/{username}") Call updateUser( - -@retrofit2.http.Path("username") String username - - - -, - - -@retrofit2.http.Body User body - - + @retrofit2.http.Path("username") String username, @retrofit2.http.Body User body ); } diff --git a/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md index f4cfc7e19ccd..2e2b792d8d30 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md @@ -54,7 +54,7 @@ No authorization required # **testEndpointParameters** -> Void testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password) +> Void testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -90,8 +90,9 @@ byte[] binary = B; // byte[] | None LocalDate date = new LocalDate(); // LocalDate | None DateTime dateTime = new DateTime(); // DateTime | None String password = "password_example"; // String | None +String paramCallback = "paramCallback_example"; // String | None try { - Void result = apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password); + Void result = apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); @@ -116,6 +117,7 @@ Name | Type | Description | Notes **date** | **LocalDate**| None | [optional] **dateTime** | **DateTime**| None | [optional] **password** | **String**| None | [optional] + **paramCallback** | **String**| None | [optional] ### Return type diff --git a/samples/client/petstore/java/retrofit2rx/gradlew.bat b/samples/client/petstore/java/retrofit2rx/gradlew.bat index 72d362dafd89..5f192121eb4f 100644 --- a/samples/client/petstore/java/retrofit2rx/gradlew.bat +++ b/samples/client/petstore/java/retrofit2rx/gradlew.bat @@ -1,90 +1,90 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java index 924c81ff6dc8..2b832afd1efe 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java @@ -10,8 +10,8 @@ import okhttp3.RequestBody; import io.swagger.client.model.Client; import org.joda.time.LocalDate; -import java.math.BigDecimal; import org.joda.time.DateTime; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; @@ -28,12 +28,7 @@ public interface FakeApi { @PATCH("fake") Observable testClientModel( - - - -@retrofit2.http.Body Client body - - + @retrofit2.http.Body Client body ); /** @@ -59,77 +54,7 @@ public interface FakeApi { @retrofit2.http.FormUrlEncoded @POST("fake") Observable testEndpointParameters( - - - - -@retrofit2.http.Field("number") BigDecimal number -, - - - -@retrofit2.http.Field("double") Double _double -, - - - -@retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter -, - - - -@retrofit2.http.Field("byte") byte[] _byte -, - - - -@retrofit2.http.Field("integer") Integer integer -, - - - -@retrofit2.http.Field("int32") Integer int32 -, - - - -@retrofit2.http.Field("int64") Long int64 -, - - - -@retrofit2.http.Field("float") Float _float -, - - - -@retrofit2.http.Field("string") String string -, - - - -@retrofit2.http.Field("binary") byte[] binary -, - - - -@retrofit2.http.Field("date") LocalDate date -, - - - -@retrofit2.http.Field("dateTime") DateTime dateTime -, - - - -@retrofit2.http.Field("password") String password -, - - - -@retrofit2.http.Field("callback") String paramCallback - + @retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") byte[] binary, @retrofit2.http.Field("date") LocalDate date, @retrofit2.http.Field("dateTime") DateTime dateTime, @retrofit2.http.Field("password") String password, @retrofit2.http.Field("callback") String paramCallback ); /** @@ -149,47 +74,7 @@ public interface FakeApi { @retrofit2.http.FormUrlEncoded @GET("fake") Observable testEnumParameters( - - - - -@retrofit2.http.Field("enum_form_string_array") List enumFormStringArray -, - - - -@retrofit2.http.Field("enum_form_string") String enumFormString -, - -@retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray - - -, - -@retrofit2.http.Header("enum_header_string") String enumHeaderString - - -, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray - - - - -, @retrofit2.http.Query("enum_query_string") String enumQueryString - - - - -, @retrofit2.http.Query("enum_query_integer") BigDecimal enumQueryInteger - - - - -, - - - -@retrofit2.http.Field("enum_query_double") Double enumQueryDouble - + @retrofit2.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString, @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") BigDecimal enumQueryInteger, @retrofit2.http.Field("enum_query_double") Double enumQueryDouble ); } 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 index cc6a867c7557..3c183bb08f9b 100644 --- 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 @@ -9,8 +9,8 @@ import retrofit2.http.*; import okhttp3.RequestBody; import io.swagger.client.model.Pet; -import io.swagger.client.model.ModelApiResponse; import java.io.File; +import io.swagger.client.model.ModelApiResponse; import java.util.ArrayList; import java.util.HashMap; @@ -27,12 +27,7 @@ public interface PetApi { @POST("pet") Observable addPet( - - - -@retrofit2.http.Body Pet body - - + @retrofit2.http.Body Pet body ); /** @@ -45,17 +40,7 @@ public interface PetApi { @DELETE("pet/{petId}") Observable deletePet( - -@retrofit2.http.Path("petId") Long petId - - - -, - -@retrofit2.http.Header("api_key") String apiKey - - - + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Header("api_key") String apiKey ); /** @@ -68,11 +53,6 @@ public interface PetApi { @GET("pet/findByStatus") Observable> findPetsByStatus( @retrofit2.http.Query("status") CSVParams status - - - - - ); /** @@ -85,11 +65,6 @@ public interface PetApi { @GET("pet/findByTags") Observable> findPetsByTags( @retrofit2.http.Query("tags") CSVParams tags - - - - - ); /** @@ -101,12 +76,7 @@ public interface PetApi { @GET("pet/{petId}") Observable getPetById( - -@retrofit2.http.Path("petId") Long petId - - - - + @retrofit2.http.Path("petId") Long petId ); /** @@ -118,12 +88,7 @@ public interface PetApi { @PUT("pet") Observable updatePet( - - - -@retrofit2.http.Body Pet body - - + @retrofit2.http.Body Pet body ); /** @@ -138,22 +103,7 @@ public interface PetApi { @retrofit2.http.FormUrlEncoded @POST("pet/{petId}") Observable updatePetWithForm( - -@retrofit2.http.Path("petId") Long petId - - - -, - - - -@retrofit2.http.Field("name") String name -, - - - -@retrofit2.http.Field("status") String status - + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Field("name") String name, @retrofit2.http.Field("status") String status ); /** @@ -168,22 +118,7 @@ public interface PetApi { @retrofit2.http.Multipart @POST("pet/{petId}/uploadImage") Observable uploadFile( - -@retrofit2.http.Path("petId") Long petId - - - -, - - - -@retrofit2.http.Part("additionalMetadata") String additionalMetadata -, - - - -@retrofit2.http.Part("file\"; filename=\"file") RequestBody file - + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part("file\"; filename=\"file") RequestBody file ); } 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 index f763e317070d..e8eac3c525b5 100644 --- 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 @@ -25,12 +25,7 @@ public interface StoreApi { @DELETE("store/order/{orderId}") Observable deleteOrder( - -@retrofit2.http.Path("orderId") String orderId - - - - + @retrofit2.http.Path("orderId") String orderId ); /** @@ -52,12 +47,7 @@ public interface StoreApi { @GET("store/order/{orderId}") Observable getOrderById( - -@retrofit2.http.Path("orderId") Long orderId - - - - + @retrofit2.http.Path("orderId") Long orderId ); /** @@ -69,12 +59,7 @@ public interface StoreApi { @POST("store/order") Observable placeOrder( - - - -@retrofit2.http.Body Order body - - + @retrofit2.http.Body Order body ); } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java index 4f13893a8f83..579134971f80 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java @@ -25,12 +25,7 @@ public interface UserApi { @POST("user") Observable createUser( - - - -@retrofit2.http.Body User body - - + @retrofit2.http.Body User body ); /** @@ -42,12 +37,7 @@ public interface UserApi { @POST("user/createWithArray") Observable createUsersWithArrayInput( - - - -@retrofit2.http.Body List body - - + @retrofit2.http.Body List body ); /** @@ -59,12 +49,7 @@ public interface UserApi { @POST("user/createWithList") Observable createUsersWithListInput( - - - -@retrofit2.http.Body List body - - + @retrofit2.http.Body List body ); /** @@ -76,12 +61,7 @@ public interface UserApi { @DELETE("user/{username}") Observable deleteUser( - -@retrofit2.http.Path("username") String username - - - - + @retrofit2.http.Path("username") String username ); /** @@ -93,12 +73,7 @@ public interface UserApi { @GET("user/{username}") Observable getUserByName( - -@retrofit2.http.Path("username") String username - - - - + @retrofit2.http.Path("username") String username ); /** @@ -111,17 +86,7 @@ public interface UserApi { @GET("user/login") Observable loginUser( - @retrofit2.http.Query("username") String username - - - - -, @retrofit2.http.Query("password") String password - - - - - + @retrofit2.http.Query("username") String username, @retrofit2.http.Query("password") String password ); /** @@ -144,17 +109,7 @@ public interface UserApi { @PUT("user/{username}") Observable updateUser( - -@retrofit2.http.Path("username") String username - - - -, - - -@retrofit2.http.Body User body - - + @retrofit2.http.Path("username") String username, @retrofit2.http.Body User body ); } From 0efa5cab353c4c7ac83f5313a8046180c2acdb24 Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 12 Oct 2016 16:07:37 +0800 Subject: [PATCH 8/9] Revert "[WIP] Improve PHP client emitted code quality" --- .../src/main/resources/php/ApiClient.mustache | 154 ++++++++---------- .../main/resources/php/ApiException.mustache | 6 +- .../resources/php/ObjectSerializer.mustache | 6 +- .../src/main/resources/php/api.mustache | 29 ++-- .../src/main/resources/php/api_test.mustache | 7 + .../main/resources/php/configuration.mustache | 35 +--- .../src/main/resources/php/model.mustache | 1 - .../main/resources/php/model_generic.mustache | 6 +- 8 files changed, 106 insertions(+), 138 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache index bbe7d20ad927..effdbedb7f84 100644 --- a/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache @@ -31,13 +31,13 @@ namespace {{invokerPackage}}; */ class ApiClient { - public static $PATCH = 'PATCH'; - public static $POST = 'POST'; - public static $GET = 'GET'; - public static $HEAD = 'HEAD'; - public static $OPTIONS = 'OPTIONS'; - public static $PUT = 'PUT'; - public static $DELETE = 'DELETE'; + public static $PATCH = "PATCH"; + public static $POST = "POST"; + public static $GET = "GET"; + public static $HEAD = "HEAD"; + public static $OPTIONS = "OPTIONS"; + public static $PUT = "PUT"; + public static $DELETE = "DELETE"; /** * Configuration @@ -58,7 +58,7 @@ class ApiClient * * @param Configuration $config config for this ApiClient */ - public function __construct(Configuration $config = null) + public function __construct(\{{invokerPackage}}\Configuration $config = null) { if ($config === null) { $config = Configuration::getDefaultConfiguration(); @@ -91,7 +91,7 @@ class ApiClient /** * Get API key (with prefix if set) * - * @param string $apiKeyIdentifier name of API key + * @param string $apiKeyIdentifier name of apikey * * @return string API key with the prefix */ @@ -100,13 +100,14 @@ class ApiClient $prefix = $this->config->getApiKeyPrefix($apiKeyIdentifier); $apiKey = $this->config->getApiKey($apiKeyIdentifier); - if ($apiKey === null) { + if (!isset($apiKey)) { return null; } - $keyWithPrefix = $apiKey; - if ($prefix !== null) { - $keyWithPrefix = $prefix.' '.$apiKey; + if (isset($prefix)) { + $keyWithPrefix = $prefix." ".$apiKey; + } else { + $keyWithPrefix = $apiKey; } return $keyWithPrefix; @@ -115,24 +116,19 @@ class ApiClient /** * Make the HTTP call (Sync) * - * @param string $resourcePath path to method endpoint - * @param string $method method to call - * @param array $queryParams parameters to be place in query URL - * @param array|string $postData parameters to be placed in POST body - * @param array $headerParams parameters to be place in request header - * @param string $responseType expected response type of the endpoint + * @param string $resourcePath path to method endpoint + * @param string $method method to call + * @param array $queryParams parameters to be place in query URL + * @param array $postData parameters to be placed in POST body + * @param array $headerParams parameters to be place in request header + * @param string $responseType expected response type of the endpoint + * @param string $endpointPath path to method endpoint before expanding parameters * - * @throws ApiException on a non 2xx response + * @throws \{{invokerPackage}}\ApiException on a non 2xx response * @return mixed */ - public function callApi( - $resourcePath, - $method, - array $queryParams, - $postData, - array $headerParams, - $responseType = null - ) { + public function callApi($resourcePath, $method, $queryParams, $postData, $headerParams, $responseType = null, $endpointPath = null) + { $headers = []; // construct the http header @@ -146,10 +142,10 @@ class ApiClient } // form data - if (is_array($postData) && in_array('Content-Type: application/x-www-form-urlencoded', $headers, true)) { + if ($postData and in_array('Content-Type: application/x-www-form-urlencoded', $headers, true)) { $postData = http_build_query($postData); - } elseif ((is_object($postData) || is_array($postData)) && !in_array('Content-Type: multipart/form-data', $headers, true)) { // json model - $postData = json_encode(ObjectSerializer::sanitizeForSerialization($postData)); + } elseif ((is_object($postData) or is_array($postData)) and !in_array('Content-Type: multipart/form-data', $headers, true)) { // json model + $postData = json_encode(\{{invokerPackage}}\ObjectSerializer::sanitizeForSerialization($postData)); } $url = $this->config->getHost() . $resourcePath; @@ -165,12 +161,12 @@ class ApiClient curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); // disable SSL verification, if needed - if ($this->config->isSSLVerification() === false) { + if ($this->config->getSSLVerification() === false) { curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); } - if ($queryParams !== null) { + if (!empty($queryParams)) { $url = ($url . '?' . http_build_query($queryParams)); } @@ -180,16 +176,16 @@ class ApiClient } elseif ($method === self::$HEAD) { curl_setopt($curl, CURLOPT_NOBODY, true); } elseif ($method === self::$OPTIONS) { - curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'OPTIONS'); + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "OPTIONS"); curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); } elseif ($method === self::$PATCH) { - curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PATCH'); + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH"); curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); } elseif ($method === self::$PUT) { - curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT'); + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT"); curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); } elseif ($method === self::$DELETE) { - curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'DELETE'); + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE"); curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); } elseif ($method !== self::$GET) { throw new ApiException('Method ' . $method . ' is not recognized.'); @@ -200,12 +196,8 @@ class ApiClient curl_setopt($curl, CURLOPT_USERAGENT, $this->config->getUserAgent()); // debugging for curl - if ($this->config->isDebug()) { - error_log( - '[DEBUG] HTTP Request body ~BEGIN~'.PHP_EOL.print_r($postData, true).PHP_EOL.'~END~'.PHP_EOL, - 3, - $this->config->getDebugFile() - ); + if ($this->config->getDebug()) { + error_log("[DEBUG] HTTP Request body ~BEGIN~".PHP_EOL.print_r($postData, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile()); curl_setopt($curl, CURLOPT_VERBOSE, 1); curl_setopt($curl, CURLOPT_STDERR, fopen($this->config->getDebugFile(), 'a')); @@ -218,59 +210,55 @@ class ApiClient // Make the request $response = curl_exec($curl); - $httpHeaderSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE); - $httpHeader = $this->httpParseHeaders(substr($response, 0, $httpHeaderSize)); - $httpBody = substr($response, $httpHeaderSize); - $responseInfo = curl_getinfo($curl); + $http_header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE); + $http_header = $this->httpParseHeaders(substr($response, 0, $http_header_size)); + $http_body = substr($response, $http_header_size); + $response_info = curl_getinfo($curl); // debug HTTP response body - if ($this->config->isDebug()) { - error_log( - '[DEBUG] HTTP Response body ~BEGIN~'.PHP_EOL.print_r($httpBody, true).PHP_EOL.'~END~'.PHP_EOL, - 3, - $this->config->getDebugFile() - ); + if ($this->config->getDebug()) { + error_log("[DEBUG] HTTP Response body ~BEGIN~".PHP_EOL.print_r($http_body, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile()); } // Handle the response - if ($responseInfo['http_code'] === 0) { - $curlErrorMessage = curl_error($curl); + if ($response_info['http_code'] === 0) { + $curl_error_message = curl_error($curl); // curl_exec can sometimes fail but still return a blank message from curl_error(). - if ($curlErrorMessage !== '') { - $errorMessage = 'API call to '.$url.' failed: '.$curlErrorMessage; + if (!empty($curl_error_message)) { + $error_message = "API call to $url failed: $curl_error_message"; } else { - $errorMessage = 'API call to '.$url.' failed, but for an unknown reason. ' . - 'This could happen if you are disconnected from the network.'; + $error_message = "API call to $url failed, but for an unknown reason. " . + "This could happen if you are disconnected from the network."; } - $exception = new ApiException($errorMessage, 0, null, null); - $exception->setResponseObject($responseInfo); + $exception = new ApiException($error_message, 0, null, null); + $exception->setResponseObject($response_info); throw $exception; - } elseif ($responseInfo['http_code'] >= 200 && $responseInfo['http_code'] <= 299) { + } elseif ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299) { // return raw body if response is a file if ($responseType === '\SplFileObject' || $responseType === 'string') { - return [$httpBody, $responseInfo['http_code'], $httpHeader]; + return [$http_body, $response_info['http_code'], $http_header]; } - $data = json_decode($httpBody); + $data = json_decode($http_body); if (json_last_error() > 0) { // if response is a string - $data = $httpBody; + $data = $http_body; } } else { - $data = json_decode($httpBody); + $data = json_decode($http_body); if (json_last_error() > 0) { // if response is a string - $data = $httpBody; + $data = $http_body; } throw new ApiException( - '['.$responseInfo['http_code'].'] Error connecting to the API ('.$url.')', - $responseInfo['http_code'], - $httpHeader, + "[".$response_info['http_code']."] Error connecting to the API ($url)", + $response_info['http_code'], + $http_header, $data ); } - return [$data, $responseInfo['http_code'], $httpHeader]; + return [$data, $response_info['http_code'], $http_header]; } /** @@ -282,9 +270,9 @@ class ApiClient */ public function selectHeaderAccept($accept) { - if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { + if (count($accept) === 0 or (count($accept) === 1 and $accept[0] === '')) { return null; - } elseif (preg_grep('/application\\/json/i', $accept)) { + } elseif (preg_grep("/application\/json/i", $accept)) { return 'application/json'; } else { return implode(',', $accept); @@ -294,35 +282,35 @@ class ApiClient /** * Return the content type based on an array of content-type provided * - * @param string[] $contentType Array for Content-type + * @param string[] $content_type Array fo content-type * * @return string Content-Type (e.g. application/json) */ - public function selectHeaderContentType($contentType) + public function selectHeaderContentType($content_type) { - if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { + if (count($content_type) === 0 or (count($content_type) === 1 and $content_type[0] === '')) { return 'application/json'; - } elseif (preg_grep('/application\\/json/i', $contentType)) { + } elseif (preg_grep("/application\/json/i", $content_type)) { return 'application/json'; } else { - return implode(',', $contentType); + return implode(',', $content_type); } } /** * Return an array of HTTP response headers * - * @param string $rawHeaders A string of raw HTTP response headers + * @param string $raw_headers A string of raw HTTP response headers * - * @return string[] Array of HTTP response headers + * @return string[] Array of HTTP response heaers */ - protected function httpParseHeaders($rawHeaders) + protected function httpParseHeaders($raw_headers) { // ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986 $headers = []; $key = ''; - foreach (explode("\n", $rawHeaders) as $h) { + foreach (explode("\n", $raw_headers) as $h) { $h = explode(':', $h, 2); if (isset($h[1])) { @@ -336,7 +324,7 @@ class ApiClient $key = $h[0]; } else { - if (strpos($h[0], "\t") === 0) { + if (substr($h[0], 0, 1) === "\t") { $headers[$key] .= "\r\n\t".trim($h[0]); } elseif (!$key) { $headers[0] = trim($h[0]); diff --git a/modules/swagger-codegen/src/main/resources/php/ApiException.mustache b/modules/swagger-codegen/src/main/resources/php/ApiException.mustache index 2ec9079d555d..f99a793fbc6a 100644 --- a/modules/swagger-codegen/src/main/resources/php/ApiException.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ApiException.mustache @@ -62,7 +62,7 @@ class ApiException extends Exception * @param string $responseHeaders HTTP response header * @param mixed $responseBody HTTP body of the server response either as Json or string */ - public function __construct($message = '', $code = 0, $responseHeaders = null, $responseBody = null) + public function __construct($message = "", $code = 0, $responseHeaders = null, $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; @@ -90,7 +90,7 @@ class ApiException extends Exception } /** - * Sets the deserialized response object (during deserialization) + * Sets the deseralized response object (during deserialization) * * @param mixed $obj Deserialized response object * @@ -102,7 +102,7 @@ class ApiException extends Exception } /** - * Gets the deserialized response object (during deserialization) + * Gets the deseralized response object (during deserialization) * * @return mixed the deserialized response object */ diff --git a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache index 5495b4f46112..7208e4c77845 100644 --- a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache @@ -213,7 +213,7 @@ class ObjectSerializer } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] $inner = substr($class, 4, -1); $deserialized = []; - if (strrpos($inner, ',') !== false) { + if (strrpos($inner, ",") !== false) { $subClass_array = explode(',', $inner, 2); $subClass = $subClass_array[1]; foreach ($data as $key => $value) { @@ -254,9 +254,9 @@ class ObjectSerializer } else { $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); } - $deserialized = new \SplFileObject($filename, 'w'); + $deserialized = new \SplFileObject($filename, "w"); $byte_written = $deserialized->fwrite($data); - if (Configuration::getDefaultConfiguration()->isDebug()) { + if (Configuration::getDefaultConfiguration()->getDebug()) { error_log("[DEBUG] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.".PHP_EOL, 3, Configuration::getDefaultConfiguration()->getDebugFile()); } diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index ef0139e23fe1..26583a6f3d16 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -21,6 +21,8 @@ namespace {{apiPackage}}; use \{{invokerPackage}}\ApiClient; use \{{invokerPackage}}\ApiException; +use \{{invokerPackage}}\Configuration; +use \{{invokerPackage}}\ObjectSerializer; /** * {{classname}} Class Doc Comment @@ -36,28 +38,29 @@ use \{{invokerPackage}}\ApiException; /** * API Client * - * @var ApiClient instance of the ApiClient + * @var \{{invokerPackage}}\ApiClient instance of the ApiClient */ protected $apiClient; /** * Constructor * - * @param ApiClient|null $apiClient The API client to use + * @param \{{invokerPackage}}\ApiClient|null $apiClient The api client to use */ - public function __construct(ApiClient $apiClient = null) + public function __construct(\{{invokerPackage}}\ApiClient $apiClient = null) { if ($apiClient === null) { $apiClient = new ApiClient(); $apiClient->getConfig()->setHost('{{basePath}}'); } - $this->setApiClient($apiClient); + + $this->apiClient = $apiClient; } /** * Get API client * - * @return ApiClient get the API client + * @return \{{invokerPackage}}\ApiClient get the API client */ public function getApiClient() { @@ -67,11 +70,11 @@ use \{{invokerPackage}}\ApiException; /** * Set the API client * - * @param ApiClient $apiClient set the API client + * @param \{{invokerPackage}}\ApiClient $apiClient set the API client * * @return {{classname}} */ - public function setApiClient(ApiClient $apiClient) + public function setApiClient(\{{invokerPackage}}\ApiClient $apiClient) { $this->apiClient = $apiClient; return $this; @@ -112,7 +115,6 @@ use \{{invokerPackage}}\ApiException; * @param {{dataType}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} * @throws \{{invokerPackage}}\ApiException on non-2xx response - * @throws \InvalidArgumentException * @return array of {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}null{{/returnType}}, HTTP status code, HTTP response headers (array of strings) */ public function {{operationId}}WithHttpInfo({{#allParams}}${{paramName}}{{^required}} = null{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) @@ -164,7 +166,7 @@ use \{{invokerPackage}}\ApiException; {{/hasValidation}} {{/allParams}} // parse inputs - $resourcePath = '{{path}}'; + $resourcePath = "{{path}}"; $httpBody = ''; $queryParams = []; $headerParams = []; @@ -206,14 +208,14 @@ use \{{invokerPackage}}\ApiException; {{/collectionFormat}} if (${{paramName}} !== null) { $resourcePath = str_replace( - '{'.'{{baseName}}'.'}', + "{" . "{{baseName}}" . "}", $this->apiClient->getSerializer()->toPathValue(${{paramName}}), $resourcePath ); } {{/pathParams}} // default format to json - $resourcePath = str_replace('{format}', 'json', $resourcePath); + $resourcePath = str_replace("{format}", "json", $resourcePath); {{#formParams}} // form params @@ -275,11 +277,12 @@ use \{{invokerPackage}}\ApiException; $httpBody, $headerParams, {{#returnType}} - '{{returnType}}' + '{{returnType}}', {{/returnType}} {{^returnType}} - null + null, {{/returnType}} + '{{path}}' ); {{#returnType}} diff --git a/modules/swagger-codegen/src/main/resources/php/api_test.mustache b/modules/swagger-codegen/src/main/resources/php/api_test.mustache index c4a549caace8..99ad7065c9b4 100644 --- a/modules/swagger-codegen/src/main/resources/php/api_test.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api_test.mustache @@ -19,6 +19,11 @@ namespace {{invokerPackage}}; +use \{{invokerPackage}}\Configuration; +use \{{invokerPackage}}\ApiClient; +use \{{invokerPackage}}\ApiException; +use \{{invokerPackage}}\ObjectSerializer; + /** * {{classname}}Test Class Doc Comment * @@ -30,6 +35,7 @@ namespace {{invokerPackage}}; */ {{#operations}}class {{classname}}Test extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test cases */ @@ -67,6 +73,7 @@ namespace {{invokerPackage}}; * Test case for {{{operationId}}} * * {{{summary}}}. + * */ public function test{{vendorExtensions.x-testOperationId}}() { diff --git a/modules/swagger-codegen/src/main/resources/php/configuration.mustache b/modules/swagger-codegen/src/main/resources/php/configuration.mustache index 94104b781b8a..bae256b3bd39 100644 --- a/modules/swagger-codegen/src/main/resources/php/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/configuration.mustache @@ -31,10 +31,7 @@ namespace {{invokerPackage}}; */ class Configuration { - /** - * @var Configuration - */ - private static $defaultConfiguration; + private static $defaultConfiguration = null; /** * Associate array to store API key(s) @@ -97,7 +94,7 @@ class Configuration * * @var string */ - protected $userAgent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{#artifactVersion}}{{{.}}}{{/artifactVersion}}{{^artifactVersion}}1.0.0{{/artifactVersion}}/php{{/httpUserAgent}}'; + protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{#artifactVersion}}{{{.}}}{{/artifactVersion}}{{^artifactVersion}}1.0.0{{/artifactVersion}}/php{{/httpUserAgent}}"; /** * Debug switch (default set to false) @@ -264,7 +261,6 @@ class Configuration * @param string $headerName header name (e.g. Token) * @param string $headerValue header value (e.g. 1z8wp3) * - * @throws \InvalidArgumentException * @return Configuration */ public function addDefaultHeader($headerName, $headerValue) @@ -297,7 +293,6 @@ class Configuration public function deleteDefaultHeader($headerName) { unset($this->defaultHeaders[$headerName]); - return $this; } /** @@ -328,7 +323,6 @@ class Configuration * * @param string $userAgent the user agent of the api client * - * @throws \InvalidArgumentException * @return Configuration */ public function setUserAgent($userAgent) @@ -356,7 +350,6 @@ class Configuration * * @param integer $seconds Number of seconds before timing out [set to 0 for no timeout] * - * @throws \InvalidArgumentException * @return Configuration */ public function setCurlTimeout($seconds) @@ -397,17 +390,6 @@ class Configuration * * @return bool */ - public function isDebug() - { - return $this->debug; - } - - /** - * Gets the debug flag - * - * @return bool - * @deprecated - */ public function getDebug() { return $this->debug; @@ -477,17 +459,6 @@ class Configuration * * @return boolean True if the certificate should be validated, false otherwise */ - public function isSSLVerification() - { - return $this->sslVerification; - } - - /** - * Gets if SSL verification should be enabled or disabled - * - * @return boolean True if the certificate should be validated, false otherwise - * @deprecated - */ public function getSSLVerification() { return $this->sslVerification; @@ -508,7 +479,7 @@ class Configuration } /** - * Sets the default configuration instance + * Sets the detault configuration instance * * @param Configuration $config An instance of the Configuration Object * diff --git a/modules/swagger-codegen/src/main/resources/php/model.mustache b/modules/swagger-codegen/src/main/resources/php/model.mustache index 04f178091e56..efecdf2e5960 100644 --- a/modules/swagger-codegen/src/main/resources/php/model.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model.mustache @@ -23,7 +23,6 @@ namespace {{modelPackage}}; use \ArrayAccess; -use \{{invokerPackage}}\ObjectSerializer; /** * {{classname}} Class Doc Comment diff --git a/modules/swagger-codegen/src/main/resources/php/model_generic.mustache b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache index 3937e8d98388..1e221b783775 100644 --- a/modules/swagger-codegen/src/main/resources/php/model_generic.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache @@ -183,7 +183,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple * validate all the properties in the model * return true if all passed * - * @return bool True if all properties are valid + * @return bool True if all properteis are valid */ public function valid() { @@ -365,9 +365,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + return json_encode(\{{invokerPackage}}\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode(\{{invokerPackage}}\ObjectSerializer::sanitizeForSerialization($this)); } } \ No newline at end of file From a76d69513c03baf5675d3ae8826315fcafa07ccc Mon Sep 17 00:00:00 2001 From: weiyang Date: Wed, 12 Oct 2016 17:14:36 +0800 Subject: [PATCH 9/9] [html]Group api index by operations.baseName (#3953) * [html]Group api index by operations.baseName Signed-off-by: weiyang * [html][samples]Group api index by operations.baseName Signed-off-by: weiyang --- .../main/resources/htmlDocs/index.mustache | 10 +++++---- .../resources/htmlDocs/style.css.mustache | 5 ++--- samples/html/index.html | 22 ++++++++++++++----- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache index 3c49831c8e81..466df75c41fa 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache @@ -28,23 +28,25 @@ [ Jump to Models ] {{! for the tables of content, I cheat and don't use CSS styles.... }} -

Table of Contents

+

Table of Contents

{{access}}
{{#apiInfo}} -
    {{#apis}} {{#operations}} +

    {{baseName}}

    + {{/operations}} {{/apis}} -
{{/apiInfo}} {{#apiInfo}} {{#apis}} {{#operations}} +

{{baseName}}

{{#operation}}
@@ -150,7 +152,7 @@

Models

[ Jump to Methods ] -

Table of Contents

+

Table of Contents

    {{#models}} {{#model}} diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs/style.css.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/style.css.mustache index 8d9a5755d7bb..04eccf69491c 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs/style.css.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs/style.css.mustache @@ -1,4 +1,4 @@ -body { +body { font-family: Trebuchet MS, sans-serif; font-size: 15px; color: #444; @@ -20,7 +20,6 @@ hr { border: 0; color: #ddd; background-color: #ddd; - display: none; } .app-desc { @@ -170,4 +169,4 @@ font-style: italic; color: #FFF; display: inline-block; text-decoration: none; -} \ No newline at end of file +} diff --git a/samples/html/index.html b/samples/html/index.html index 18b6a2fa44ce..d83d25c03a5e 100644 --- a/samples/html/index.html +++ b/samples/html/index.html @@ -3,7 +3,7 @@ Swagger Petstore @@ -196,9 +196,10 @@ font-style: italic;

    Methods

    [ Jump to Models ] -

    Table of Contents

    +

    Table of Contents

    -
      +

      Pet

      + +

      Store

      + +

      User

      +
    + +

    Pet

    Up @@ -683,6 +691,7 @@ font-style: italic; ApiResponse

    +

    Store

    Up @@ -896,6 +905,7 @@ font-style: italic;

    +

    User

    Up @@ -1254,7 +1264,7 @@ font-style: italic;

    Models

    [ Jump to Methods ] -

    Table of Contents

    +

    Table of Contents

    1. ApiResponse
    2. Category