From 6c6cf1c09ce6110beed4bc0614100a9350d02b1f Mon Sep 17 00:00:00 2001 From: Eric Hyche Date: Tue, 2 Jan 2018 10:32:55 -0500 Subject: [PATCH 01/65] Re-organize the reserved words for Swift4 --- .../codegen/languages/Swift4Codegen.java | 59 +++++++++++++++---- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift4Codegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift4Codegen.java index b6760ef363e..77aca1329da 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift4Codegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift4Codegen.java @@ -139,19 +139,52 @@ public Swift4Codegen() { // name used by swift client "ErrorResponse", "Response", - // swift keywords - "Int", "Int32", "Int64", "Int64", "Float", "Double", "Bool", "Void", "String", - "Character", "AnyObject", "Any", "Error", "URL", "class", "Class", "break", - "as", "associativity", "deinit", "case", "dynamicType", "convenience", "enum", - "continue", "false", "dynamic", "extension", "default", "is", "didSet", - "func", "do", "nil", "final", "import", "else", "self", "get", "init", - "fallthrough", "Self", "infix", "internal", "for", "super", "inout", "let", - "if", "true", "lazy", "operator", "in", "COLUMN", "left", "private", "return", - "FILE", "mutating", "protocol", "switch", "FUNCTION", "none", "public", - "where", "LINE", "nonmutating", "static", "while", "optional", "struct", - "override", "subscript", "postfix", "typealias", "precedence", "var", - "prefix", "Protocol", "required", "right", "set", "throw", "Type", "unowned", "weak", - "Data", "Codable", "Encodable", "Decodable") + // Added for Objective-C compatibility + "id", "description", "NSArray", "NSURL", "CGFloat", "NSSet", "NSString", "NSInteger", "NSUInteger", + "NSError", "NSDictionary", + + // + // Swift keywords. This list is taken from here: + // https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/doc/uid/TP40014097-CH30-ID410 + // + // Keywords used in declarations + "associatedtype", "class", "deinit", "enum", "extension", "fileprivate", "func", "import", "init", + "inout", "internal", "let", "open", "operator", "private", "protocol", "public", "static", "struct", + "subscript", "typealias", "var", + // Keywords uses in statements + "break", "case", "continue", "default", "defer", "do", "else", "fallthrough", "for", "guard", "if", + "in", "repeat", "return", "switch", "where", "while", + // Keywords used in expressions and types + "as", "Any", "catch", "false", "is", "nil", "rethrows", "super", "self", "Self", "throw", "throws", "true", "try", + // Keywords used in patterns + "_", + // Keywords that begin with a number sign + "#available", "#colorLiteral", "#column", "#else", "#elseif", "#endif", "#file", "#fileLiteral", "#function", "#if", + "#imageLiteral", "#line", "#selector", "#sourceLocation", + // Keywords reserved in particular contexts + "associativity", "convenience", "dynamic", "didSet", "final", "get", "infix", "indirect", "lazy", "left", + "mutating", "none", "nonmutating", "optional", "override", "postfix", "precedence", "prefix", "Protocol", + "required", "right", "set", "Type", "unowned", "weak", "willSet", + + // + // Swift Standard Library types + // https://developer.apple.com/documentation/swift + // + // Numbers and Basic Values + "Bool", "Int", "Double", "Float", "Range", "ClosedRange", "Error", "Optional", + // Special-Use Numeric Types + "UInt", "UInt8", "UInt16", "UInt32", "UInt64", "Int8", "Int16", "Int32", "Int64", "Float80", "Float32", "Float64", + // Strings and Text + "String", "Character", "Unicode", "StaticString", + // Collections + "Array", "Dictionary", "Set", "OptionSet", "CountableRange", "CountableClosedRange", + + // The following are commonly-used Foundation types + "URL", "Data", "Codable", "Encodable", "Decodable", + + // The following are other words we want to reserve + "Void", "AnyObject", "Class", "dynamicType", "COLUMN", "FILE", "FUNCTION", "LINE" + ) ); typeMapping = new HashMap<>(); From 30bd6f680d67872de220fb0f129bac66ff293190 Mon Sep 17 00:00:00 2001 From: Jinkui Shi Date: Sun, 7 Jan 2018 11:00:57 +0800 Subject: [PATCH 02/65] [akka-scala] License info add in template header #7321 (#7322) * [akka-scala] License info add in template header #7321 * generate petstore by akka-scala teplate --- .../src/main/resources/akka-scala/api.mustache | 6 +----- .../main/resources/akka-scala/apiInvoker.mustache | 7 +------ .../main/resources/akka-scala/apiRequest.mustache | 6 +----- .../main/resources/akka-scala/apiSettings.mustache | 6 +----- .../resources/akka-scala/enumsSerializers.mustache | 6 +----- .../main/resources/akka-scala/licenseInfo.mustache | 11 +++++++++++ .../src/main/resources/akka-scala/model.mustache | 7 +------ .../src/main/resources/akka-scala/requests.mustache | 6 +----- .../petstore/akka-scala/.swagger-codegen/VERSION | 2 +- samples/client/petstore/akka-scala/README.md | 2 +- .../io/swagger/client/api/EnumsSerializers.scala | 12 +++++++++--- .../main/scala/io/swagger/client/api/PetApi.scala | 12 +++++++++--- .../main/scala/io/swagger/client/api/StoreApi.scala | 12 +++++++++--- .../main/scala/io/swagger/client/api/UserApi.scala | 12 +++++++++--- .../scala/io/swagger/client/core/ApiInvoker.scala | 13 +++++++++---- .../scala/io/swagger/client/core/ApiRequest.scala | 12 +++++++++--- .../scala/io/swagger/client/core/ApiSettings.scala | 12 +++++++++--- .../scala/io/swagger/client/core/requests.scala | 12 +++++++++--- .../scala/io/swagger/client/model/ApiResponse.scala | 13 +++++++++---- .../scala/io/swagger/client/model/Category.scala | 13 +++++++++---- .../main/scala/io/swagger/client/model/Order.scala | 13 +++++++++---- .../main/scala/io/swagger/client/model/Pet.scala | 13 +++++++++---- .../main/scala/io/swagger/client/model/Tag.scala | 13 +++++++++---- .../main/scala/io/swagger/client/model/User.scala | 13 +++++++++---- 24 files changed, 146 insertions(+), 88 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/akka-scala/licenseInfo.mustache diff --git a/modules/swagger-codegen/src/main/resources/akka-scala/api.mustache b/modules/swagger-codegen/src/main/resources/akka-scala/api.mustache index 38401a7a8a5..7c60ac4d68e 100644 --- a/modules/swagger-codegen/src/main/resources/akka-scala/api.mustache +++ b/modules/swagger-codegen/src/main/resources/akka-scala/api.mustache @@ -1,8 +1,4 @@ -/** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new - */ +{{>licenseInfo}} package {{package}} {{#imports}} diff --git a/modules/swagger-codegen/src/main/resources/akka-scala/apiInvoker.mustache b/modules/swagger-codegen/src/main/resources/akka-scala/apiInvoker.mustache index f5455e31c62..82ed4ced156 100644 --- a/modules/swagger-codegen/src/main/resources/akka-scala/apiInvoker.mustache +++ b/modules/swagger-codegen/src/main/resources/akka-scala/apiInvoker.mustache @@ -1,9 +1,4 @@ -/** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new - */ - +{{>licenseInfo}} package {{invokerPackage}} import java.io.File diff --git a/modules/swagger-codegen/src/main/resources/akka-scala/apiRequest.mustache b/modules/swagger-codegen/src/main/resources/akka-scala/apiRequest.mustache index 4481096bc2a..fd2ba29ea0b 100644 --- a/modules/swagger-codegen/src/main/resources/akka-scala/apiRequest.mustache +++ b/modules/swagger-codegen/src/main/resources/akka-scala/apiRequest.mustache @@ -1,8 +1,4 @@ -/** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new - */ +{{>licenseInfo}} package {{invokerPackage}} sealed trait ResponseState diff --git a/modules/swagger-codegen/src/main/resources/akka-scala/apiSettings.mustache b/modules/swagger-codegen/src/main/resources/akka-scala/apiSettings.mustache index 0d0d204cacd..ad0e9851cb9 100644 --- a/modules/swagger-codegen/src/main/resources/akka-scala/apiSettings.mustache +++ b/modules/swagger-codegen/src/main/resources/akka-scala/apiSettings.mustache @@ -1,8 +1,4 @@ -/** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new - */ +{{>licenseInfo}} package {{invokerPackage}} import java.util.concurrent.TimeUnit diff --git a/modules/swagger-codegen/src/main/resources/akka-scala/enumsSerializers.mustache b/modules/swagger-codegen/src/main/resources/akka-scala/enumsSerializers.mustache index 3784981d3cb..d9fcd1babbe 100644 --- a/modules/swagger-codegen/src/main/resources/akka-scala/enumsSerializers.mustache +++ b/modules/swagger-codegen/src/main/resources/akka-scala/enumsSerializers.mustache @@ -1,8 +1,4 @@ -/** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new - */ +{{>licenseInfo}} package {{apiPackage}} import {{modelPackage}}._ diff --git a/modules/swagger-codegen/src/main/resources/akka-scala/licenseInfo.mustache b/modules/swagger-codegen/src/main/resources/akka-scala/licenseInfo.mustache new file mode 100644 index 00000000000..7d61c4ee055 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/akka-scala/licenseInfo.mustache @@ -0,0 +1,11 @@ +/** + * {{{appName}}} + * {{{appDescription}}} + * + * {{#version}}OpenAPI spec version: {{{version}}}{{/version}} + * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/akka-scala/model.mustache b/modules/swagger-codegen/src/main/resources/akka-scala/model.mustache index e5117e3a9cb..9ab495126a7 100644 --- a/modules/swagger-codegen/src/main/resources/akka-scala/model.mustache +++ b/modules/swagger-codegen/src/main/resources/akka-scala/model.mustache @@ -1,9 +1,4 @@ -/** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new - */ - +{{>licenseInfo}} package {{package}} import {{invokerPackage}}.ApiModel diff --git a/modules/swagger-codegen/src/main/resources/akka-scala/requests.mustache b/modules/swagger-codegen/src/main/resources/akka-scala/requests.mustache index 44a8208b9b5..d395664a8b6 100644 --- a/modules/swagger-codegen/src/main/resources/akka-scala/requests.mustache +++ b/modules/swagger-codegen/src/main/resources/akka-scala/requests.mustache @@ -1,8 +1,4 @@ -/** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new - */ +{{>licenseInfo}} package {{invokerPackage}} import java.io.File diff --git a/samples/client/petstore/akka-scala/.swagger-codegen/VERSION b/samples/client/petstore/akka-scala/.swagger-codegen/VERSION index f9f7450d135..cc6612c36e0 100644 --- a/samples/client/petstore/akka-scala/.swagger-codegen/VERSION +++ b/samples/client/petstore/akka-scala/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.0 \ No newline at end of file diff --git a/samples/client/petstore/akka-scala/README.md b/samples/client/petstore/akka-scala/README.md index ce932fb3acb..6e5c6c2706e 100644 --- a/samples/client/petstore/akka-scala/README.md +++ b/samples/client/petstore/akka-scala/README.md @@ -10,7 +10,7 @@ Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/ - API version: 1.0.0 - Package version: -- Build date: 2017-12-20T09:35:05.126-08:00 +- Build date: 2018-01-05T12:13:52.852+08:00 - Build package: io.swagger.codegen.languages.AkkaScalaClientCodegen # Requirements diff --git a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/api/EnumsSerializers.scala b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/api/EnumsSerializers.scala index 00ee7e0879f..40ecddb1a83 100644 --- a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/api/EnumsSerializers.scala +++ b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/api/EnumsSerializers.scala @@ -1,7 +1,13 @@ /** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. */ package io.swagger.client.api diff --git a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/api/PetApi.scala b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/api/PetApi.scala index 50950fa51c2..7bf6b502189 100644 --- a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/api/PetApi.scala +++ b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/api/PetApi.scala @@ -1,7 +1,13 @@ /** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. */ package io.swagger.client.api diff --git a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/api/StoreApi.scala b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/api/StoreApi.scala index 3ecb7ad9dae..59b443ddb41 100644 --- a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/api/StoreApi.scala +++ b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/api/StoreApi.scala @@ -1,7 +1,13 @@ /** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. */ package io.swagger.client.api diff --git a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/api/UserApi.scala b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/api/UserApi.scala index 95fa3aa5880..a923d78cc95 100644 --- a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/api/UserApi.scala +++ b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/api/UserApi.scala @@ -1,7 +1,13 @@ /** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. */ package io.swagger.client.api diff --git a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/ApiInvoker.scala b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/ApiInvoker.scala index e7d26ddd8fe..c565e0eade3 100644 --- a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/ApiInvoker.scala +++ b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/ApiInvoker.scala @@ -1,9 +1,14 @@ /** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. */ - package io.swagger.client.core import java.io.File diff --git a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/ApiRequest.scala b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/ApiRequest.scala index bedd5d70bc9..e0916bcb3d8 100644 --- a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/ApiRequest.scala +++ b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/ApiRequest.scala @@ -1,7 +1,13 @@ /** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. */ package io.swagger.client.core diff --git a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/ApiSettings.scala b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/ApiSettings.scala index 82e112dadbb..75add1e0e74 100644 --- a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/ApiSettings.scala +++ b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/ApiSettings.scala @@ -1,7 +1,13 @@ /** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. */ package io.swagger.client.core diff --git a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/requests.scala b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/requests.scala index 453673cb4fd..c094ebfd068 100644 --- a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/requests.scala +++ b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/core/requests.scala @@ -1,7 +1,13 @@ /** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. */ package io.swagger.client.core diff --git a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/ApiResponse.scala b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/ApiResponse.scala index 4357803cae8..4b03afadd7b 100644 --- a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/ApiResponse.scala +++ b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/ApiResponse.scala @@ -1,9 +1,14 @@ /** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. */ - package io.swagger.client.model import io.swagger.client.core.ApiModel diff --git a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/Category.scala b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/Category.scala index 4cf271ca1dd..db37fd879f2 100644 --- a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/Category.scala +++ b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/Category.scala @@ -1,9 +1,14 @@ /** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. */ - package io.swagger.client.model import io.swagger.client.core.ApiModel diff --git a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/Order.scala b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/Order.scala index 0c5ce261e04..1daf5d8eeaf 100644 --- a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/Order.scala +++ b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/Order.scala @@ -1,9 +1,14 @@ /** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. */ - package io.swagger.client.model import io.swagger.client.core.ApiModel diff --git a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/Pet.scala b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/Pet.scala index c7be875c9b4..2c528dc59f3 100644 --- a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/Pet.scala +++ b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/Pet.scala @@ -1,9 +1,14 @@ /** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. */ - package io.swagger.client.model import io.swagger.client.core.ApiModel diff --git a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/Tag.scala b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/Tag.scala index 99718dd7444..0866b87ca9c 100644 --- a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/Tag.scala +++ b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/Tag.scala @@ -1,9 +1,14 @@ /** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. */ - package io.swagger.client.model import io.swagger.client.core.ApiModel diff --git a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/User.scala b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/User.scala index 11b66fc5c00..69b30c4b332 100644 --- a/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/User.scala +++ b/samples/client/petstore/akka-scala/src/main/scala/io/swagger/client/model/User.scala @@ -1,9 +1,14 @@ /** - * NOTE: This class is auto generated by the akka-scala (beta) swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * For any issue or feedback, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues/new + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. */ - package io.swagger.client.model import io.swagger.client.core.ApiModel From 7f0dca7ac2ae9afb04cd0c012ff4e53516e44f27 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 7 Jan 2018 11:04:05 +0800 Subject: [PATCH 03/65] update version to 2.4.0-SNAPSHOT --- modules/swagger-codegen-cli/pom.xml | 2 +- modules/swagger-codegen-maven-plugin/pom.xml | 4 +--- modules/swagger-codegen/pom.xml | 2 +- modules/swagger-generator/pom.xml | 2 +- pom.xml | 2 +- pom.xml.bash | 2 +- pom.xml.circleci | 2 +- pom.xml.shippable | 2 +- 8 files changed, 8 insertions(+), 10 deletions(-) diff --git a/modules/swagger-codegen-cli/pom.xml b/modules/swagger-codegen-cli/pom.xml index 4907bafa684..a20e5420968 100644 --- a/modules/swagger-codegen-cli/pom.xml +++ b/modules/swagger-codegen-cli/pom.xml @@ -3,7 +3,7 @@ io.swagger swagger-codegen-project - 2.3.1-SNAPSHOT + 2.4.0-SNAPSHOT ../.. 4.0.0 diff --git a/modules/swagger-codegen-maven-plugin/pom.xml b/modules/swagger-codegen-maven-plugin/pom.xml index ddbd3b1d7dd..28236f345ad 100644 --- a/modules/swagger-codegen-maven-plugin/pom.xml +++ b/modules/swagger-codegen-maven-plugin/pom.xml @@ -1,12 +1,10 @@ - 4.0.0 - io.swagger swagger-codegen-project - 2.3.1-SNAPSHOT + 2.4.0-SNAPSHOT ../.. swagger-codegen-maven-plugin diff --git a/modules/swagger-codegen/pom.xml b/modules/swagger-codegen/pom.xml index 9e381957d56..c572ddcf0f1 100644 --- a/modules/swagger-codegen/pom.xml +++ b/modules/swagger-codegen/pom.xml @@ -3,7 +3,7 @@ io.swagger swagger-codegen-project - 2.3.1-SNAPSHOT + 2.4.0-SNAPSHOT ../.. 4.0.0 diff --git a/modules/swagger-generator/pom.xml b/modules/swagger-generator/pom.xml index df68f755ca8..bca8c7e48b8 100644 --- a/modules/swagger-generator/pom.xml +++ b/modules/swagger-generator/pom.xml @@ -4,7 +4,7 @@ io.swagger swagger-codegen-project - 2.3.1-SNAPSHOT + 2.4.0-SNAPSHOT ../.. swagger-generator diff --git a/pom.xml b/pom.xml index 8ce36577f34..011da0eceb9 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.3.1-SNAPSHOT + 2.4.0-SNAPSHOT https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git diff --git a/pom.xml.bash b/pom.xml.bash index 6d5b28d788e..ae23b4a2394 100644 --- a/pom.xml.bash +++ b/pom.xml.bash @@ -9,7 +9,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.3.1-SNAPSHOT + 2.4.0-SNAPSHOT https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git diff --git a/pom.xml.circleci b/pom.xml.circleci index 995b2617ab1..f54ae23d6d2 100644 --- a/pom.xml.circleci +++ b/pom.xml.circleci @@ -9,7 +9,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.3.1-SNAPSHOT + 2.4.0-SNAPSHOT https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git diff --git a/pom.xml.shippable b/pom.xml.shippable index 89e99af26bf..ca557bbc5d0 100644 --- a/pom.xml.shippable +++ b/pom.xml.shippable @@ -9,7 +9,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.3.1-SNAPSHOT + 2.4.0-SNAPSHOT https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git From a5009b592ec17d9f9f82c5a78ebf585e6ace9828 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 7 Jan 2018 11:05:58 +0800 Subject: [PATCH 04/65] add shijinkui to scala technical committee --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d0824a62d4f..e660b5d98f3 100644 --- a/README.md +++ b/README.md @@ -1116,7 +1116,7 @@ If you want to join the committee, please kindly apply by sending an email to wi | R | | | Ruby | @cliffano (2017/07) @zlx (2017/09) | | Rust | @frol (2017/07) @farcaller (2017/08) @bjgill (2017/12) | -| Scala | @clasnake (2017/07) @jimschubert (2017/09) | +| Scala | @clasnake (2017/07) @jimschubert (2017/09) @shijinkui (2018/01) | | Swift | @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) | | TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) | From 4bb6d8993ca8fd33e760347edc9134e99c05e0a1 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 7 Jan 2018 11:15:13 +0800 Subject: [PATCH 05/65] fix removeOperationIdPrefix in additional properties (#7301) --- .../src/main/java/io/swagger/codegen/DefaultCodegen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 2593f85c3ba..9591a0ba771 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -152,7 +152,7 @@ public void processOpts() { } if (additionalProperties.containsKey(CodegenConstants.REMOVE_OPERATION_ID_PREFIX)) { - this.setSortParamsByRequiredFlag(Boolean.valueOf(additionalProperties + this.setRemoveOperationIdPrefix(Boolean.valueOf(additionalProperties .get(CodegenConstants.REMOVE_OPERATION_ID_PREFIX).toString())); } } From fa3e72e6e3601c62f7ed1a5ce847d556f2186361 Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Sun, 7 Jan 2018 12:21:53 +0900 Subject: [PATCH 06/65] [PHP] Cleanup AnimalFarmTest (#7279) * Move test codes in "test" to "tests" * Regenerate test/Model/AnimalFarmTest.php --- .../test/Model/AnimalFarmTest.php | 104 +----------------- .../tests/ModelInheritanceTest.php | 96 ++++++++++++++++ 2 files changed, 102 insertions(+), 98 deletions(-) create mode 100644 samples/client/petstore/php/SwaggerClient-php/tests/ModelInheritanceTest.php diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Model/AnimalFarmTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Model/AnimalFarmTest.php index 37e736a5d2d..8f4500cebef 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Model/AnimalFarmTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Model/AnimalFarmTest.php @@ -6,8 +6,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -19,18 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Swagger Codegen version: 2.3.0-SNAPSHOT */ /** @@ -44,11 +32,11 @@ /** * AnimalFarmTest Class Doc Comment * - * @category Class - * @description AnimalFarm + * @category Class */ +// * @description AnimalFarm +/** * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class AnimalFarmTest extends \PHPUnit_Framework_TestCase @@ -59,7 +47,6 @@ class AnimalFarmTest extends \PHPUnit_Framework_TestCase */ public static function setUpBeforeClass() { - } /** @@ -67,7 +54,6 @@ public static function setUpBeforeClass() */ public function setUp() { - } /** @@ -75,7 +61,6 @@ public function setUp() */ public function tearDown() { - } /** @@ -83,7 +68,6 @@ public function tearDown() */ public static function tearDownAfterClass() { - } /** @@ -91,81 +75,5 @@ public static function tearDownAfterClass() */ public function testAnimalFarm() { - - } - - // test if default values works - public function testDefaultValues() - { - // add some animals to the farm to make sure the ArrayAccess - // interface works - $dog = new Model\Dog(); - $animal = new Model\Animal(); - - // assert we can look up the animals in the farm by array - // indices (let's try a random order) - $this->assertSame('red', $dog->getColor()); - $this->assertSame('red', $animal->getColor()); - } - - // test inheritance in the model - public function testInheritance() - { - $new_dog = new Model\Dog; - // the object should be an instance of the derived class - $this->assertInstanceOf('Swagger\Client\Model\Dog', $new_dog); - // the object should also be an instance of the parent class - $this->assertInstanceOf('Swagger\Client\Model\Animal', $new_dog); - } - - // test inheritance constructor is working with data - // initialization - public function testInheritanceConstructorDataInitialization() - { - // initialize the object with data in the constructor - $data = array( - 'class_name' => 'Dog', - 'breed' => 'Great Dane' - ); - $new_dog = new Model\Dog($data); - - // the property on the derived class should be set - $this->assertSame('Great Dane', $new_dog->getBreed()); - // the property on the parent class should be set - $this->assertSame('Dog', $new_dog->getClassName()); - } - - // test if discriminator is initialized automatically - public function testDiscriminatorInitialization() - { - $new_dog = new Model\Dog(); - $this->assertSame('Dog', $new_dog->getClassName()); - } - - // test if ArrayAccess interface works - public function testArrayStuff() - { - // create an AnimalFarm which is an object implementing the - // ArrayAccess interface - $farm = new Model\AnimalFarm(); - - // add some animals to the farm to make sure the ArrayAccess - // interface works - $farm[] = new Model\Dog(); - $farm[] = new Model\Cat(); - $farm[] = new Model\Animal(); - - // assert we can look up the animals in the farm by array - // indices (let's try a random order) - $this->assertInstanceOf('Swagger\Client\Model\Cat', $farm[1]); - $this->assertInstanceOf('Swagger\Client\Model\Dog', $farm[0]); - $this->assertInstanceOf('Swagger\Client\Model\Animal', $farm[2]); - - // let's try to `foreach` the animals in the farm and let's - // try to use the objects we loop through - foreach ($farm as $animal) { - $this->assertContains($animal->getClassName(), array('Dog', 'Cat', 'Animal')); - $this->assertInstanceOf('Swagger\Client\Model\Animal', $animal); - } } } diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/ModelInheritanceTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/ModelInheritanceTest.php new file mode 100644 index 00000000000..658e60ba638 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/tests/ModelInheritanceTest.php @@ -0,0 +1,96 @@ +assertSame('red', $dog->getColor()); + $this->assertSame('red', $animal->getColor()); + } + + /** + * test inheritance in the model + */ + public function testInheritance() + { + $newDog = new Dog; + // the object should be an instance of the derived class + $this->assertInstanceOf(Dog::class, $newDog); + // the object should also be an instance of the parent class + $this->assertInstanceOf(Animal::class, $newDog); + } + + /** + * test inheritance constructor is working with data initialization + */ + public function testInheritanceConstructorDataInitialization() + { + // initialize the object with data in the constructor + $data = [ + 'class_name' => 'Dog', + 'breed' => 'Great Dane', + ]; + $newDog = new Dog($data); + + // the property on the derived class should be set + $this->assertSame('Great Dane', $newDog->getBreed()); + // the property on the parent class should be set + $this->assertSame('Dog', $newDog->getClassName()); + } + + /** + * test if discriminator is initialized automatically + */ + public function testDiscriminatorInitialization() + { + $newDog = new Dog(); + $this->assertSame('Dog', $newDog->getClassName()); + } + + /** + * test if ArrayAccess interface works + */ + public function testArrayStuff() + { + // create an AnimalFarm which is an object implementing the ArrayAccess interface + $farm = new AnimalFarm(); + + // add some animals to the farm to make sure the ArrayAccess interface works + $farm[] = new Dog(); + $farm[] = new Cat(); + $farm[] = new Animal(); + + // assert we can look up the animals in the farm by array indices (let's try a random order) + $this->assertInstanceOf(Cat::class, $farm[1]); + $this->assertInstanceOf(Dog::class, $farm[0]); + $this->assertInstanceOf(Animal::class, $farm[2]); + + // let's try to `foreach` the animals in the farm and let's try to use the objects we loop through + foreach ($farm as $animal) { + $this->assertContains($animal->getClassName(), ['Dog', 'Cat', 'Animal']); + $this->assertInstanceOf('Swagger\Client\Model\Animal', $animal); + } + } +} From 68a45527412e7948fa0271b5480dbb993d8b9742 Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Sun, 7 Jan 2018 12:23:05 +0900 Subject: [PATCH 07/65] Tweak test doc comment (#7280) --- .../src/main/resources/php/model_test.mustache | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/model_test.mustache b/modules/swagger-codegen/src/main/resources/php/model_test.mustache index 363be167fcb..99064308f5f 100644 --- a/modules/swagger-codegen/src/main/resources/php/model_test.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model_test.mustache @@ -24,9 +24,8 @@ namespace {{invokerPackage}}; /** * {{classname}}Test Class Doc Comment * - * @category Class */ -// * @description {{#description}}{{description}}{{/description}}{{^description}}{{classname}}{{/description}} -/** + * @category Class + * @description {{#description}}{{description}}{{/description}}{{^description}}{{classname}}{{/description}} * @package {{invokerPackage}} * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen From fa9fc4b45bd5c626c623e7d1ecb7b3c005d3375c Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Sun, 7 Jan 2018 12:34:17 +0900 Subject: [PATCH 08/65] Delete ApiClient (#7305) --- .../src/main/resources/php/ApiClient.mustache | 361 ----------------- .../php/SwaggerClient-php/lib/ApiClient.php | 371 ------------------ .../test/Client/ApiClientTest.php | 126 ------ 3 files changed, 858 deletions(-) delete mode 100644 modules/swagger-codegen/src/main/resources/php/ApiClient.mustache delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php delete mode 100644 samples/client/petstore/php/SwaggerClient-php/test/Client/ApiClientTest.php diff --git a/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache deleted file mode 100644 index 8f0f1167151..00000000000 --- a/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache +++ /dev/null @@ -1,361 +0,0 @@ -partial_header}} -/** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ - -namespace {{invokerPackage}}; - -/** - * ApiClient Class Doc Comment - * - * @category Class - * @package {{invokerPackage}} - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen - */ -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"; - - /** - * Configuration - * - * @var Configuration - */ - protected $config; - - /** - * Object Serializer - * - * @var ObjectSerializer - */ - protected $serializer; - - /** - * Constructor of the class - * - * @param Configuration $config config for this ApiClient - */ - public function __construct(\{{invokerPackage}}\Configuration $config = null) - { - if ($config === null) { - $config = Configuration::getDefaultConfiguration(); - } - - $this->config = $config; - $this->serializer = new ObjectSerializer(); - } - - /** - * Get the config - * - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Get the serializer - * - * @return ObjectSerializer - */ - public function getSerializer() - { - return $this->serializer; - } - - /** - * Get API key (with prefix if set) - * - * @param string $apiKeyIdentifier name of apikey - * - * @return string API key with the prefix - */ - public function getApiKeyWithPrefix($apiKeyIdentifier) - { - $prefix = $this->config->getApiKeyPrefix($apiKeyIdentifier); - $apiKey = $this->config->getApiKey($apiKeyIdentifier); - - if (!isset($apiKey)) { - return null; - } - - if (isset($prefix)) { - $keyWithPrefix = $prefix." ".$apiKey; - } else { - $keyWithPrefix = $apiKey; - } - - return $keyWithPrefix; - } - - /** - * 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 - * - * @throws \{{invokerPackage}}\ApiException on a non 2xx response - * @return mixed - */ - public function callApi($resourcePath, $method, $queryParams, $postData, $headerParams, $responseType = null, $endpointPath = null) - { - $headers = []; - - // construct the http header - $headerParams = array_merge( - (array)$this->config->getDefaultHeaders(), - (array)$headerParams - ); - - foreach ($headerParams as $key => $val) { - $headers[] = "$key: $val"; - } - - // form data - if ($postData and 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)); - } - - $url = $this->config->getHost() . $resourcePath; - - $curl = curl_init(); - // set timeout, if needed - if ($this->config->getCurlTimeout() !== 0) { - curl_setopt($curl, CURLOPT_TIMEOUT, $this->config->getCurlTimeout()); - } - // set connect timeout, if needed - if ($this->config->getCurlConnectTimeout() != 0) { - curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $this->config->getCurlConnectTimeout()); - } - - // return the result on success, rather than just true - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - - curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); - - // disable SSL verification, if needed - if ($this->config->getSSLVerification() === false) { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); - } - - if ($this->config->getCurlProxyHost()) { - curl_setopt($curl, CURLOPT_PROXY, $this->config->getCurlProxyHost()); - } - - if ($this->config->getCurlProxyPort()) { - curl_setopt($curl, CURLOPT_PROXYPORT, $this->config->getCurlProxyPort()); - } - - if ($this->config->getCurlProxyType()) { - curl_setopt($curl, CURLOPT_PROXYTYPE, $this->config->getCurlProxyType()); - } - - if ($this->config->getCurlProxyUser()) { - curl_setopt($curl, CURLOPT_PROXYUSERPWD, $this->config->getCurlProxyUser() . ':' .$this->config->getCurlProxyPassword()); - } - - if (!empty($queryParams)) { - $url = ($url . '?' . http_build_query($queryParams)); - } - - if ($this->config->getAllowEncoding()) { - curl_setopt($curl, CURLOPT_ENCODING, ''); - } - - if ($method === self::$POST) { - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); - } elseif ($method === self::$HEAD) { - curl_setopt($curl, CURLOPT_NOBODY, true); - } elseif ($method === self::$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_POSTFIELDS, $postData); - } elseif ($method === self::$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_POSTFIELDS, $postData); - } elseif ($method !== self::$GET) { - throw new ApiException('Method ' . $method . ' is not recognized.'); - } - curl_setopt($curl, CURLOPT_URL, $url); - - // Set user agent - 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()); - - curl_setopt($curl, CURLOPT_VERBOSE, 1); - curl_setopt($curl, CURLOPT_STDERR, fopen($this->config->getDebugFile(), 'a')); - } else { - curl_setopt($curl, CURLOPT_VERBOSE, 0); - } - - // obtain the HTTP response headers - curl_setopt($curl, CURLOPT_HEADER, 1); - - // 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); - - // 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()); - } - - // Handle the response - 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 (!empty($curl_error_message)) { - $error_message = "API call to $url failed: $curl_error_message"; - } else { - $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($error_message, 0, null, null); - $exception->setResponseObject($response_info); - throw $exception; - } 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 [$http_body, $response_info['http_code'], $http_header]; - } - - $data = json_decode($http_body); - if (json_last_error() > 0) { // if response is a string - $data = $http_body; - } - } else { - $data = json_decode($http_body); - if (json_last_error() > 0) { // if response is a string - $data = $http_body; - } - - throw new ApiException( - "[".$response_info['http_code']."] Error connecting to the API ($url)", - $response_info['http_code'], - $http_header, - $data - ); - } - return [$data, $response_info['http_code'], $http_header]; - } - - /** - * Return the header 'Accept' based on an array of Accept provided - * - * @param string[] $accept Array of header - * - * @return string Accept (e.g. application/json) - */ - public function selectHeaderAccept($accept) - { - if (count($accept) === 0 or (count($accept) === 1 and $accept[0] === '')) { - return null; - } elseif (preg_grep("/application\/json/i", $accept)) { - return 'application/json'; - } else { - return implode(',', $accept); - } - } - - /** - * Return the content type based on an array of content-type provided - * - * @param string[] $content_type Array fo content-type - * - * @return string Content-Type (e.g. application/json) - */ - public function selectHeaderContentType($content_type) - { - if (count($content_type) === 0 or (count($content_type) === 1 and $content_type[0] === '')) { - return 'application/json'; - } elseif (preg_grep("/application\/json/i", $content_type)) { - return 'application/json'; - } else { - return implode(',', $content_type); - } - } - - /** - * Return an array of HTTP response headers - * - * @param string $raw_headers A string of raw HTTP response headers - * - * @return string[] Array of HTTP response heaers - */ - protected function httpParseHeaders($raw_headers) - { - // ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986 - $headers = []; - $key = ''; - - foreach (explode("\n", $raw_headers) as $h) { - $h = explode(':', $h, 2); - - if (isset($h[1])) { - if (!isset($headers[$h[0]])) { - $headers[$h[0]] = trim($h[1]); - } elseif (is_array($headers[$h[0]])) { - $headers[$h[0]] = array_merge($headers[$h[0]], [trim($h[1])]); - } else { - $headers[$h[0]] = array_merge([$headers[$h[0]]], [trim($h[1])]); - } - - $key = $h[0]; - } else { - if (substr($h[0], 0, 1) === "\t") { - $headers[$key] .= "\r\n\t".trim($h[0]); - } elseif (!$key) { - $headers[0] = trim($h[0]); - } - trim($h[0]); - } - } - - return $headers; - } -} diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php b/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php deleted file mode 100644 index f7643a1a5fb..00000000000 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php +++ /dev/null @@ -1,371 +0,0 @@ -config = $config; - $this->serializer = new ObjectSerializer(); - } - - /** - * Get the config - * - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Get the serializer - * - * @return ObjectSerializer - */ - public function getSerializer() - { - return $this->serializer; - } - - /** - * Get API key (with prefix if set) - * - * @param string $apiKeyIdentifier name of apikey - * - * @return string API key with the prefix - */ - public function getApiKeyWithPrefix($apiKeyIdentifier) - { - $prefix = $this->config->getApiKeyPrefix($apiKeyIdentifier); - $apiKey = $this->config->getApiKey($apiKeyIdentifier); - - if (!isset($apiKey)) { - return null; - } - - if (isset($prefix)) { - $keyWithPrefix = $prefix." ".$apiKey; - } else { - $keyWithPrefix = $apiKey; - } - - return $keyWithPrefix; - } - - /** - * 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 - * - * @throws \Swagger\Client\ApiException on a non 2xx response - * @return mixed - */ - public function callApi($resourcePath, $method, $queryParams, $postData, $headerParams, $responseType = null, $endpointPath = null) - { - $headers = []; - - // construct the http header - $headerParams = array_merge( - (array)$this->config->getDefaultHeaders(), - (array)$headerParams - ); - - foreach ($headerParams as $key => $val) { - $headers[] = "$key: $val"; - } - - // form data - if ($postData and 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(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($postData)); - } - - $url = $this->config->getHost() . $resourcePath; - - $curl = curl_init(); - // set timeout, if needed - if ($this->config->getCurlTimeout() !== 0) { - curl_setopt($curl, CURLOPT_TIMEOUT, $this->config->getCurlTimeout()); - } - // set connect timeout, if needed - if ($this->config->getCurlConnectTimeout() != 0) { - curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $this->config->getCurlConnectTimeout()); - } - - // return the result on success, rather than just true - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - - curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); - - // disable SSL verification, if needed - if ($this->config->getSSLVerification() === false) { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); - } - - if ($this->config->getCurlProxyHost()) { - curl_setopt($curl, CURLOPT_PROXY, $this->config->getCurlProxyHost()); - } - - if ($this->config->getCurlProxyPort()) { - curl_setopt($curl, CURLOPT_PROXYPORT, $this->config->getCurlProxyPort()); - } - - if ($this->config->getCurlProxyType()) { - curl_setopt($curl, CURLOPT_PROXYTYPE, $this->config->getCurlProxyType()); - } - - if ($this->config->getCurlProxyUser()) { - curl_setopt($curl, CURLOPT_PROXYUSERPWD, $this->config->getCurlProxyUser() . ':' .$this->config->getCurlProxyPassword()); - } - - if (!empty($queryParams)) { - $url = ($url . '?' . http_build_query($queryParams)); - } - - if ($this->config->getAllowEncoding()) { - curl_setopt($curl, CURLOPT_ENCODING, ''); - } - - if ($method === self::$POST) { - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); - } elseif ($method === self::$HEAD) { - curl_setopt($curl, CURLOPT_NOBODY, true); - } elseif ($method === self::$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_POSTFIELDS, $postData); - } elseif ($method === self::$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_POSTFIELDS, $postData); - } elseif ($method !== self::$GET) { - throw new ApiException('Method ' . $method . ' is not recognized.'); - } - curl_setopt($curl, CURLOPT_URL, $url); - - // Set user agent - 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()); - - curl_setopt($curl, CURLOPT_VERBOSE, 1); - curl_setopt($curl, CURLOPT_STDERR, fopen($this->config->getDebugFile(), 'a')); - } else { - curl_setopt($curl, CURLOPT_VERBOSE, 0); - } - - // obtain the HTTP response headers - curl_setopt($curl, CURLOPT_HEADER, 1); - - // 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); - - // 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()); - } - - // Handle the response - 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 (!empty($curl_error_message)) { - $error_message = "API call to $url failed: $curl_error_message"; - } else { - $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($error_message, 0, null, null); - $exception->setResponseObject($response_info); - throw $exception; - } 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 [$http_body, $response_info['http_code'], $http_header]; - } - - $data = json_decode($http_body); - if (json_last_error() > 0) { // if response is a string - $data = $http_body; - } - } else { - $data = json_decode($http_body); - if (json_last_error() > 0) { // if response is a string - $data = $http_body; - } - - throw new ApiException( - "[".$response_info['http_code']."] Error connecting to the API ($url)", - $response_info['http_code'], - $http_header, - $data - ); - } - return [$data, $response_info['http_code'], $http_header]; - } - - /** - * Return the header 'Accept' based on an array of Accept provided - * - * @param string[] $accept Array of header - * - * @return string Accept (e.g. application/json) - */ - public function selectHeaderAccept($accept) - { - if (count($accept) === 0 or (count($accept) === 1 and $accept[0] === '')) { - return null; - } elseif (preg_grep("/application\/json/i", $accept)) { - return 'application/json'; - } else { - return implode(',', $accept); - } - } - - /** - * Return the content type based on an array of content-type provided - * - * @param string[] $content_type Array fo content-type - * - * @return string Content-Type (e.g. application/json) - */ - public function selectHeaderContentType($content_type) - { - if (count($content_type) === 0 or (count($content_type) === 1 and $content_type[0] === '')) { - return 'application/json'; - } elseif (preg_grep("/application\/json/i", $content_type)) { - return 'application/json'; - } else { - return implode(',', $content_type); - } - } - - /** - * Return an array of HTTP response headers - * - * @param string $raw_headers A string of raw HTTP response headers - * - * @return string[] Array of HTTP response heaers - */ - protected function httpParseHeaders($raw_headers) - { - // ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986 - $headers = []; - $key = ''; - - foreach (explode("\n", $raw_headers) as $h) { - $h = explode(':', $h, 2); - - if (isset($h[1])) { - if (!isset($headers[$h[0]])) { - $headers[$h[0]] = trim($h[1]); - } elseif (is_array($headers[$h[0]])) { - $headers[$h[0]] = array_merge($headers[$h[0]], [trim($h[1])]); - } else { - $headers[$h[0]] = array_merge([$headers[$h[0]]], [trim($h[1])]); - } - - $key = $h[0]; - } else { - if (substr($h[0], 0, 1) === "\t") { - $headers[$key] .= "\r\n\t".trim($h[0]); - } elseif (!$key) { - $headers[0] = trim($h[0]); - } - trim($h[0]); - } - } - - return $headers; - } -} diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Client/ApiClientTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Client/ApiClientTest.php deleted file mode 100644 index c7c90b115d7..00000000000 --- a/samples/client/petstore/php/SwaggerClient-php/test/Client/ApiClientTest.php +++ /dev/null @@ -1,126 +0,0 @@ -assertSame('application/json', $api_client->selectHeaderAccept(array( - 'application/xml', - 'application/json' - ))); - $this->assertSame(null, $api_client->selectHeaderAccept(array())); - $this->assertSame('application/yaml,application/xml', $api_client->selectHeaderAccept(array( - 'application/yaml', - 'application/xml' - ))); - - // test selectHeaderContentType - $this->assertSame('application/json', $api_client->selectHeaderContentType(array( - 'application/xml', - 'application/json' - ))); - $this->assertSame('application/json', $api_client->selectHeaderContentType(array())); - $this->assertSame('application/yaml,application/xml', $api_client->selectHeaderContentType(array( - 'application/yaml', - 'application/xml' - ))); - - // test addDefaultHeader and getDefaultHeader - $api_client->getConfig()->addDefaultHeader('test1', 'value1'); - $api_client->getConfig()->addDefaultHeader('test2', 200); - $defaultHeader = $api_client->getConfig()->getDefaultHeaders(); - $this->assertSame('value1', $defaultHeader['test1']); - $this->assertSame(200, $defaultHeader['test2']); - - // test deleteDefaultHeader - $api_client->getConfig()->deleteDefaultHeader('test2'); - $defaultHeader = $api_client->getConfig()->getDefaultHeaders(); - $this->assertFalse(isset($defaultHeader['test2'])); - - $pet_api2 = new Api\PetApi(); - $config3 = new Configuration(); - $apiClient3 = new ApiClient($config3); - $apiClient3->getConfig()->setUserAgent('api client 3'); - $config4 = new Configuration(); - $apiClient4 = new ApiClient($config4); - $apiClient4->getConfig()->setUserAgent('api client 4'); - $pet_api3 = new Api\PetApi($apiClient3); - - // 2 different api clients are not the same - $this->assertNotEquals($apiClient3, $apiClient4); - // customied pet api not using the old pet api's api client - $this->assertNotEquals($pet_api2->getApiClient(), $pet_api3->getApiClient()); - - // test access token - $api_client->getConfig()->setAccessToken("testing_only"); - $this->assertSame('testing_only', $api_client->getConfig()->getAccessToken()); - } - -} From 14a2c81adb337531cc842a3616e112887b28c2bb Mon Sep 17 00:00:00 2001 From: marcindanek85 Date: Sun, 7 Jan 2018 04:40:10 +0100 Subject: [PATCH 09/65] Replaced \t with spaces (#7265) * Added copying array type descriptors (isBoolean, isNumber, etc) to specify the type of items in array * Replaced \t with spaces --- .../main/java/io/swagger/codegen/DefaultCodegen.java | 11 +++++++++++ .../codegen/languages/AbstractEiffelCodegen.java | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 9591a0ba771..1e9dd021fe3 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -1835,6 +1835,17 @@ protected void updatePropertyForArray(CodegenProperty property, CodegenProperty property.complexType = innerProperty.baseType; } else { property.isPrimitiveType = true; + property.isBoolean = innerProperty.isBoolean; + property.isLong = innerProperty.isLong; + property.isInteger = innerProperty.isInteger; + property.isDouble = innerProperty.isDouble; + property.isFloat = innerProperty.isFloat; + property.isByteArray = innerProperty.isByteArray; + property.isBinary = innerProperty.isBinary; + property.isFile = innerProperty.isFile; + property.isDate = innerProperty.isDate; + property.isDateTime = innerProperty.isDateTime; + property.isString = innerProperty.isString; } property.items = innerProperty; // inner item is Enum diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractEiffelCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractEiffelCodegen.java index 723e2fb1f7e..c5894e6ba3d 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractEiffelCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractEiffelCodegen.java @@ -584,6 +584,17 @@ protected void updatePropertyForArray(CodegenProperty property, CodegenProperty property.complexType = innerProperty.baseType; } else { property.isPrimitiveType = true; + property.isBoolean = innerProperty.isBoolean; + property.isLong = innerProperty.isLong; + property.isInteger = innerProperty.isInteger; + property.isDouble = innerProperty.isDouble; + property.isFloat = innerProperty.isFloat; + property.isByteArray = innerProperty.isByteArray; + property.isBinary = innerProperty.isBinary; + property.isFile = innerProperty.isFile; + property.isDate = innerProperty.isDate; + property.isDateTime = innerProperty.isDateTime; + property.isString = innerProperty.isString; } property.items = innerProperty; // inner item is Enum From 9b5bba01938d7e7b5113ba5185698725bcd5259a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernat=20R=C3=A0fales?= Date: Sun, 7 Jan 2018 03:41:14 +0000 Subject: [PATCH 10/65] Correct minor typo in Ruby gemspec files (#7263) [Ruby] Correct minor typo in Ruby gemspec files --- .../swagger-codegen/src/main/resources/ruby/gemspec.mustache | 2 +- samples/client/petstore-security-test/ruby/petstore.gemspec | 2 +- samples/client/petstore/ruby/petstore.gemspec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache b/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache index 7501d1360e8..1f30abfe0d2 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache @@ -20,7 +20,7 @@ Gem::Specification.new do |s| s.license = "{{{gemLicense}}}" {{/gemLicense}} {{^gemLicense}} - # TODO uncommnet and update below with a proper license + # TODO uncomment and update below with a proper license #s.license = "Apache 2.0" {{/gemLicense}} s.required_ruby_version = "{{{gemRequiredRubyVersion}}}{{^gemRequiredRubyVersion}}>= 1.9{{/gemRequiredRubyVersion}}" diff --git a/samples/client/petstore-security-test/ruby/petstore.gemspec b/samples/client/petstore-security-test/ruby/petstore.gemspec index 51d168e828b..b525d76e62c 100644 --- a/samples/client/petstore-security-test/ruby/petstore.gemspec +++ b/samples/client/petstore-security-test/ruby/petstore.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |s| s.homepage = "https://github.com/swagger-api/swagger-codegen" s.summary = "Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r Ruby Gem" s.description = "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end -- " - # TODO uncommnet and update below with a proper license + # TODO uncomment and update below with a proper license #s.license = "Apache 2.0" s.required_ruby_version = ">= 1.9" diff --git a/samples/client/petstore/ruby/petstore.gemspec b/samples/client/petstore/ruby/petstore.gemspec index 5971503b533..1fd31302b79 100644 --- a/samples/client/petstore/ruby/petstore.gemspec +++ b/samples/client/petstore/ruby/petstore.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |s| s.homepage = "https://github.com/swagger-api/swagger-codegen" s.summary = "Swagger Petstore Ruby Gem" s.description = "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\" - # TODO uncommnet and update below with a proper license + # TODO uncomment and update below with a proper license #s.license = "Apache 2.0" s.required_ruby_version = ">= 1.9" From 50d217894ca343a2b4afbb2f705aef45bba90831 Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Sun, 7 Jan 2018 12:42:44 +0900 Subject: [PATCH 11/65] [PHP] Cleanup EnumTest (#7282) * Move test codes in "test" to "tests" - EnumClassTest - EnumTestTest * Regenerate test/Model/Enum(Class|Test)Test.php --- .../test/Model/EnumClassTest.php | 51 ++++++------ .../test/Model/EnumTestTest.php | 82 +++++++++++++------ .../SwaggerClient-php/tests/EnumClassTest.php | 15 ++++ .../SwaggerClient-php/tests/EnumTestTest.php | 18 ++++ 4 files changed, 117 insertions(+), 49 deletions(-) create mode 100644 samples/client/petstore/php/SwaggerClient-php/tests/EnumClassTest.php create mode 100644 samples/client/petstore/php/SwaggerClient-php/tests/EnumTestTest.php diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Model/EnumClassTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Model/EnumClassTest.php index 23180be95b0..6273e04d854 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Model/EnumClassTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Model/EnumClassTest.php @@ -6,60 +6,68 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Swagger Petstore * - * http://www.apache.org/licenses/LICENSE-2.0 + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.0-SNAPSHOT */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen * Please update the test case below to test the model. */ -namespace Swagger\Client\Model; +namespace Swagger\Client; /** * EnumClassTest Class Doc Comment * - * @category Class - * @description EnumClass + * @category Class */ +// * @description EnumClass +/** * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class EnumClassTest extends \PHPUnit_Framework_TestCase { /** - * Setup before running each test case + * Setup before running any test case */ public static function setUpBeforeClass() { + } + /** + * Setup before running each test case + */ + public function setUp() + { } /** * Clean up after running each test case */ - public static function tearDownAfterClass() + public function tearDown() { + } + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass() + { } /** @@ -67,8 +75,5 @@ public static function tearDownAfterClass() */ public function testEnumClass() { - $this->assertSame(EnumClass::ABC, "_abc"); - $this->assertSame(EnumClass::EFG, "-efg"); - $this->assertSame(EnumClass::XYZ, "(xyz)"); } } diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Model/EnumTestTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Model/EnumTestTest.php index 79ba379f540..f876d6c8c35 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Model/EnumTestTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Model/EnumTestTest.php @@ -6,60 +6,68 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ + /** - * Copyright 2016 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Swagger Petstore * - * http://www.apache.org/licenses/LICENSE-2.0 + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + * Swagger Codegen version: 2.3.0-SNAPSHOT */ + /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen * Please update the test case below to test the model. */ -namespace Swagger\Client\Model; +namespace Swagger\Client; /** * EnumTestTest Class Doc Comment * - * @category Class - * @description EnumTest + * @category Class */ +// * @description EnumTest +/** * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class EnumTestTest extends \PHPUnit_Framework_TestCase { /** - * Setup before running each test case + * Setup before running any test case */ public static function setUpBeforeClass() { + } + /** + * Setup before running each test case + */ + public function setUp() + { } /** * Clean up after running each test case */ - public static function tearDownAfterClass() + public function tearDown() { + } + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass() + { } /** @@ -67,11 +75,33 @@ public static function tearDownAfterClass() */ public function testEnumTest() { - $this->assertSame(EnumTest::ENUM_STRING_UPPER, "UPPER"); - $this->assertSame(EnumTest::ENUM_STRING_LOWER, "lower"); - $this->assertSame(EnumTest::ENUM_INTEGER_1, 1); - $this->assertSame(EnumTest::ENUM_INTEGER_MINUS_1, -1); - $this->assertSame(EnumTest::ENUM_NUMBER_1_DOT_1, 1.1); - $this->assertSame(EnumTest::ENUM_NUMBER_MINUS_1_DOT_2, -1.2); + } + + /** + * Test attribute "enum_string" + */ + public function testPropertyEnumString() + { + } + + /** + * Test attribute "enum_integer" + */ + public function testPropertyEnumInteger() + { + } + + /** + * Test attribute "enum_number" + */ + public function testPropertyEnumNumber() + { + } + + /** + * Test attribute "outer_enum" + */ + public function testPropertyOuterEnum() + { } } diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/EnumClassTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/EnumClassTest.php new file mode 100644 index 00000000000..7ba9d0552bb --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/tests/EnumClassTest.php @@ -0,0 +1,15 @@ +assertSame(EnumClass::ABC, '_abc'); + $this->assertSame(EnumClass::EFG, '-efg'); + $this->assertSame(EnumClass::XYZ, '(xyz)'); + } +} diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/EnumTestTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/EnumTestTest.php new file mode 100644 index 00000000000..6db05c5b61d --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/tests/EnumTestTest.php @@ -0,0 +1,18 @@ +assertSame(EnumTest::ENUM_STRING_UPPER, "UPPER"); + $this->assertSame(EnumTest::ENUM_STRING_LOWER, "lower"); + $this->assertSame(EnumTest::ENUM_INTEGER_1, 1); + $this->assertSame(EnumTest::ENUM_INTEGER_MINUS_1, -1); + $this->assertSame(EnumTest::ENUM_NUMBER_1_DOT_1, 1.1); + $this->assertSame(EnumTest::ENUM_NUMBER_MINUS_1_DOT_2, -1.2); + } +} From ee5709177ab32c44e6c80df628113773bcfc7a12 Mon Sep 17 00:00:00 2001 From: Dennis Kieselhorst Date: Sun, 7 Jan 2018 04:43:34 +0100 Subject: [PATCH 12/65] [Java] update CXF to latest release (3.2.1) (#7284) * update CXF to latest release (3.2.1) * update CXF to latest release (3.2.1) - samples update --- .../src/main/resources/JavaJaxRS/cxf/pom.mustache | 6 +++--- .../main/resources/JavaJaxRS/cxf/server/pom.mustache | 12 ++++++------ samples/client/petstore/jaxrs-cxf-client/pom.xml | 6 +++--- samples/client/petstore/jaxrs-cxf/pom.xml | 6 +++--- .../petstore/jaxrs-cxf-annotated-base-path/pom.xml | 6 +++--- .../server/petstore/jaxrs-cxf-non-spring-app/pom.xml | 6 +++--- samples/server/petstore/jaxrs-cxf/pom.xml | 6 +++--- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache index 02c853a7559..d11e9b2cae5 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache @@ -181,7 +181,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.15 + 1.5.17 9.2.9.v20150224 4.12 1.1.7 @@ -189,8 +189,8 @@ {{#useBeanValidation}} 1.1.0.Final {{/useBeanValidation}} - 3.1.11 - 2.8.9 + 3.2.1 + 2.9.1 UTF-8 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache index c7be1d0b172..7062f098392 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache @@ -215,7 +215,7 @@ org.webjars swagger-ui - 3.0.17 + 3.6.1 {{/useSwaggerUI}} @@ -232,7 +232,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.15 + 1.5.17 9.2.9.v20150224 4.12 1.1.7 @@ -241,13 +241,13 @@ 1.1.0.Final {{/useBeanValidation}} {{#generateSpringApplication}} - 4.3.9.RELEASE + 4.3.13.RELEASE {{/generateSpringApplication}} {{#generateSpringBootApplication}} - 1.5.4.RELEASE + 1.5.9.RELEASE {{/generateSpringBootApplication}} - 3.1.11 - 2.8.9 + 3.2.1 + 2.9.1 UTF-8 diff --git a/samples/client/petstore/jaxrs-cxf-client/pom.xml b/samples/client/petstore/jaxrs-cxf-client/pom.xml index e2be3c4f26b..32d4e57e75f 100644 --- a/samples/client/petstore/jaxrs-cxf-client/pom.xml +++ b/samples/client/petstore/jaxrs-cxf-client/pom.xml @@ -185,14 +185,14 @@ 1.7 ${java.version} ${java.version} - 1.5.15 + 1.5.17 9.2.9.v20150224 4.12 1.1.7 2.5 1.1.0.Final - 3.1.11 - 2.8.9 + 3.2.1 + 2.9.1 UTF-8 diff --git a/samples/client/petstore/jaxrs-cxf/pom.xml b/samples/client/petstore/jaxrs-cxf/pom.xml index 5e6f5059b82..7bb81cb09ab 100644 --- a/samples/client/petstore/jaxrs-cxf/pom.xml +++ b/samples/client/petstore/jaxrs-cxf/pom.xml @@ -162,13 +162,13 @@ 1.7 ${java.version} ${java.version} - 1.5.15 + 1.5.17 9.2.9.v20150224 4.12 1.1.7 2.5 - 3.1.11 - 2.8.9 + 3.2.1 + 2.9.1 UTF-8 diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml index 0136d8f0a76..b0adbaedc42 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml @@ -185,14 +185,14 @@ 1.7 ${java.version} ${java.version} - 1.5.15 + 1.5.17 9.2.9.v20150224 4.12 1.1.7 2.5 1.1.0.Final - 3.1.11 - 2.8.9 + 3.2.1 + 2.9.1 UTF-8 diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml index 1c116b94ad1..e712fc141ca 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml @@ -185,14 +185,14 @@ 1.7 ${java.version} ${java.version} - 1.5.15 + 1.5.17 9.2.9.v20150224 4.12 1.1.7 2.5 1.1.0.Final - 3.1.11 - 2.8.9 + 3.2.1 + 2.9.1 UTF-8 diff --git a/samples/server/petstore/jaxrs-cxf/pom.xml b/samples/server/petstore/jaxrs-cxf/pom.xml index 1ab75579100..d88b88a3e3b 100644 --- a/samples/server/petstore/jaxrs-cxf/pom.xml +++ b/samples/server/petstore/jaxrs-cxf/pom.xml @@ -185,14 +185,14 @@ 1.7 ${java.version} ${java.version} - 1.5.15 + 1.5.17 9.2.9.v20150224 4.12 1.1.7 2.5 1.1.0.Final - 3.1.11 - 2.8.9 + 3.2.1 + 2.9.1 UTF-8 From 4e5ec4c71caada948394a0bbbf4b6caf64b3556a Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Sun, 7 Jan 2018 12:46:31 +0900 Subject: [PATCH 13/65] [PHP] Cleanup StoreApiTest (#7248) * Move test codes in "test" to "tests". * Simplify class name specification * Regenerate test/Api/StoreApiTest.php testGetInventory already exists in tests/StoreApiTest.php --- .../test/Api/StoreApiTest.php | 75 +++++-------------- .../SwaggerClient-php/tests/StoreApiTest.php | 34 ++++++++- 2 files changed, 51 insertions(+), 58 deletions(-) diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Api/StoreApiTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Api/StoreApiTest.php index e091e0ca30d..3fc064a99c2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Api/StoreApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Api/StoreApiTest.php @@ -5,8 +5,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,18 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Swagger Codegen version: 2.3.0-SNAPSHOT */ /** @@ -38,10 +26,9 @@ * Please update the test case below to test the endpoint. */ -namespace Swagger\Client\Api; +namespace Swagger\Client; use \Swagger\Client\Configuration; -use \Swagger\Client\ApiClient; use \Swagger\Client\ApiException; use \Swagger\Client\ObjectSerializer; @@ -50,53 +37,38 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class StoreApiTest extends \PHPUnit_Framework_TestCase { /** - * Setup before running each test case + * Setup before running any test cases */ public static function setUpBeforeClass() { - // add a new pet (id 10005) to ensure the pet object is available for all the tests - - // for error reporting (need to run with php5.3 to get no warning) - //ini_set('display_errors', 1); - //error_reporting(~0); - - // new pet - $new_pet_id = 10005; - $new_pet = new \Swagger\Client\Model\Pet; - $new_pet->setId($new_pet_id); - $new_pet->setName("PHP Unit Test"); - $new_pet->setStatus("available"); - // new tag - $tag= new \Swagger\Client\Model\Tag; - $tag->setId($new_pet_id); // use the same id as pet - $tag->setName("test php tag"); - // new category - $category = new \Swagger\Client\Model\Category; - $category->setId($new_pet_id); // use the same id as pet - $category->setName("test php category"); - - $new_pet->setTags(array($tag)); - $new_pet->setCategory($category); + } - $pet_api = new PetApi(); - // add a new pet (model) - $add_response = $pet_api->addPet($new_pet); + /** + * Setup before running each test case + */ + public function setUp() + { } /** * Clean up after running each test case */ - public static function tearDownAfterClass() + public function tearDown() { + } + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass() + { } /** @@ -107,7 +79,6 @@ public static function tearDownAfterClass() */ public function testDeleteOrder() { - } /** @@ -118,13 +89,6 @@ public function testDeleteOrder() */ public function testGetInventory() { - // initialize the API client - $store_api = new StoreApi(); - // get inventory - $get_response = $store_api->getInventory(); - - $this->assertInternalType("array", $get_response); - $this->assertInternalType("int", $get_response['available']); } /** @@ -135,7 +99,6 @@ public function testGetInventory() */ public function testGetOrderById() { - } /** @@ -146,7 +109,5 @@ public function testGetOrderById() */ public function testPlaceOrder() { - } - } diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/StoreApiTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/StoreApiTest.php index 4be179c2bc7..3af84b8d851 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/StoreApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/StoreApiTest.php @@ -2,7 +2,11 @@ namespace Swagger\Client; +use Swagger\Client\Api\PetApi; use Swagger\Client\Api\StoreApi; +use Swagger\Client\Model\Category; +use Swagger\Client\Model\Pet; +use Swagger\Client\Model\Tag; class StoreApiTest extends \PHPUnit_Framework_TestCase { @@ -11,7 +15,35 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase public function setUp() { - $this->api = new Api\StoreApi(); + $this->api = new StoreApi(); + } + + /** + * Setup before running each test case + */ + public static function setUpBeforeClass() + { + // add a new pet (id 10005) to ensure the pet object is available for all the tests + // new pet + $id = 10005; + $pet = new Pet(); + $pet->setId($id); + $pet->setName('PHP Unit Test'); + $pet->setStatus('available'); + // new tag + $tag = new Tag(); + $tag->setId($id); // use the same id as pet + $tag->setName('test php tag'); + // new category + $category = new Category(); + $category->setId($id); // use the same id as pet + $category->setName('test php category'); + + $pet->setTags([$tag]); + $pet->setCategory($category); + + $api = new PetApi(); + $api->addPet($pet); } public function testGetInventory() From 6afc0e93441422a6310d22159306b030524c4e46 Mon Sep 17 00:00:00 2001 From: etherealjoy <33183834+etherealjoy@users.noreply.github.com> Date: Sun, 7 Jan 2018 04:50:22 +0100 Subject: [PATCH 14/65] Fix for #7198, use QJsonObject instead of QJsonArray for maps (#7204) [C++][Qt5] use QJsonObject instead of QJsonArray for maps --- .../main/resources/qt5cpp/model-body.mustache | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache index 896c53a75ed..307494dda7d 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache @@ -120,13 +120,11 @@ QJsonObject* obj->insert("{{baseName}}", {{name}}JsonArray); {{/isListContainer}} {{#isMapContainer}} - QJsonArray {{name}}JsonArray; + QJsonObject {{name}}_jobj; for(auto keyval : {{name}}->keys()){ - QJsonObject {{name}}_jobj; - toJsonValue(keyval, ((*{{name}})[keyval]), &{{name}}_jobj, "{{complexType}}"); - {{name}}JsonArray.append({{name}}_jobj); - } - obj->insert("{{baseName}}", {{name}}JsonArray); + toJsonValue(keyval, ((*{{name}})[keyval]), &{{name}}_jobj, "{{complexType}}"); + } + obj->insert("{{baseName}}", {{name}}_jobj); {{/isMapContainer}} {{/complexType}} {{^complexType}} @@ -139,13 +137,11 @@ QJsonObject* obj->insert("{{baseName}}", {{name}}JsonArray); {{/isListContainer}} {{#isMapContainer}} - QJsonArray {{name}}JsonArray; + QJsonObject {{name}}_jobj; for(auto keyval : {{name}}->keys()){ - QJsonObject {{name}}_jobj; - toJsonValue(keyval, ((*{{name}})[keyval]), &{{name}}_jobj, "{{items.baseType}}"); - {{name}}JsonArray.append(portsobj); - } - obj->insert("{{baseName}}", {{name}}JsonArray); + toJsonValue(keyval, ((*{{name}})[keyval]), &{{name}}_jobj, "{{items.baseType}}"); + } + obj->insert("{{baseName}}", {{name}}_jobj); {{/isMapContainer}} {{/complexType}} {{/vars}} From 919f867ebac1fb934423641ac783f28a24d03cd5 Mon Sep 17 00:00:00 2001 From: Oleksandr Slynko Date: Sun, 7 Jan 2018 03:53:55 +0000 Subject: [PATCH 15/65] [go] Fix go client formatting (#7283) * Fix some go client formatting issues * Fix go client go imports * Run `goimports -w .` on examples directory * Sort imports in api * Add new line between each property Before secret feature was used to add new line using two property declaration in the same line. There should be no new line before first property. The easiest way is to use `-first` special property https://github.com/samskivert/jmustache#-first-and--last New line are required so `goimports` won't reformat whitespaces between property name and type. * Change whitespaces to tabs * Fix whitespaces in api_client There is a new line between each service to prevent `goimports` from adding whitespaces between types and names * Fix more whitespaces There was a need to set special delimeter for formatting in the commit. Go slices use curly braces and `jmustache` got confused when found triple curly braces. * Fix whitespaces in configuration.mustache * Fix whitespaces for api response * Support for optional description Do not add whitespace if description is missing * Add new lines between enum values to prevent formatting * Generate go code from current code - imports are not sorted :( - there are extra whitespaces for different languages. I don't know why * Run generate for security tests --- .../src/main/resources/go/api.mustache | 41 ++- .../src/main/resources/go/api_client.mustache | 53 ++-- .../main/resources/go/api_response.mustache | 8 +- .../main/resources/go/configuration.mustache | 32 +-- .../src/main/resources/go/model.mustache | 12 +- .../petstore-security-test/go/README.md | 2 +- .../petstore-security-test/go/api_client.go | 57 ++-- .../petstore-security-test/go/api_response.go | 8 +- .../go/configuration.go | 32 +-- .../petstore-security-test/go/fake_api.go | 31 +- .../petstore-security-test/go/model_return.go | 1 - .../additional_properties_class.go | 1 - .../client/petstore/go/go-petstore/animal.go | 1 - .../go/go-petstore/another_fake_api.go | 28 +- .../petstore/go/go-petstore/api_client.go | 70 ++--- .../petstore/go/go-petstore/api_response.go | 8 +- .../array_of_array_of_number_only.go | 1 - .../go/go-petstore/array_of_number_only.go | 1 - .../petstore/go/go-petstore/array_test.go | 1 - .../petstore/go/go-petstore/capitalization.go | 1 - samples/client/petstore/go/go-petstore/cat.go | 1 - .../petstore/go/go-petstore/category.go | 1 - .../petstore/go/go-petstore/class_model.go | 1 - .../client/petstore/go/go-petstore/client.go | 1 - .../petstore/go/go-petstore/configuration.go | 32 +-- samples/client/petstore/go/go-petstore/dog.go | 1 - .../petstore/go/go-petstore/enum_arrays.go | 1 - .../petstore/go/go-petstore/enum_class.go | 2 + .../petstore/go/go-petstore/enum_test.go | 1 - .../petstore/go/go-petstore/fake_api.go | 269 ++++++++---------- .../go-petstore/fake_classname_tags123_api.go | 26 +- .../petstore/go/go-petstore/format_test.go | 1 - .../go/go-petstore/has_only_read_only.go | 1 - .../client/petstore/go/go-petstore/list.go | 1 - .../petstore/go/go-petstore/map_test.go | 1 - ...perties_and_additional_properties_class.go | 1 - .../go/go-petstore/model_200_response.go | 1 - .../go/go-petstore/model_api_response.go | 1 - .../petstore/go/go-petstore/model_return.go | 1 - .../client/petstore/go/go-petstore/name.go | 1 - .../petstore/go/go-petstore/number_only.go | 1 - .../client/petstore/go/go-petstore/order.go | 1 - .../go/go-petstore/outer_composite.go | 1 - .../petstore/go/go-petstore/outer_enum.go | 2 + samples/client/petstore/go/go-petstore/pet.go | 1 - .../client/petstore/go/go-petstore/pet_api.go | 211 ++++++-------- .../go/go-petstore/read_only_first.go | 1 - .../go/go-petstore/special_model_name.go | 1 - .../petstore/go/go-petstore/store_api.go | 99 +++---- samples/client/petstore/go/go-petstore/tag.go | 1 - .../client/petstore/go/go-petstore/user.go | 1 - .../petstore/go/go-petstore/user_api.go | 194 +++++-------- 52 files changed, 534 insertions(+), 714 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/go/api.mustache b/modules/swagger-codegen/src/main/resources/go/api.mustache index cf81557adf6..5692c3f3d99 100644 --- a/modules/swagger-codegen/src/main/resources/go/api.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api.mustache @@ -4,8 +4,8 @@ package {{packageName}} {{#operations}} import ( "io/ioutil" - "net/url" "net/http" + "net/url" "strings" "golang.org/x/net/context" {{#imports}} "{{import}}" @@ -18,24 +18,23 @@ var ( ) type {{classname}}Service service - {{#operation}} -/* {{{classname}}}Service {{summary}}{{#notes}} - {{notes}}{{/notes}} +/* {{{classname}}}Service{{#summary}} {{.}}{{/summary}}{{#notes}} +{{notes}}{{/notes}} * @param ctx context.Context for authentication, logging, tracing, etc. -{{#allParams}}{{#required}} @param {{paramName}} {{description}} -{{/required}}{{/allParams}}{{#hasOptionalParams}} @param optional (nil or map[string]interface{}) with one or more of: -{{#allParams}}{{^required}} @param "{{paramName}}" ({{dataType}}) {{description}} -{{/required}}{{/allParams}}{{/hasOptionalParams}} @return {{#returnType}}{{{returnType}}}{{/returnType}}*/ -func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals map[string]interface{}{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}} *http.Response, error) { +{{#allParams}}{{#required}}@param {{paramName}}{{#description}} {{.}}{{/description}} +{{/required}}{{/allParams}}{{#hasOptionalParams}}@param optional (nil or map[string]interface{}) with one or more of: +{{#allParams}}{{^required}} @param "{{paramName}}" ({{dataType}}){{#description}} {{.}}{{/description}} +{{/required}}{{/allParams}}{{/hasOptionalParams}}@return {{#returnType}}{{{returnType}}}{{/returnType}}*/ +func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals map[string]interface{}{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("{{httpMethod}}") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte {{#returnType}} - successPayload {{returnType}} + successPayload {{returnType}} {{/returnType}} ) @@ -46,7 +45,6 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - {{#allParams}} {{^required}} {{#isPrimitiveType}} @@ -114,7 +112,9 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} {{/queryParams}} {{/hasQueryParams}} // to determine the Content-Type header - localVarHttpContentTypes := []string{ {{#consumes}}"{{{mediaType}}}", {{/consumes}} } +{{=<% %>=}} + localVarHttpContentTypes := []string{<%#consumes%>"<%&mediaType%>"<%^-last%>, <%/-last%><%/consumes%>} +<%={{ }}=%> // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -123,11 +123,9 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - {{#produces}} - "{{{mediaType}}}", - {{/produces}} - } +{{=<% %>=}} + localVarHttpHeaderAccepts := []string{<%#produces%>"<%&mediaType%>"<%^-last%>, <%/-last%><%/produces%>} +<%={{ }}=%> // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -223,7 +221,6 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} } {{/returnType}} - return {{#returnType}}successPayload, {{/returnType}}localVarHttpResponse, err } -{{/operation}}{{/operations}} +{{/operation}}{{/operations}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/go/api_client.mustache b/modules/swagger-codegen/src/main/resources/go/api_client.mustache index c8d6afa8e99..38c7a7e2720 100644 --- a/modules/swagger-codegen/src/main/resources/go/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api_client.mustache @@ -5,40 +5,42 @@ import ( "bytes" "encoding/json" "encoding/xml" - "fmt" "errors" + "fmt" "io" "mime/multipart" - "golang.org/x/oauth2" - "golang.org/x/net/context" "net/http" "net/url" - "time" "os" "path/filepath" "reflect" "regexp" + "strconv" "strings" + "time" "unicode/utf8" - "strconv" + + "golang.org/x/net/context" + "golang.org/x/oauth2" ) var ( jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") - xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") + xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") ) // APIClient manages communication with the {{appName}} API v{{version}} // In most cases there should be only one, shared, APIClient. type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. - // API Services + // API Services {{#apiInfo}} {{#apis}} {{#operations}} - {{classname}} *{{classname}}Service + + {{classname}} *{{classname}}Service {{/operations}} {{/apis}} {{/apiInfo}} @@ -75,7 +77,6 @@ func atoi(in string) (int, error) { return strconv.Atoi(in) } - // selectHeaderContentType select a content type from the available list. func selectHeaderContentType(contentTypes []string) string { if len(contentTypes) == 0 { @@ -146,18 +147,18 @@ func parameterToString(obj interface{}, collectionFormat string) string { return fmt.Sprintf("%v", obj) } -// callAPI do the request. +// callAPI do the request. func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - return c.cfg.HTTPClient.Do(request) + return c.cfg.HTTPClient.Do(request) } // Change base path to allow switching to mocks -func (c *APIClient) ChangeBasePath (path string) { +func (c *APIClient) ChangeBasePath(path string) { c.cfg.BasePath = path } // prepareRequest build the request -func (c *APIClient) prepareRequest ( +func (c *APIClient) prepareRequest( ctx context.Context, path string, method string, postBody interface{}, @@ -217,7 +218,7 @@ func (c *APIClient) prepareRequest ( // Set the Boundary in the Content-Type headerParams["Content-Type"] = w.FormDataContentType() } - + // Set Content-Length headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) w.Close() @@ -263,10 +264,9 @@ func (c *APIClient) prepareRequest ( if c.cfg.Host != "" { localVarRequest.Host = c.cfg.Host } - + // Add the user agent to the request. localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - if ctx != nil { // add context to the request @@ -292,18 +292,17 @@ func (c *APIClient) prepareRequest ( // AccessToken Authentication if auth, ok := ctx.Value(ContextAccessToken).(string); ok { - localVarRequest.Header.Add("Authorization", "Bearer " + auth) + localVarRequest.Header.Add("Authorization", "Bearer "+auth) } } for header, value := range c.cfg.DefaultHeader { localVarRequest.Header.Add(header, value) } - + return localVarRequest, nil } - // Add a file to the multipart request func addFile(w *multipart.Writer, fieldName, path string) error { file, err := os.Open(path) @@ -322,7 +321,7 @@ func addFile(w *multipart.Writer, fieldName, path string) error { } // Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) (error) { +func reportError(format string, a ...interface{}) error { return fmt.Errorf(format, a...) } @@ -359,7 +358,7 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e func detectContentType(body interface{}) string { contentType := "text/plain; charset=utf-8" kind := reflect.TypeOf(body).Kind() - + switch kind { case reflect.Struct, reflect.Map, reflect.Ptr: contentType = "application/json; charset=utf-8" @@ -376,7 +375,6 @@ func detectContentType(body interface{}) string { return contentType } - // Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go type cacheControl map[string]string @@ -399,7 +397,7 @@ func parseCacheControl(headers http.Header) cacheControl { } // CacheExpires helper function to determine remaining time before repeating a request. -func CacheExpires(r *http.Response) (time.Time) { +func CacheExpires(r *http.Response) time.Time { // Figure out when the cache expires. var expires time.Time now, err := time.Parse(time.RFC1123, r.Header.Get("date")) @@ -407,7 +405,7 @@ func CacheExpires(r *http.Response) (time.Time) { return time.Now() } respCacheControl := parseCacheControl(r.Header) - + if maxAge, ok := respCacheControl["max-age"]; ok { lifetime, err := time.ParseDuration(maxAge + "s") if err != nil { @@ -426,7 +424,6 @@ func CacheExpires(r *http.Response) (time.Time) { return expires } -func strlen(s string) (int) { +func strlen(s string) int { return utf8.RuneCountInString(s) } - diff --git a/modules/swagger-codegen/src/main/resources/go/api_response.mustache b/modules/swagger-codegen/src/main/resources/go/api_response.mustache index 00ab14a5124..a2617ea0680 100644 --- a/modules/swagger-codegen/src/main/resources/go/api_response.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api_response.mustache @@ -7,15 +7,15 @@ import ( type APIResponse struct { *http.Response `json:"-"` - Message string `json:"message,omitempty"` + Message string `json:"message,omitempty"` // Operation is the name of the swagger operation. - Operation string `json:"operation,omitempty"` + Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. - RequestURL string `json:"url,omitempty"` + RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. - Method string `json:"method,omitempty"` + Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. diff --git a/modules/swagger-codegen/src/main/resources/go/configuration.mustache b/modules/swagger-codegen/src/main/resources/go/configuration.mustache index 3a13d41ffdd..1b583e54270 100644 --- a/modules/swagger-codegen/src/main/resources/go/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/go/configuration.mustache @@ -17,37 +17,37 @@ func (c contextKey) String() string { var ( // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. - ContextOAuth2 = contextKey("token") + ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. - ContextBasicAuth = contextKey("basic") + ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. - ContextAccessToken = contextKey("accesstoken") + ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request - ContextAPIKey = contextKey("apikey") + ContextAPIKey = contextKey("apikey") ) -// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth type BasicAuth struct { - UserName string `json:"userName,omitempty"` - Password string `json:"password,omitempty"` + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` } // APIKey provides API key based authentication to a request passed via context using ContextAPIKey type APIKey struct { - Key string - Prefix string + Key string + Prefix string } type Configuration struct { - BasePath string `json:"basePath,omitempty"` - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - HTTPClient *http.Client + BasePath string `json:"basePath,omitempty"` + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + HTTPClient *http.Client } func NewConfiguration() *Configuration { @@ -61,4 +61,4 @@ func NewConfiguration() *Configuration { func (c *Configuration) AddDefaultHeader(key string, value string) { c.DefaultHeader[key] = value -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/main/resources/go/model.mustache b/modules/swagger-codegen/src/main/resources/go/model.mustache index 7c9e5c88aab..e69220ae550 100644 --- a/modules/swagger-codegen/src/main/resources/go/model.mustache +++ b/modules/swagger-codegen/src/main/resources/go/model.mustache @@ -11,14 +11,22 @@ type {{{name}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/form const ( {{#allowableValues}} {{#enumVars}} + {{^-first}} + + {{/-first}} {{name}} {{{classname}}} = "{{{value}}}" {{/enumVars}} {{/allowableValues}} ){{/isEnum}}{{^isEnum}}{{#description}} // {{{description}}}{{/description}} type {{classname}} struct { -{{#vars}}{{#description}} - // {{{description}}}{{/description}} +{{#vars}} +{{^-first}} + +{{/-first}} +{{#description}} + // {{{description}}} +{{/description}} {{name}} {{^isEnum}}{{^isPrimitiveType}}{{^isContainer}}{{^isDateTime}}*{{/isDateTime}}{{/isContainer}}{{/isPrimitiveType}}{{/isEnum}}{{{datatype}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"` {{/vars}} }{{/isEnum}}{{/model}}{{/models}} diff --git a/samples/client/petstore-security-test/go/README.md b/samples/client/petstore-security-test/go/README.md index fa4b2d48d8c..d092ab5477f 100644 --- a/samples/client/petstore-security-test/go/README.md +++ b/samples/client/petstore-security-test/go/README.md @@ -56,7 +56,7 @@ Example r, err := client.Service.Operation(auth, args) ``` -Or via OAuth2 module to automaticly refresh tokens and perform user authentication. +Or via OAuth2 module to automatically refresh tokens and perform user authentication. ``` import "golang.org/x/oauth2" diff --git a/samples/client/petstore-security-test/go/api_client.go b/samples/client/petstore-security-test/go/api_client.go index 4d8da312591..7bff3262432 100644 --- a/samples/client/petstore-security-test/go/api_client.go +++ b/samples/client/petstore-security-test/go/api_client.go @@ -14,37 +14,39 @@ import ( "bytes" "encoding/json" "encoding/xml" - "fmt" "errors" + "fmt" "io" "mime/multipart" - "golang.org/x/oauth2" - "golang.org/x/net/context" "net/http" "net/url" - "time" "os" "path/filepath" "reflect" "regexp" + "strconv" "strings" + "time" "unicode/utf8" - "strconv" + + "golang.org/x/net/context" + "golang.org/x/oauth2" ) var ( jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") - xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") + xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") ) // APIClient manages communication with the Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r API v1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r // In most cases there should be only one, shared, APIClient. type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services - // API Services - FakeApi *FakeApiService + FakeApi *FakeApiService } type service struct { @@ -72,7 +74,6 @@ func atoi(in string) (int, error) { return strconv.Atoi(in) } - // selectHeaderContentType select a content type from the available list. func selectHeaderContentType(contentTypes []string) string { if len(contentTypes) == 0 { @@ -143,18 +144,18 @@ func parameterToString(obj interface{}, collectionFormat string) string { return fmt.Sprintf("%v", obj) } -// callAPI do the request. +// callAPI do the request. func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - return c.cfg.HTTPClient.Do(request) + return c.cfg.HTTPClient.Do(request) } // Change base path to allow switching to mocks -func (c *APIClient) ChangeBasePath (path string) { +func (c *APIClient) ChangeBasePath(path string) { c.cfg.BasePath = path } // prepareRequest build the request -func (c *APIClient) prepareRequest ( +func (c *APIClient) prepareRequest( ctx context.Context, path string, method string, postBody interface{}, @@ -180,7 +181,7 @@ func (c *APIClient) prepareRequest ( } } - // add form paramters and file if available. + // add form parameters and file if available. if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") @@ -214,13 +215,13 @@ func (c *APIClient) prepareRequest ( // Set the Boundary in the Content-Type headerParams["Content-Type"] = w.FormDataContentType() } - + // Set Content-Length headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) w.Close() } - // Setup path and query paramters + // Setup path and query parameters url, err := url.Parse(path) if err != nil { return nil, err @@ -260,10 +261,9 @@ func (c *APIClient) prepareRequest ( if c.cfg.Host != "" { localVarRequest.Host = c.cfg.Host } - + // Add the user agent to the request. localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - if ctx != nil { // add context to the request @@ -289,18 +289,17 @@ func (c *APIClient) prepareRequest ( // AccessToken Authentication if auth, ok := ctx.Value(ContextAccessToken).(string); ok { - localVarRequest.Header.Add("Authorization", "Bearer " + auth) + localVarRequest.Header.Add("Authorization", "Bearer "+auth) } } for header, value := range c.cfg.DefaultHeader { localVarRequest.Header.Add(header, value) } - + return localVarRequest, nil } - // Add a file to the multipart request func addFile(w *multipart.Writer, fieldName, path string) error { file, err := os.Open(path) @@ -319,7 +318,7 @@ func addFile(w *multipart.Writer, fieldName, path string) error { } // Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) (error) { +func reportError(format string, a ...interface{}) error { return fmt.Errorf(format, a...) } @@ -356,7 +355,7 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e func detectContentType(body interface{}) string { contentType := "text/plain; charset=utf-8" kind := reflect.TypeOf(body).Kind() - + switch kind { case reflect.Struct, reflect.Map, reflect.Ptr: contentType = "application/json; charset=utf-8" @@ -373,7 +372,6 @@ func detectContentType(body interface{}) string { return contentType } - // Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go type cacheControl map[string]string @@ -396,7 +394,7 @@ func parseCacheControl(headers http.Header) cacheControl { } // CacheExpires helper function to determine remaining time before repeating a request. -func CacheExpires(r *http.Response) (time.Time) { +func CacheExpires(r *http.Response) time.Time { // Figure out when the cache expires. var expires time.Time now, err := time.Parse(time.RFC1123, r.Header.Get("date")) @@ -404,7 +402,7 @@ func CacheExpires(r *http.Response) (time.Time) { return time.Now() } respCacheControl := parseCacheControl(r.Header) - + if maxAge, ok := respCacheControl["max-age"]; ok { lifetime, err := time.ParseDuration(maxAge + "s") if err != nil { @@ -423,7 +421,6 @@ func CacheExpires(r *http.Response) (time.Time) { return expires } -func strlen(s string) (int) { +func strlen(s string) int { return utf8.RuneCountInString(s) } - diff --git a/samples/client/petstore-security-test/go/api_response.go b/samples/client/petstore-security-test/go/api_response.go index 8b8f3b928ed..05fd1dc4e90 100644 --- a/samples/client/petstore-security-test/go/api_response.go +++ b/samples/client/petstore-security-test/go/api_response.go @@ -16,15 +16,15 @@ import ( type APIResponse struct { *http.Response `json:"-"` - Message string `json:"message,omitempty"` + Message string `json:"message,omitempty"` // Operation is the name of the swagger operation. - Operation string `json:"operation,omitempty"` + Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. - RequestURL string `json:"url,omitempty"` + RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. - Method string `json:"method,omitempty"` + Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. diff --git a/samples/client/petstore-security-test/go/configuration.go b/samples/client/petstore-security-test/go/configuration.go index 8dfd09bc59c..b63460d45f0 100644 --- a/samples/client/petstore-security-test/go/configuration.go +++ b/samples/client/petstore-security-test/go/configuration.go @@ -26,37 +26,37 @@ func (c contextKey) String() string { var ( // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. - ContextOAuth2 = contextKey("token") + ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. - ContextBasicAuth = contextKey("basic") + ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. - ContextAccessToken = contextKey("accesstoken") + ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request - ContextAPIKey = contextKey("apikey") + ContextAPIKey = contextKey("apikey") ) -// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth type BasicAuth struct { - UserName string `json:"userName,omitempty"` - Password string `json:"password,omitempty"` + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` } // APIKey provides API key based authentication to a request passed via context using ContextAPIKey type APIKey struct { - Key string - Prefix string + Key string + Prefix string } type Configuration struct { - BasePath string `json:"basePath,omitempty"` - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - HTTPClient *http.Client + BasePath string `json:"basePath,omitempty"` + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + HTTPClient *http.Client } func NewConfiguration() *Configuration { @@ -70,4 +70,4 @@ func NewConfiguration() *Configuration { func (c *Configuration) AddDefaultHeader(key string, value string) { c.DefaultHeader[key] = value -} \ No newline at end of file +} diff --git a/samples/client/petstore-security-test/go/fake_api.go b/samples/client/petstore-security-test/go/fake_api.go index 99f7638fe7d..13d021b9f54 100644 --- a/samples/client/petstore-security-test/go/fake_api.go +++ b/samples/client/petstore-security-test/go/fake_api.go @@ -11,8 +11,9 @@ package swagger import ( - "net/url" + "io/ioutil" "net/http" + "net/url" "strings" "golang.org/x/net/context" ) @@ -24,18 +25,17 @@ var ( type FakeApiService service - /* FakeApiService To test code injection *_/ ' \" =end -- \\r\\n \\n \\r * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "testCodeInjectEndRnNR" (string) To test code injection *_/ ' \" =end -- \\r\\n \\n \\r - @return */ -func (a *FakeApiService) TestCodeInjectEndRnNR(ctx context.Context, localVarOptionals map[string]interface{}) ( *http.Response, error) { +@param optional (nil or map[string]interface{}) with one or more of: + @param "testCodeInjectEndRnNR" (string) To test code injection *_/ ' \" =end -- \\r\\n \\n \\r +@return */ +func (a *FakeApiService) TestCodeInjectEndRnNR(ctx context.Context, localVarOptionals map[string]interface{}) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -44,13 +44,12 @@ func (a *FakeApiService) TestCodeInjectEndRnNR(ctx context.Context, localVarOpti localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if err := typeCheckParameter(localVarOptionals["testCodeInjectEndRnNR"], "string", "testCodeInjectEndRnNR"); err != nil { return nil, err } // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", "*_/ ' =end -- ", } + localVarHttpContentTypes := []string{"application/json", "*_/ ' =end -- "} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -59,10 +58,7 @@ func (a *FakeApiService) TestCodeInjectEndRnNR(ctx context.Context, localVarOpti } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - "*_/ ' =end -- ", - } + localVarHttpHeaderAccepts := []string{"application/json", "*_/ ' =end -- "} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -83,9 +79,8 @@ func (a *FakeApiService) TestCodeInjectEndRnNR(ctx context.Context, localVarOpti } defer localVarHttpResponse.Body.Close() if localVarHttpResponse.StatusCode >= 300 { - return localVarHttpResponse, reportError(localVarHttpResponse.Status) + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } - return localVarHttpResponse, err } - diff --git a/samples/client/petstore-security-test/go/model_return.go b/samples/client/petstore-security-test/go/model_return.go index d1a82197416..3616e2759aa 100644 --- a/samples/client/petstore-security-test/go/model_return.go +++ b/samples/client/petstore-security-test/go/model_return.go @@ -12,7 +12,6 @@ package swagger // Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r type ModelReturn struct { - // property description *_/ ' \" =end -- \\r\\n \\n \\r Return_ int32 `json:"return,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/additional_properties_class.go b/samples/client/petstore/go/go-petstore/additional_properties_class.go index ff018d60e14..47449ea592d 100644 --- a/samples/client/petstore/go/go-petstore/additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore/additional_properties_class.go @@ -11,7 +11,6 @@ package petstore type AdditionalPropertiesClass struct { - MapProperty map[string]string `json:"map_property,omitempty"` MapOfMapProperty map[string]map[string]string `json:"map_of_map_property,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/animal.go b/samples/client/petstore/go/go-petstore/animal.go index 4ae6c33a58a..318e9fddaef 100644 --- a/samples/client/petstore/go/go-petstore/animal.go +++ b/samples/client/petstore/go/go-petstore/animal.go @@ -11,7 +11,6 @@ package petstore type Animal struct { - ClassName string `json:"className"` Color string `json:"color,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/another_fake_api.go b/samples/client/petstore/go/go-petstore/another_fake_api.go index 503ca40cbba..8e1c565507b 100644 --- a/samples/client/petstore/go/go-petstore/another_fake_api.go +++ b/samples/client/petstore/go/go-petstore/another_fake_api.go @@ -12,8 +12,8 @@ package petstore import ( "io/ioutil" - "net/url" "net/http" + "net/url" "strings" "golang.org/x/net/context" "encoding/json" @@ -26,19 +26,18 @@ var ( type AnotherFakeApiService service - /* AnotherFakeApiService To test special tags - To test special tags +To test special tags * @param ctx context.Context for authentication, logging, tracing, etc. - @param body client model - @return Client*/ -func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, body Client) (Client, *http.Response, error) { +@param body client model +@return Client*/ +func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, body Client) (Client, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Client + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Client ) // create path and map variables @@ -48,9 +47,8 @@ func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, body Client localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -59,9 +57,7 @@ func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, body Client } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -89,7 +85,5 @@ func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, body Client return successPayload, localVarHttpResponse, err } - return successPayload, localVarHttpResponse, err } - diff --git a/samples/client/petstore/go/go-petstore/api_client.go b/samples/client/petstore/go/go-petstore/api_client.go index 3c0ed8e3d52..d2f8f3092c3 100644 --- a/samples/client/petstore/go/go-petstore/api_client.go +++ b/samples/client/petstore/go/go-petstore/api_client.go @@ -14,42 +14,49 @@ import ( "bytes" "encoding/json" "encoding/xml" - "fmt" "errors" + "fmt" "io" "mime/multipart" - "golang.org/x/oauth2" - "golang.org/x/net/context" "net/http" "net/url" - "time" "os" "path/filepath" "reflect" "regexp" + "strconv" "strings" + "time" "unicode/utf8" - "strconv" + + "golang.org/x/net/context" + "golang.org/x/oauth2" ) var ( jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") - xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") + xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") ) // APIClient manages communication with the Swagger Petstore API v1.0.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - AnotherFakeApi *AnotherFakeApiService - FakeApi *FakeApiService - FakeClassnameTags123Api *FakeClassnameTags123ApiService - PetApi *PetApiService - StoreApi *StoreApiService - UserApi *UserApiService + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + AnotherFakeApi *AnotherFakeApiService + + FakeApi *FakeApiService + + FakeClassnameTags123Api *FakeClassnameTags123ApiService + + PetApi *PetApiService + + StoreApi *StoreApiService + + UserApi *UserApiService } type service struct { @@ -82,7 +89,6 @@ func atoi(in string) (int, error) { return strconv.Atoi(in) } - // selectHeaderContentType select a content type from the available list. func selectHeaderContentType(contentTypes []string) string { if len(contentTypes) == 0 { @@ -153,18 +159,18 @@ func parameterToString(obj interface{}, collectionFormat string) string { return fmt.Sprintf("%v", obj) } -// callAPI do the request. +// callAPI do the request. func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - return c.cfg.HTTPClient.Do(request) + return c.cfg.HTTPClient.Do(request) } // Change base path to allow switching to mocks -func (c *APIClient) ChangeBasePath (path string) { +func (c *APIClient) ChangeBasePath(path string) { c.cfg.BasePath = path } // prepareRequest build the request -func (c *APIClient) prepareRequest ( +func (c *APIClient) prepareRequest( ctx context.Context, path string, method string, postBody interface{}, @@ -224,7 +230,7 @@ func (c *APIClient) prepareRequest ( // Set the Boundary in the Content-Type headerParams["Content-Type"] = w.FormDataContentType() } - + // Set Content-Length headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) w.Close() @@ -270,10 +276,9 @@ func (c *APIClient) prepareRequest ( if c.cfg.Host != "" { localVarRequest.Host = c.cfg.Host } - + // Add the user agent to the request. localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - if ctx != nil { // add context to the request @@ -299,18 +304,17 @@ func (c *APIClient) prepareRequest ( // AccessToken Authentication if auth, ok := ctx.Value(ContextAccessToken).(string); ok { - localVarRequest.Header.Add("Authorization", "Bearer " + auth) + localVarRequest.Header.Add("Authorization", "Bearer "+auth) } } for header, value := range c.cfg.DefaultHeader { localVarRequest.Header.Add(header, value) } - + return localVarRequest, nil } - // Add a file to the multipart request func addFile(w *multipart.Writer, fieldName, path string) error { file, err := os.Open(path) @@ -329,7 +333,7 @@ func addFile(w *multipart.Writer, fieldName, path string) error { } // Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) (error) { +func reportError(format string, a ...interface{}) error { return fmt.Errorf(format, a...) } @@ -366,7 +370,7 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e func detectContentType(body interface{}) string { contentType := "text/plain; charset=utf-8" kind := reflect.TypeOf(body).Kind() - + switch kind { case reflect.Struct, reflect.Map, reflect.Ptr: contentType = "application/json; charset=utf-8" @@ -383,7 +387,6 @@ func detectContentType(body interface{}) string { return contentType } - // Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go type cacheControl map[string]string @@ -406,7 +409,7 @@ func parseCacheControl(headers http.Header) cacheControl { } // CacheExpires helper function to determine remaining time before repeating a request. -func CacheExpires(r *http.Response) (time.Time) { +func CacheExpires(r *http.Response) time.Time { // Figure out when the cache expires. var expires time.Time now, err := time.Parse(time.RFC1123, r.Header.Get("date")) @@ -414,7 +417,7 @@ func CacheExpires(r *http.Response) (time.Time) { return time.Now() } respCacheControl := parseCacheControl(r.Header) - + if maxAge, ok := respCacheControl["max-age"]; ok { lifetime, err := time.ParseDuration(maxAge + "s") if err != nil { @@ -433,7 +436,6 @@ func CacheExpires(r *http.Response) (time.Time) { return expires } -func strlen(s string) (int) { +func strlen(s string) int { return utf8.RuneCountInString(s) } - diff --git a/samples/client/petstore/go/go-petstore/api_response.go b/samples/client/petstore/go/go-petstore/api_response.go index 2e6e99e3e72..2f5f69231fe 100644 --- a/samples/client/petstore/go/go-petstore/api_response.go +++ b/samples/client/petstore/go/go-petstore/api_response.go @@ -16,15 +16,15 @@ import ( type APIResponse struct { *http.Response `json:"-"` - Message string `json:"message,omitempty"` + Message string `json:"message,omitempty"` // Operation is the name of the swagger operation. - Operation string `json:"operation,omitempty"` + Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. - RequestURL string `json:"url,omitempty"` + RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. - Method string `json:"method,omitempty"` + Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. diff --git a/samples/client/petstore/go/go-petstore/array_of_array_of_number_only.go b/samples/client/petstore/go/go-petstore/array_of_array_of_number_only.go index 2ea01100c1b..183f8096afd 100644 --- a/samples/client/petstore/go/go-petstore/array_of_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore/array_of_array_of_number_only.go @@ -11,6 +11,5 @@ package petstore type ArrayOfArrayOfNumberOnly struct { - ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/array_of_number_only.go b/samples/client/petstore/go/go-petstore/array_of_number_only.go index af7ceb14160..5d91b0f0a84 100644 --- a/samples/client/petstore/go/go-petstore/array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore/array_of_number_only.go @@ -11,6 +11,5 @@ package petstore type ArrayOfNumberOnly struct { - ArrayNumber []float32 `json:"ArrayNumber,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/array_test.go b/samples/client/petstore/go/go-petstore/array_test.go index 1b7a9a8a170..7a99a6e6662 100644 --- a/samples/client/petstore/go/go-petstore/array_test.go +++ b/samples/client/petstore/go/go-petstore/array_test.go @@ -11,7 +11,6 @@ package petstore type ArrayTest struct { - ArrayOfString []string `json:"array_of_string,omitempty"` ArrayArrayOfInteger [][]int64 `json:"array_array_of_integer,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/capitalization.go b/samples/client/petstore/go/go-petstore/capitalization.go index 399f39b12b2..1c259e09e85 100644 --- a/samples/client/petstore/go/go-petstore/capitalization.go +++ b/samples/client/petstore/go/go-petstore/capitalization.go @@ -11,7 +11,6 @@ package petstore type Capitalization struct { - SmallCamel string `json:"smallCamel,omitempty"` CapitalCamel string `json:"CapitalCamel,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/cat.go b/samples/client/petstore/go/go-petstore/cat.go index ac2e7e72db7..e5044651054 100644 --- a/samples/client/petstore/go/go-petstore/cat.go +++ b/samples/client/petstore/go/go-petstore/cat.go @@ -11,7 +11,6 @@ package petstore type Cat struct { - ClassName string `json:"className"` Color string `json:"color,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/category.go b/samples/client/petstore/go/go-petstore/category.go index 20d3921d22c..048a144bdfc 100644 --- a/samples/client/petstore/go/go-petstore/category.go +++ b/samples/client/petstore/go/go-petstore/category.go @@ -11,7 +11,6 @@ package petstore type Category struct { - Id int64 `json:"id,omitempty"` Name string `json:"name,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/class_model.go b/samples/client/petstore/go/go-petstore/class_model.go index 7982d3482c0..c6440c2ed9d 100644 --- a/samples/client/petstore/go/go-petstore/class_model.go +++ b/samples/client/petstore/go/go-petstore/class_model.go @@ -12,6 +12,5 @@ package petstore // Model for testing model with \"_class\" property type ClassModel struct { - Class string `json:"_class,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index 1053b95cecd..fb393f1f9ce 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -11,6 +11,5 @@ package petstore type Client struct { - Client string `json:"client,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/configuration.go b/samples/client/petstore/go/go-petstore/configuration.go index 630e03a82bd..8cfb8a5a272 100644 --- a/samples/client/petstore/go/go-petstore/configuration.go +++ b/samples/client/petstore/go/go-petstore/configuration.go @@ -26,37 +26,37 @@ func (c contextKey) String() string { var ( // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. - ContextOAuth2 = contextKey("token") + ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. - ContextBasicAuth = contextKey("basic") + ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. - ContextAccessToken = contextKey("accesstoken") + ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request - ContextAPIKey = contextKey("apikey") + ContextAPIKey = contextKey("apikey") ) -// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth type BasicAuth struct { - UserName string `json:"userName,omitempty"` - Password string `json:"password,omitempty"` + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` } // APIKey provides API key based authentication to a request passed via context using ContextAPIKey type APIKey struct { - Key string - Prefix string + Key string + Prefix string } type Configuration struct { - BasePath string `json:"basePath,omitempty"` - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - HTTPClient *http.Client + BasePath string `json:"basePath,omitempty"` + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + HTTPClient *http.Client } func NewConfiguration() *Configuration { @@ -70,4 +70,4 @@ func NewConfiguration() *Configuration { func (c *Configuration) AddDefaultHeader(key string, value string) { c.DefaultHeader[key] = value -} \ No newline at end of file +} diff --git a/samples/client/petstore/go/go-petstore/dog.go b/samples/client/petstore/go/go-petstore/dog.go index ae45406c754..eb94fa1278a 100644 --- a/samples/client/petstore/go/go-petstore/dog.go +++ b/samples/client/petstore/go/go-petstore/dog.go @@ -11,7 +11,6 @@ package petstore type Dog struct { - ClassName string `json:"className"` Color string `json:"color,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/enum_arrays.go b/samples/client/petstore/go/go-petstore/enum_arrays.go index 0ff0813a1d2..0c7c4e8db90 100644 --- a/samples/client/petstore/go/go-petstore/enum_arrays.go +++ b/samples/client/petstore/go/go-petstore/enum_arrays.go @@ -11,7 +11,6 @@ package petstore type EnumArrays struct { - JustSymbol string `json:"just_symbol,omitempty"` ArrayEnum []string `json:"array_enum,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/enum_class.go b/samples/client/petstore/go/go-petstore/enum_class.go index 4950a03e747..b0180356b4a 100644 --- a/samples/client/petstore/go/go-petstore/enum_class.go +++ b/samples/client/petstore/go/go-petstore/enum_class.go @@ -15,6 +15,8 @@ type EnumClass string // List of EnumClass const ( ABC EnumClass = "_abc" + EFG EnumClass = "-efg" + XYZ EnumClass = "(xyz)" ) diff --git a/samples/client/petstore/go/go-petstore/enum_test.go b/samples/client/petstore/go/go-petstore/enum_test.go index 58e4ea6a746..d985723c96e 100644 --- a/samples/client/petstore/go/go-petstore/enum_test.go +++ b/samples/client/petstore/go/go-petstore/enum_test.go @@ -11,7 +11,6 @@ package petstore type EnumTest struct { - EnumString string `json:"enum_string,omitempty"` EnumInteger int32 `json:"enum_integer,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/fake_api.go b/samples/client/petstore/go/go-petstore/fake_api.go index 51cb2d6e463..a42fc29c2ca 100644 --- a/samples/client/petstore/go/go-petstore/fake_api.go +++ b/samples/client/petstore/go/go-petstore/fake_api.go @@ -12,8 +12,8 @@ package petstore import ( "io/ioutil" - "net/url" "net/http" + "net/url" "strings" "golang.org/x/net/context" "time" @@ -27,20 +27,19 @@ var ( type FakeApiService service - -/* FakeApiService - Test serialization of outer boolean types +/* FakeApiService +Test serialization of outer boolean types * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (OuterBoolean) Input boolean as post body - @return OuterBoolean*/ -func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals map[string]interface{}) (OuterBoolean, *http.Response, error) { +@param optional (nil or map[string]interface{}) with one or more of: + @param "body" (OuterBoolean) Input boolean as post body +@return OuterBoolean*/ +func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals map[string]interface{}) (OuterBoolean, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload OuterBoolean + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload OuterBoolean ) // create path and map variables @@ -50,9 +49,8 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -61,8 +59,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - } + localVarHttpHeaderAccepts := []string{} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -92,23 +89,22 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar return successPayload, localVarHttpResponse, err } - return successPayload, localVarHttpResponse, err } -/* FakeApiService - Test serialization of object with outer number type +/* FakeApiService +Test serialization of object with outer number type * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (OuterComposite) Input composite as post body - @return OuterComposite*/ -func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals map[string]interface{}) (OuterComposite, *http.Response, error) { +@param optional (nil or map[string]interface{}) with one or more of: + @param "body" (OuterComposite) Input composite as post body +@return OuterComposite*/ +func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals map[string]interface{}) (OuterComposite, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload OuterComposite + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload OuterComposite ) // create path and map variables @@ -118,9 +114,8 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -129,8 +124,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - } + localVarHttpHeaderAccepts := []string{} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -160,23 +154,22 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV return successPayload, localVarHttpResponse, err } - return successPayload, localVarHttpResponse, err } -/* FakeApiService - Test serialization of outer number types +/* FakeApiService +Test serialization of outer number types * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (OuterNumber) Input number as post body - @return OuterNumber*/ -func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals map[string]interface{}) (OuterNumber, *http.Response, error) { +@param optional (nil or map[string]interface{}) with one or more of: + @param "body" (OuterNumber) Input number as post body +@return OuterNumber*/ +func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals map[string]interface{}) (OuterNumber, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload OuterNumber + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload OuterNumber ) // create path and map variables @@ -186,9 +179,8 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -197,8 +189,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - } + localVarHttpHeaderAccepts := []string{} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -228,23 +219,22 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO return successPayload, localVarHttpResponse, err } - return successPayload, localVarHttpResponse, err } -/* FakeApiService - Test serialization of outer string types +/* FakeApiService +Test serialization of outer string types * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (OuterString) Input string as post body - @return OuterString*/ -func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals map[string]interface{}) (OuterString, *http.Response, error) { +@param optional (nil or map[string]interface{}) with one or more of: + @param "body" (OuterString) Input string as post body +@return OuterString*/ +func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals map[string]interface{}) (OuterString, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload OuterString + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload OuterString ) // create path and map variables @@ -254,9 +244,8 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -265,8 +254,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - } + localVarHttpHeaderAccepts := []string{} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -296,22 +284,21 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO return successPayload, localVarHttpResponse, err } - return successPayload, localVarHttpResponse, err } /* FakeApiService To test \"client\" model - To test \"client\" model +To test \"client\" model * @param ctx context.Context for authentication, logging, tracing, etc. - @param body client model - @return Client*/ -func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Client, *http.Response, error) { +@param body client model +@return Client*/ +func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Client, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Client + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Client ) // create path and map variables @@ -321,9 +308,8 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -332,9 +318,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -362,35 +346,34 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie return successPayload, localVarHttpResponse, err } - return successPayload, localVarHttpResponse, err } /* FakeApiService Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @param ctx context.Context for authentication, logging, tracing, etc. - @param number None - @param double None - @param patternWithoutDelimiter None - @param byte_ None - @param optional (nil or map[string]interface{}) with one or more of: - @param "integer" (int32) None - @param "int32_" (int32) None - @param "int64_" (int64) None - @param "float" (float32) None - @param "string_" (string) None - @param "binary" (string) None - @param "date" (string) None - @param "dateTime" (time.Time) None - @param "password" (string) None - @param "callback" (string) None - @return */ -func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals map[string]interface{}) ( *http.Response, error) { +@param number None +@param double None +@param patternWithoutDelimiter None +@param byte_ None +@param optional (nil or map[string]interface{}) with one or more of: + @param "integer" (int32) None + @param "int32_" (int32) None + @param "int64_" (int64) None + @param "float" (float32) None + @param "string_" (string) None + @param "binary" (string) None + @param "date" (string) None + @param "dateTime" (time.Time) None + @param "password" (string) None + @param "callback" (string) None +@return */ +func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals map[string]interface{}) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -399,7 +382,6 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if number < 32.1 { return nil, reportError("number must be greater than 32.1") } @@ -444,7 +426,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa } // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/xml; charset=utf-8", "application/json; charset=utf-8", } + localVarHttpContentTypes := []string{"application/xml; charset=utf-8", "application/json; charset=utf-8"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -453,10 +435,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml; charset=utf-8", - "application/json; charset=utf-8", - } + localVarHttpHeaderAccepts := []string{"application/xml; charset=utf-8", "application/json; charset=utf-8"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -511,29 +490,28 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } - return localVarHttpResponse, err } /* FakeApiService To test enum parameters - To test enum parameters +To test enum parameters * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "enumFormStringArray" ([]string) Form parameter enum test (string array) - @param "enumFormString" (string) Form parameter enum test (string) - @param "enumHeaderStringArray" ([]string) Header parameter enum test (string array) - @param "enumHeaderString" (string) Header parameter enum test (string) - @param "enumQueryStringArray" ([]string) Query parameter enum test (string array) - @param "enumQueryString" (string) Query parameter enum test (string) - @param "enumQueryInteger" (int32) Query parameter enum test (double) - @param "enumQueryDouble" (float64) Query parameter enum test (double) - @return */ -func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals map[string]interface{}) ( *http.Response, error) { +@param optional (nil or map[string]interface{}) with one or more of: + @param "enumFormStringArray" ([]string) Form parameter enum test (string array) + @param "enumFormString" (string) Form parameter enum test (string) + @param "enumHeaderStringArray" ([]string) Header parameter enum test (string array) + @param "enumHeaderString" (string) Header parameter enum test (string) + @param "enumQueryStringArray" ([]string) Query parameter enum test (string array) + @param "enumQueryString" (string) Query parameter enum test (string) + @param "enumQueryInteger" (int32) Query parameter enum test (double) + @param "enumQueryDouble" (float64) Query parameter enum test (double) +@return */ +func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals map[string]interface{}) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -542,7 +520,6 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if err := typeCheckParameter(localVarOptionals["enumFormString"], "string", "enumFormString"); err != nil { return nil, err } @@ -569,7 +546,7 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona localVarQueryParams.Add("enum_query_integer", parameterToString(localVarTempParam, "")) } // to determine the Content-Type header - localVarHttpContentTypes := []string{ "*/*", } + localVarHttpContentTypes := []string{"*/*"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -578,9 +555,7 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "*/*", - } + localVarHttpHeaderAccepts := []string{"*/*"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -616,21 +591,20 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } - return localVarHttpResponse, err } /* FakeApiService test inline additionalProperties - + * @param ctx context.Context for authentication, logging, tracing, etc. - @param param request body - @return */ -func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, param interface{}) ( *http.Response, error) { +@param param request body +@return */ +func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, param interface{}) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -640,9 +614,8 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, par localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -651,8 +624,7 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, par } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - } + localVarHttpHeaderAccepts := []string{} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -675,22 +647,21 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, par bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } - return localVarHttpResponse, err } /* FakeApiService test json serialization of form data - + * @param ctx context.Context for authentication, logging, tracing, etc. - @param param field1 - @param param2 field2 - @return */ -func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, param2 string) ( *http.Response, error) { +@param param field1 +@param param2 field2 +@return */ +func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, param2 string) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -700,9 +671,8 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -711,8 +681,7 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - } + localVarHttpHeaderAccepts := []string{} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -735,7 +704,5 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } - return localVarHttpResponse, err } - diff --git a/samples/client/petstore/go/go-petstore/fake_classname_tags123_api.go b/samples/client/petstore/go/go-petstore/fake_classname_tags123_api.go index 95faf08358d..9da799e4160 100644 --- a/samples/client/petstore/go/go-petstore/fake_classname_tags123_api.go +++ b/samples/client/petstore/go/go-petstore/fake_classname_tags123_api.go @@ -12,8 +12,8 @@ package petstore import ( "io/ioutil" - "net/url" "net/http" + "net/url" "strings" "golang.org/x/net/context" "encoding/json" @@ -26,18 +26,17 @@ var ( type FakeClassnameTags123ApiService service - /* FakeClassnameTags123ApiService To test class name in snake case * @param ctx context.Context for authentication, logging, tracing, etc. - @param body client model - @return Client*/ -func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body Client) (Client, *http.Response, error) { +@param body client model +@return Client*/ +func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body Client) (Client, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Client + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Client ) // create path and map variables @@ -47,9 +46,8 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } + localVarHttpContentTypes := []string{"application/json"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -58,9 +56,7 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -100,7 +96,5 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body return successPayload, localVarHttpResponse, err } - return successPayload, localVarHttpResponse, err } - diff --git a/samples/client/petstore/go/go-petstore/format_test.go b/samples/client/petstore/go/go-petstore/format_test.go index b8bcb738fd6..2674ef255ca 100644 --- a/samples/client/petstore/go/go-petstore/format_test.go +++ b/samples/client/petstore/go/go-petstore/format_test.go @@ -15,7 +15,6 @@ import ( ) type FormatTest struct { - Integer int32 `json:"integer,omitempty"` Int32_ int32 `json:"int32,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/has_only_read_only.go b/samples/client/petstore/go/go-petstore/has_only_read_only.go index a9231320059..c290b54c4a7 100644 --- a/samples/client/petstore/go/go-petstore/has_only_read_only.go +++ b/samples/client/petstore/go/go-petstore/has_only_read_only.go @@ -11,7 +11,6 @@ package petstore type HasOnlyReadOnly struct { - Bar string `json:"bar,omitempty"` Foo string `json:"foo,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/list.go b/samples/client/petstore/go/go-petstore/list.go index 1d4033a09c0..44d4cb982ea 100644 --- a/samples/client/petstore/go/go-petstore/list.go +++ b/samples/client/petstore/go/go-petstore/list.go @@ -11,6 +11,5 @@ package petstore type List struct { - Var123List string `json:"123-list,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/map_test.go b/samples/client/petstore/go/go-petstore/map_test.go index c94c171040a..0b51a0103bf 100644 --- a/samples/client/petstore/go/go-petstore/map_test.go +++ b/samples/client/petstore/go/go-petstore/map_test.go @@ -11,7 +11,6 @@ package petstore type MapTest struct { - MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty"` MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/mixed_properties_and_additional_properties_class.go b/samples/client/petstore/go/go-petstore/mixed_properties_and_additional_properties_class.go index ea21910e4ee..b5d120dfa3d 100644 --- a/samples/client/petstore/go/go-petstore/mixed_properties_and_additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore/mixed_properties_and_additional_properties_class.go @@ -15,7 +15,6 @@ import ( ) type MixedPropertiesAndAdditionalPropertiesClass struct { - Uuid string `json:"uuid,omitempty"` DateTime time.Time `json:"dateTime,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_200_response.go b/samples/client/petstore/go/go-petstore/model_200_response.go index ab8f557f377..8de1415bb85 100644 --- a/samples/client/petstore/go/go-petstore/model_200_response.go +++ b/samples/client/petstore/go/go-petstore/model_200_response.go @@ -12,7 +12,6 @@ package petstore // Model for testing model name starting with number type Model200Response struct { - Name int32 `json:"name,omitempty"` Class string `json:"class,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_api_response.go b/samples/client/petstore/go/go-petstore/model_api_response.go index 2ca2e3c8160..1852fcd25d3 100644 --- a/samples/client/petstore/go/go-petstore/model_api_response.go +++ b/samples/client/petstore/go/go-petstore/model_api_response.go @@ -11,7 +11,6 @@ package petstore type ModelApiResponse struct { - Code int32 `json:"code,omitempty"` Type_ string `json:"type,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_return.go b/samples/client/petstore/go/go-petstore/model_return.go index b2cfff1d727..ff17ce95228 100644 --- a/samples/client/petstore/go/go-petstore/model_return.go +++ b/samples/client/petstore/go/go-petstore/model_return.go @@ -12,6 +12,5 @@ package petstore // Model for testing reserved words type ModelReturn struct { - Return_ int32 `json:"return,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/name.go b/samples/client/petstore/go/go-petstore/name.go index c4d3cd5a099..42baa928740 100644 --- a/samples/client/petstore/go/go-petstore/name.go +++ b/samples/client/petstore/go/go-petstore/name.go @@ -12,7 +12,6 @@ package petstore // Model for testing model name same as property name type Name struct { - Name int32 `json:"name"` SnakeCase int32 `json:"snake_case,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/number_only.go b/samples/client/petstore/go/go-petstore/number_only.go index 3c5adb8ba79..631de12e68a 100644 --- a/samples/client/petstore/go/go-petstore/number_only.go +++ b/samples/client/petstore/go/go-petstore/number_only.go @@ -11,6 +11,5 @@ package petstore type NumberOnly struct { - JustNumber float32 `json:"JustNumber,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/order.go b/samples/client/petstore/go/go-petstore/order.go index 8e6f48e265a..afa590475c0 100644 --- a/samples/client/petstore/go/go-petstore/order.go +++ b/samples/client/petstore/go/go-petstore/order.go @@ -15,7 +15,6 @@ import ( ) type Order struct { - Id int64 `json:"id,omitempty"` PetId int64 `json:"petId,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/outer_composite.go b/samples/client/petstore/go/go-petstore/outer_composite.go index 3b40bfc5b52..7108ccc25a6 100644 --- a/samples/client/petstore/go/go-petstore/outer_composite.go +++ b/samples/client/petstore/go/go-petstore/outer_composite.go @@ -11,7 +11,6 @@ package petstore type OuterComposite struct { - MyNumber *OuterNumber `json:"my_number,omitempty"` MyString *OuterString `json:"my_string,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/outer_enum.go b/samples/client/petstore/go/go-petstore/outer_enum.go index 0e724d17c5c..5ad5712734c 100644 --- a/samples/client/petstore/go/go-petstore/outer_enum.go +++ b/samples/client/petstore/go/go-petstore/outer_enum.go @@ -15,6 +15,8 @@ type OuterEnum string // List of OuterEnum const ( PLACED OuterEnum = "placed" + APPROVED OuterEnum = "approved" + DELIVERED OuterEnum = "delivered" ) diff --git a/samples/client/petstore/go/go-petstore/pet.go b/samples/client/petstore/go/go-petstore/pet.go index 11bf78166c5..fcf57074eca 100644 --- a/samples/client/petstore/go/go-petstore/pet.go +++ b/samples/client/petstore/go/go-petstore/pet.go @@ -11,7 +11,6 @@ package petstore type Pet struct { - Id int64 `json:"id,omitempty"` Category *Category `json:"category,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/pet_api.go b/samples/client/petstore/go/go-petstore/pet_api.go index 1b929dcdd8d..44170b2adb8 100644 --- a/samples/client/petstore/go/go-petstore/pet_api.go +++ b/samples/client/petstore/go/go-petstore/pet_api.go @@ -12,8 +12,8 @@ package petstore import ( "io/ioutil" - "net/url" "net/http" + "net/url" "strings" "golang.org/x/net/context" "os" @@ -28,18 +28,17 @@ var ( type PetApiService service - /* PetApiService Add a new pet to the store - + * @param ctx context.Context for authentication, logging, tracing, etc. - @param body Pet object that needs to be added to the store - @return */ -func (a *PetApiService) AddPet(ctx context.Context, body Pet) ( *http.Response, error) { +@param body Pet object that needs to be added to the store +@return */ +func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -49,9 +48,8 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) ( *http.Response, localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", "application/xml", } + localVarHttpContentTypes := []string{"application/json", "application/xml"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -60,10 +58,7 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) ( *http.Response, } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -86,23 +81,22 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) ( *http.Response, bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } - return localVarHttpResponse, err } /* PetApiService Deletes a pet - + * @param ctx context.Context for authentication, logging, tracing, etc. - @param petId Pet id to delete - @param optional (nil or map[string]interface{}) with one or more of: - @param "apiKey" (string) - @return */ -func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals map[string]interface{}) ( *http.Response, error) { +@param petId Pet id to delete +@param optional (nil or map[string]interface{}) with one or more of: + @param "apiKey" (string) +@return */ +func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals map[string]interface{}) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -112,13 +106,12 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if err := typeCheckParameter(localVarOptionals["apiKey"], "string", "apiKey"); err != nil { return nil, err } // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -127,10 +120,7 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -154,22 +144,21 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } - return localVarHttpResponse, err } /* PetApiService Finds Pets by status - Multiple status values can be provided with comma separated strings +Multiple status values can be provided with comma separated strings * @param ctx context.Context for authentication, logging, tracing, etc. - @param status Status values that need to be considered for filter - @return []Pet*/ -func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ([]Pet, *http.Response, error) { +@param status Status values that need to be considered for filter +@return []Pet*/ +func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ([]Pet, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []Pet + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload []Pet ) // create path and map variables @@ -179,10 +168,9 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - localVarQueryParams.Add("status", parameterToString(status, "csv")) // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -191,10 +179,7 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -220,22 +205,21 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( return successPayload, localVarHttpResponse, err } - return successPayload, localVarHttpResponse, err } /* PetApiService Finds Pets by tags - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param ctx context.Context for authentication, logging, tracing, etc. - @param tags Tags to filter by - @return []Pet*/ -func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pet, *http.Response, error) { +@param tags Tags to filter by +@return []Pet*/ +func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pet, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []Pet + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload []Pet ) // create path and map variables @@ -245,10 +229,9 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - localVarQueryParams.Add("tags", parameterToString(tags, "csv")) // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -257,10 +240,7 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -286,22 +266,21 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe return successPayload, localVarHttpResponse, err } - return successPayload, localVarHttpResponse, err } /* PetApiService Find pet by ID - Returns a single pet +Returns a single pet * @param ctx context.Context for authentication, logging, tracing, etc. - @param petId ID of pet to return - @return Pet*/ -func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http.Response, error) { +@param petId ID of pet to return +@return Pet*/ +func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Pet + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Pet ) // create path and map variables @@ -312,9 +291,8 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *htt localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -323,10 +301,7 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *htt } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -364,21 +339,20 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *htt return successPayload, localVarHttpResponse, err } - return successPayload, localVarHttpResponse, err } /* PetApiService Update an existing pet - + * @param ctx context.Context for authentication, logging, tracing, etc. - @param body Pet object that needs to be added to the store - @return */ -func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) ( *http.Response, error) { +@param body Pet object that needs to be added to the store +@return */ +func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -388,9 +362,8 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) ( *http.Respons localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", "application/xml", } + localVarHttpContentTypes := []string{"application/json", "application/xml"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -399,10 +372,7 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) ( *http.Respons } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -425,24 +395,23 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) ( *http.Respons bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } - return localVarHttpResponse, err } /* PetApiService Updates a pet in the store with form data - + * @param ctx context.Context for authentication, logging, tracing, etc. - @param petId ID of pet that needs to be updated - @param optional (nil or map[string]interface{}) with one or more of: - @param "name" (string) Updated name of the pet - @param "status" (string) Updated status of the pet - @return */ -func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals map[string]interface{}) ( *http.Response, error) { +@param petId ID of pet that needs to be updated +@param optional (nil or map[string]interface{}) with one or more of: + @param "name" (string) Updated name of the pet + @param "status" (string) Updated status of the pet +@return */ +func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals map[string]interface{}) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -452,7 +421,6 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if err := typeCheckParameter(localVarOptionals["name"], "string", "name"); err != nil { return nil, err } @@ -461,7 +429,7 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca } // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } + localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -470,10 +438,7 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -500,25 +465,24 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } - return localVarHttpResponse, err } /* PetApiService uploads an image - + * @param ctx context.Context for authentication, logging, tracing, etc. - @param petId ID of pet to update - @param optional (nil or map[string]interface{}) with one or more of: - @param "additionalMetadata" (string) Additional data to pass to server - @param "file" (*os.File) file to upload - @return ModelApiResponse*/ -func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals map[string]interface{}) (ModelApiResponse, *http.Response, error) { +@param petId ID of pet to update +@param optional (nil or map[string]interface{}) with one or more of: + @param "additionalMetadata" (string) Additional data to pass to server + @param "file" (*os.File) file to upload +@return ModelApiResponse*/ +func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals map[string]interface{}) (ModelApiResponse, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload ModelApiResponse + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload ModelApiResponse ) // create path and map variables @@ -528,13 +492,12 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if err := typeCheckParameter(localVarOptionals["additionalMetadata"], "string", "additionalMetadata"); err != nil { return successPayload, nil, err } // to determine the Content-Type header - localVarHttpContentTypes := []string{ "multipart/form-data", } + localVarHttpContentTypes := []string{"multipart/form-data"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -543,9 +506,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -584,7 +545,5 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt return successPayload, localVarHttpResponse, err } - return successPayload, localVarHttpResponse, err } - diff --git a/samples/client/petstore/go/go-petstore/read_only_first.go b/samples/client/petstore/go/go-petstore/read_only_first.go index ec46cccb099..c2d44d32eea 100644 --- a/samples/client/petstore/go/go-petstore/read_only_first.go +++ b/samples/client/petstore/go/go-petstore/read_only_first.go @@ -11,7 +11,6 @@ package petstore type ReadOnlyFirst struct { - Bar string `json:"bar,omitempty"` Baz string `json:"baz,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/special_model_name.go b/samples/client/petstore/go/go-petstore/special_model_name.go index 46f51fab939..252c3779f09 100644 --- a/samples/client/petstore/go/go-petstore/special_model_name.go +++ b/samples/client/petstore/go/go-petstore/special_model_name.go @@ -11,6 +11,5 @@ package petstore type SpecialModelName struct { - SpecialPropertyName int64 `json:"$special[property.name],omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/store_api.go b/samples/client/petstore/go/go-petstore/store_api.go index 5b3d23d1e5b..16aea981031 100644 --- a/samples/client/petstore/go/go-petstore/store_api.go +++ b/samples/client/petstore/go/go-petstore/store_api.go @@ -12,8 +12,8 @@ package petstore import ( "io/ioutil" - "net/url" "net/http" + "net/url" "strings" "golang.org/x/net/context" "encoding/json" @@ -27,18 +27,17 @@ var ( type StoreApiService service - /* StoreApiService Delete purchase order by ID - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param ctx context.Context for authentication, logging, tracing, etc. - @param orderId ID of the order that needs to be deleted - @return */ -func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) ( *http.Response, error) { +@param orderId ID of the order that needs to be deleted +@return */ +func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -49,9 +48,8 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) ( *ht localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -60,10 +58,7 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) ( *ht } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -84,21 +79,20 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) ( *ht bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } - return localVarHttpResponse, err } /* StoreApiService Returns pet inventories by status - Returns a map of status codes to quantities +Returns a map of status codes to quantities * @param ctx context.Context for authentication, logging, tracing, etc. - @return map[string]int32*/ -func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *http.Response, error) { +@return map[string]int32*/ +func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload map[string]int32 + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload map[string]int32 ) // create path and map variables @@ -108,9 +102,8 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -119,9 +112,7 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -159,22 +150,21 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, return successPayload, localVarHttpResponse, err } - return successPayload, localVarHttpResponse, err } /* StoreApiService Find purchase order by ID - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param ctx context.Context for authentication, logging, tracing, etc. - @param orderId ID of pet that needs to be fetched - @return Order*/ -func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Order, *http.Response, error) { +@param orderId ID of pet that needs to be fetched +@return Order*/ +func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Order, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Order + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Order ) // create path and map variables @@ -184,7 +174,6 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if orderId < 1 { return successPayload, nil, reportError("orderId must be greater than 1") } @@ -193,7 +182,7 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde } // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -202,10 +191,7 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -231,22 +217,21 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde return successPayload, localVarHttpResponse, err } - return successPayload, localVarHttpResponse, err } /* StoreApiService Place an order for a pet - + * @param ctx context.Context for authentication, logging, tracing, etc. - @param body order placed for purchasing the pet - @return Order*/ -func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *http.Response, error) { +@param body order placed for purchasing the pet +@return Order*/ +func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Order + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Order ) // create path and map variables @@ -256,9 +241,8 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, * localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -267,10 +251,7 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, * } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -298,7 +279,5 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, * return successPayload, localVarHttpResponse, err } - return successPayload, localVarHttpResponse, err } - diff --git a/samples/client/petstore/go/go-petstore/tag.go b/samples/client/petstore/go/go-petstore/tag.go index 4c0c279e41c..9a584a09b41 100644 --- a/samples/client/petstore/go/go-petstore/tag.go +++ b/samples/client/petstore/go/go-petstore/tag.go @@ -11,7 +11,6 @@ package petstore type Tag struct { - Id int64 `json:"id,omitempty"` Name string `json:"name,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/user.go b/samples/client/petstore/go/go-petstore/user.go index 6577365f61c..99ae1c71567 100644 --- a/samples/client/petstore/go/go-petstore/user.go +++ b/samples/client/petstore/go/go-petstore/user.go @@ -11,7 +11,6 @@ package petstore type User struct { - Id int64 `json:"id,omitempty"` Username string `json:"username,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/user_api.go b/samples/client/petstore/go/go-petstore/user_api.go index c3ccd2e040e..9fb8a37f653 100644 --- a/samples/client/petstore/go/go-petstore/user_api.go +++ b/samples/client/petstore/go/go-petstore/user_api.go @@ -12,8 +12,8 @@ package petstore import ( "io/ioutil" - "net/url" "net/http" + "net/url" "strings" "golang.org/x/net/context" "encoding/json" @@ -27,18 +27,17 @@ var ( type UserApiService service - /* UserApiService Create user - This can only be done by the logged in user. +This can only be done by the logged in user. * @param ctx context.Context for authentication, logging, tracing, etc. - @param body Created user object - @return */ -func (a *UserApiService) CreateUser(ctx context.Context, body User) ( *http.Response, error) { +@param body Created user object +@return */ +func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -48,9 +47,8 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) ( *http.Resp localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -59,10 +57,7 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) ( *http.Resp } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -85,21 +80,20 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) ( *http.Resp bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } - return localVarHttpResponse, err } /* UserApiService Creates list of users with given input array - + * @param ctx context.Context for authentication, logging, tracing, etc. - @param body List of user object - @return */ -func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []User) ( *http.Response, error) { +@param body List of user object +@return */ +func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []User) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -109,9 +103,8 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -120,10 +113,7 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -146,21 +136,20 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } - return localVarHttpResponse, err } /* UserApiService Creates list of users with given input array - + * @param ctx context.Context for authentication, logging, tracing, etc. - @param body List of user object - @return */ -func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []User) ( *http.Response, error) { +@param body List of user object +@return */ +func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []User) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -170,9 +159,8 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []Us localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -181,10 +169,7 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []Us } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -207,21 +192,20 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []Us bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } - return localVarHttpResponse, err } /* UserApiService Delete user - This can only be done by the logged in user. +This can only be done by the logged in user. * @param ctx context.Context for authentication, logging, tracing, etc. - @param username The name that needs to be deleted - @return */ -func (a *UserApiService) DeleteUser(ctx context.Context, username string) ( *http.Response, error) { +@param username The name that needs to be deleted +@return */ +func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -232,9 +216,8 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) ( *htt localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -243,10 +226,7 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) ( *htt } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -267,22 +247,21 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) ( *htt bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } - return localVarHttpResponse, err } /* UserApiService Get user by user name - + * @param ctx context.Context for authentication, logging, tracing, etc. - @param username The name that needs to be fetched. Use user1 for testing. - @return User*/ -func (a *UserApiService) GetUserByName(ctx context.Context, username string) (User, *http.Response, error) { +@param username The name that needs to be fetched. Use user1 for testing. +@return User*/ +func (a *UserApiService) GetUserByName(ctx context.Context, username string) (User, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload User + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload User ) // create path and map variables @@ -293,9 +272,8 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -304,10 +282,7 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -333,23 +308,22 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us return successPayload, localVarHttpResponse, err } - return successPayload, localVarHttpResponse, err } /* UserApiService Logs user into the system - + * @param ctx context.Context for authentication, logging, tracing, etc. - @param username The user name for login - @param password The password for login in clear text - @return string*/ -func (a *UserApiService) LoginUser(ctx context.Context, username string, password string) (string, *http.Response, error) { +@param username The user name for login +@param password The password for login in clear text +@return string*/ +func (a *UserApiService) LoginUser(ctx context.Context, username string, password string) (string, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload string + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload string ) // create path and map variables @@ -359,11 +333,10 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - localVarQueryParams.Add("username", parameterToString(username, "")) localVarQueryParams.Add("password", parameterToString(password, "")) // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -372,10 +345,7 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -401,20 +371,19 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor return successPayload, localVarHttpResponse, err } - return successPayload, localVarHttpResponse, err } /* UserApiService Logs out current logged in user session - + * @param ctx context.Context for authentication, logging, tracing, etc. - @return */ -func (a *UserApiService) LogoutUser(ctx context.Context) ( *http.Response, error) { +@return */ +func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -424,9 +393,8 @@ func (a *UserApiService) LogoutUser(ctx context.Context) ( *http.Response, error localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -435,10 +403,7 @@ func (a *UserApiService) LogoutUser(ctx context.Context) ( *http.Response, error } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -459,22 +424,21 @@ func (a *UserApiService) LogoutUser(ctx context.Context) ( *http.Response, error bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } - return localVarHttpResponse, err } /* UserApiService Updated user - This can only be done by the logged in user. +This can only be done by the logged in user. * @param ctx context.Context for authentication, logging, tracing, etc. - @param username name that need to be deleted - @param body Updated user object - @return */ -func (a *UserApiService) UpdateUser(ctx context.Context, username string, body User) ( *http.Response, error) { +@param username name that need to be deleted +@param body Updated user object +@return */ +func (a *UserApiService) UpdateUser(ctx context.Context, username string, body User) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -485,9 +449,8 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, body U localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - // to determine the Content-Type header - localVarHttpContentTypes := []string{ } + localVarHttpContentTypes := []string{} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -496,10 +459,7 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, body U } // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/xml", - "application/json", - } + localVarHttpHeaderAccepts := []string{"application/xml", "application/json"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -522,7 +482,5 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, body U bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } - return localVarHttpResponse, err } - From bca2b9fb5bde874f22c290bcd794658b25c9c33f Mon Sep 17 00:00:00 2001 From: Jon Schoning Date: Sat, 6 Jan 2018 21:59:55 -0600 Subject: [PATCH 16/65] [haskell-http-client] handle */* mimetype correctly & split api modules & allowNonUniqueOperationIds (#7254) * [haskell-http-client] handle */* mimetype correctly * [haskell-http-client] generate separate api modules, for each child api * [haskell-http-client] add cliOption "allowNonUniqueOperationIds" When cli option "allowNonUniqueOperationIds" is true, allows *different* API modules to contain the same operationId, and then each API must be imported qualified. --- .../languages/HaskellHttpClientCodegen.java | 137 +- .../haskell-http-client/API.mustache | 98 +- .../haskell-http-client/APIS.mustache | 10 + .../haskell-http-client/MimeTypes.mustache | 18 + .../haskell-http-client/Model.mustache | 61 +- .../haskell-http-client/README.mustache | 1 + .../haskell-http-client/TopLevel.mustache | 8 +- .../haskell-http-client.cabal.mustache | 55 +- .../haskell-http-client/tests/Test.mustache | 2 +- .../HaskellHttpClientOptionsTest.java | 2 + .../HaskellHttpClientOptionsProvider.java | 2 + .../.swagger-codegen/VERSION | 2 +- .../petstore/haskell-http-client/README.md | 1 + .../docs/SwaggerPetstore-API-AnotherFake.html | 4 + .../docs/SwaggerPetstore-API-Fake.html | 4 + ...ggerPetstore-API-FakeClassnameTags123.html | 4 + .../docs/SwaggerPetstore-API-Pet.html | 4 + .../docs/SwaggerPetstore-API-Store.html | 4 + .../docs/SwaggerPetstore-API-User.html | 4 + .../docs/SwaggerPetstore-API.html | 2 +- .../docs/SwaggerPetstore-Core.html | 2 +- .../docs/SwaggerPetstore-MimeTypes.html | 2 +- .../docs/SwaggerPetstore-Model.html | 14 +- .../haskell-http-client/docs/doc-index-A.html | 2 +- .../docs/doc-index-All.html | 2 +- .../haskell-http-client/docs/doc-index-B.html | 2 +- .../haskell-http-client/docs/doc-index-C.html | 2 +- .../haskell-http-client/docs/doc-index-D.html | 2 +- .../haskell-http-client/docs/doc-index-E.html | 2 +- .../haskell-http-client/docs/doc-index-F.html | 2 +- .../haskell-http-client/docs/doc-index-G.html | 2 +- .../haskell-http-client/docs/doc-index-I.html | 2 +- .../haskell-http-client/docs/doc-index-L.html | 2 +- .../haskell-http-client/docs/doc-index-M.html | 2 +- .../haskell-http-client/docs/doc-index-N.html | 2 +- .../haskell-http-client/docs/doc-index-O.html | 2 +- .../haskell-http-client/docs/doc-index-P.html | 2 +- .../haskell-http-client/docs/doc-index-S.html | 2 +- .../haskell-http-client/docs/doc-index-T.html | 2 +- .../haskell-http-client/docs/doc-index-U.html | 2 +- .../haskell-http-client/docs/index.html | 2 +- .../docs/mini_SwaggerPetstore-API.html | 4 - .../docs/mini_SwaggerPetstore-Client.html | 4 - .../docs/mini_SwaggerPetstore-Core.html | 4 - .../docs/mini_SwaggerPetstore-Logging.html | 4 - .../docs/mini_SwaggerPetstore-MimeTypes.html | 4 - .../docs/mini_SwaggerPetstore-Model.html | 4 - .../docs/mini_SwaggerPetstore-ModelLens.html | 4 - .../docs/mini_SwaggerPetstore.html | 4 - .../src/SwaggerPetstore.API.AnotherFake.html | 90 + .../docs/src/SwaggerPetstore.API.Fake.html | 376 ++ ...ggerPetstore.API.FakeClassnameTags123.html | 91 + .../docs/src/SwaggerPetstore.API.Pet.html | 329 ++ .../docs/src/SwaggerPetstore.API.Store.html | 156 + .../docs/src/SwaggerPetstore.API.User.html | 275 ++ .../docs/src/SwaggerPetstore.API.html | 1162 +----- .../docs/src/SwaggerPetstore.Client.html | 178 +- .../docs/src/SwaggerPetstore.Core.html | 310 +- .../docs/src/SwaggerPetstore.MimeTypes.html | 150 +- .../docs/src/SwaggerPetstore.Model.html | 3199 +++++++++-------- .../docs/src/SwaggerPetstore.ModelLens.html | 182 +- .../docs/src/SwaggerPetstore.html | 5 +- .../docs/swagger-petstore.txt | 1122 +++--- .../example-app/package.yaml | 2 +- .../example-app/swagger-petstore-app.cabal | 4 +- .../lib/SwaggerPetstore.hs | 4 +- .../lib/SwaggerPetstore/API.hs | 1161 +----- .../lib/SwaggerPetstore/API/AnotherFake.hs | 89 + .../lib/SwaggerPetstore/API/Fake.hs | 375 ++ .../API/FakeClassnameTags123.hs | 90 + .../lib/SwaggerPetstore/API/Pet.hs | 328 ++ .../lib/SwaggerPetstore/API/Store.hs | 155 + .../lib/SwaggerPetstore/API/User.hs | 274 ++ .../lib/SwaggerPetstore/MimeTypes.hs | 26 + .../lib/SwaggerPetstore/Model.hs | 177 +- .../swagger-petstore.cabal | 56 +- .../haskell-http-client/tests/Test.hs | 2 +- 77 files changed, 5866 insertions(+), 5011 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/haskell-http-client/APIS.mustache create mode 100644 samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-AnotherFake.html create mode 100644 samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-Fake.html create mode 100644 samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-FakeClassnameTags123.html create mode 100644 samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-Pet.html create mode 100644 samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-Store.html create mode 100644 samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-User.html delete mode 100644 samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-API.html delete mode 100644 samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Client.html delete mode 100644 samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Core.html delete mode 100644 samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Logging.html delete mode 100644 samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-MimeTypes.html delete mode 100644 samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Model.html delete mode 100644 samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-ModelLens.html delete mode 100644 samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore.html create mode 100644 samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.AnotherFake.html create mode 100644 samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.Fake.html create mode 100644 samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.FakeClassnameTags123.html create mode 100644 samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.Pet.html create mode 100644 samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.Store.html create mode 100644 samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.User.html create mode 100644 samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/AnotherFake.hs create mode 100644 samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/Fake.hs create mode 100644 samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/FakeClassnameTags123.hs create mode 100644 samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/Pet.hs create mode 100644 samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/Store.hs create mode 100644 samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/User.hs diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/HaskellHttpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/HaskellHttpClientCodegen.java index f7a4da78871..4c12bf75e8f 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/HaskellHttpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/HaskellHttpClientCodegen.java @@ -8,6 +8,7 @@ import java.util.*; import java.util.regex.Pattern; +import java.io.File; import io.swagger.models.auth.SecuritySchemeDefinition; import io.swagger.codegen.CliOption; @@ -28,7 +29,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenConfig { // source folder where to write the files - protected String sourceFolder = "src"; + protected String sourceFolder = "lib"; protected String artifactId = "swagger-haskell-http-client"; protected String artifactVersion = "1.0.0"; @@ -36,11 +37,13 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC protected String defaultDateFormat = "%Y-%m-%d"; protected Boolean useMonadLogger = false; + protected Boolean allowNonUniqueOperationIds = false; protected Boolean genEnums = true; // CLI PROPS public static final String PROP_ALLOW_FROMJSON_NULLS = "allowFromJsonNulls"; public static final String PROP_ALLOW_TOJSON_NULLS = "allowToJsonNulls"; + public static final String PROP_ALLOW_NONUNIQUE_OPERATION_IDS = "allowNonUniqueOperationIds"; public static final String PROP_DATETIME_FORMAT = "dateTimeFormat"; public static final String PROP_DATE_FORMAT = "dateFormat"; public static final String PROP_GENERATE_ENUMS = "generateEnums"; @@ -79,6 +82,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC static final String X_DATA_TYPE = "x-dataType"; static final String X_ENUM_VALUES = "x-enumValues"; static final String X_MEDIA_IS_JSON = "x-mediaIsJson"; + static final String X_MEDIA_IS_WILDCARD = "x-mediaIsWildcard"; static final String X_MIME_TYPES = "x-mimeTypes"; static final String X_OPERATION_TYPE = "x-operationType"; static final String X_PARAM_NAME_TYPE = "x-paramNameType"; @@ -87,6 +91,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC static final String X_STRICT_FIELDS = "x-strictFields"; static final String X_UNKNOWN_MIME_TYPES = "x-unknownMimeTypes"; static final String X_USE_MONAD_LOGGER = "x-useMonadLogger"; + static final String X_ALLOW_NONUNIQUE_OPERATION_IDS = "x-allowNonUniqueOperationIds"; static final String X_NEWTYPE = "x-newtype"; static final String X_ENUM = "x-enum"; @@ -96,6 +101,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC protected Map> modelMimeTypes = new HashMap<>(); protected Map knownMimeDataTypes = new HashMap<>(); protected Set typeNames = new HashSet(); + protected Set modelTypeNames = new HashSet(); public CodegenType getTag() { return CodegenType.CLIENT; @@ -128,8 +134,8 @@ public HaskellHttpClientCodegen() { outputFolder = "generated-code/haskell-http-client"; embeddedTemplateDir = templateDir = "haskell-http-client"; - apiPackage = "API"; - modelPackage = "Model"; + //apiPackage = "API"; + //modelPackage = "Model"; // Haskell keywords and reserved function names, taken mostly from https://wiki.haskell.org/Keywords setReservedWordsLowerCase( @@ -217,6 +223,7 @@ public HaskellHttpClientCodegen() { cliOptions.add(CliOption.newBoolean(PROP_ALLOW_FROMJSON_NULLS, "allow JSON Null during model decoding from JSON").defaultValue(Boolean.TRUE.toString())); cliOptions.add(CliOption.newBoolean(PROP_ALLOW_TOJSON_NULLS, "allow emitting JSON Null during model encoding to JSON").defaultValue(Boolean.FALSE.toString())); + cliOptions.add(CliOption.newBoolean(PROP_ALLOW_NONUNIQUE_OPERATION_IDS, "allow different API modules to contain the same operationId. Each API must be imported qualified").defaultValue(Boolean.FALSE.toString())); cliOptions.add(CliOption.newBoolean(PROP_GENERATE_LENSES, "Generate Lens optics for Models").defaultValue(Boolean.TRUE.toString())); cliOptions.add(CliOption.newBoolean(PROP_GENERATE_MODEL_CONSTRUCTORS, "Generate smart constructors (only supply required fields) for models").defaultValue(Boolean.TRUE.toString())); cliOptions.add(CliOption.newBoolean(PROP_GENERATE_ENUMS, "Generate specific datatypes for swagger enums").defaultValue(Boolean.TRUE.toString())); @@ -235,6 +242,10 @@ public HaskellHttpClientCodegen() { } + public void setAllowNonUniqueOperationIds(Boolean value) { + additionalProperties.put(X_ALLOW_NONUNIQUE_OPERATION_IDS, value); + this.allowNonUniqueOperationIds = value; + } public void setAllowFromJsonNulls(Boolean value) { additionalProperties.put(PROP_ALLOW_FROMJSON_NULLS, value); } @@ -317,6 +328,12 @@ public void processOpts() { setAllowToJsonNulls(false); } + if (additionalProperties.containsKey(PROP_ALLOW_NONUNIQUE_OPERATION_IDS)) { + setAllowNonUniqueOperationIds(convertPropertyToBoolean(PROP_ALLOW_NONUNIQUE_OPERATION_IDS)); + } else { + setAllowNonUniqueOperationIds(false); + } + if (additionalProperties.containsKey(PROP_GENERATE_MODEL_CONSTRUCTORS)) { setGenerateModelConstructors(convertPropertyToBoolean(PROP_GENERATE_MODEL_CONSTRUCTORS)); } else { @@ -408,7 +425,7 @@ public void preprocessSwagger(Swagger swagger) { for (String word : words) { wordsCaps.add(firstLetterToUpper(word)); } - String apiName = StringUtils.join(wordsCaps, ""); + apiPackage = StringUtils.join(wordsCaps, ""); // Set the filenames to write for the API @@ -417,31 +434,34 @@ public void preprocessSwagger(Swagger swagger) { supportingFiles.add(new SupportingFile("swagger.mustache", "", "swagger.yaml")); // lib - supportingFiles.add(new SupportingFile("TopLevel.mustache", "lib/", apiName + ".hs")); - supportingFiles.add(new SupportingFile("Client.mustache", "lib/" + apiName, "Client.hs")); + supportingFiles.add(new SupportingFile("TopLevel.mustache", sourceFolder + File.separator, apiPackage + ".hs")); + supportingFiles.add(new SupportingFile("Client.mustache", sourceFolder + File.separator + apiPackage, "Client.hs")); - supportingFiles.add(new SupportingFile("API.mustache", "lib/" + apiName, "API.hs")); - supportingFiles.add(new SupportingFile("Core.mustache", "lib/" + apiName, "Core.hs")); - supportingFiles.add(new SupportingFile("Model.mustache", "lib/" + apiName, "Model.hs")); - supportingFiles.add(new SupportingFile("MimeTypes.mustache", "lib/" + apiName, "MimeTypes.hs")); + + if(!allowNonUniqueOperationIds) { + supportingFiles.add(new SupportingFile("APIS.mustache", sourceFolder + File.separator + apiPackage, "API.hs")); + } + supportingFiles.add(new SupportingFile("Core.mustache", sourceFolder + File.separator + apiPackage, "Core.hs")); + supportingFiles.add(new SupportingFile("Model.mustache", sourceFolder + File.separator + apiPackage, "Model.hs")); + supportingFiles.add(new SupportingFile("MimeTypes.mustache", sourceFolder + File.separator + apiPackage, "MimeTypes.hs")); // logger - supportingFiles.add(new SupportingFile(useMonadLogger ? "LoggingMonadLogger.mustache" : "LoggingKatip.mustache", "lib/" + apiName, "Logging.hs")); + supportingFiles.add(new SupportingFile(useMonadLogger ? "LoggingMonadLogger.mustache" : "LoggingKatip.mustache", sourceFolder + File.separator + apiPackage, "Logging.hs")); - // modelTemplateFiles.put("API.mustache", ".hs"); - // apiTemplateFiles.put("Model.mustache", ".hs"); + apiTemplateFiles.put("API.mustache", ".hs"); + // modelTemplateFiles.put("Model.mustache", ".hs"); // lens if ((boolean)additionalProperties.get(PROP_GENERATE_LENSES)) { - supportingFiles.add(new SupportingFile("ModelLens.mustache", "lib/" + apiName, "ModelLens.hs")); + supportingFiles.add(new SupportingFile("ModelLens.mustache", sourceFolder + File.separator + apiPackage, "ModelLens.hs")); } - additionalProperties.put("title", apiName); - additionalProperties.put("titleLower", firstLetterToLower(apiName)); + additionalProperties.put("title", apiPackage); + additionalProperties.put("titleLower", firstLetterToLower(apiPackage)); additionalProperties.put("package", cabalName); additionalProperties.put("pathsName", pathsName); - additionalProperties.put("requestType", apiName + "Request"); - additionalProperties.put("configType", apiName + "Config"); + additionalProperties.put("requestType", apiPackage + "Request"); + additionalProperties.put("configType", apiPackage + "Config"); additionalProperties.put("swaggerVersion", swagger.getSwagger()); super.preprocessSwagger(swagger); @@ -508,9 +528,41 @@ public String toInstantiationType(Property p) { return null; } } + @Override - public CodegenOperation fromOperation(String resourcePath, String httpMethod, Operation operation, Map definitions, Swagger swagger) { - CodegenOperation op = super.fromOperation(resourcePath, httpMethod, operation, definitions, swagger); + public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation op, Map> operations) { + + List opList = operations.get(tag); + if (opList == null) { + opList = new ArrayList(); + operations.put(tag, opList); + } + // check for operationId uniqueness + String uniqueName = op.operationId; + String uniqueNameType = toTypeName("Op", uniqueName); + int counter = 0; + + HashSet opIds = new HashSet<>(); + for (CodegenOperation o : opList) { + opIds.add(o.operationId); + } + while (opIds.contains(uniqueName) || + (allowNonUniqueOperationIds + ? modelTypeNames.contains(uniqueNameType) // only check for model conflicts + : typeNames.contains(uniqueNameType))) { // check globally across all types + uniqueName = op.operationId + counter; + uniqueNameType = toTypeName("Op", uniqueName); + counter++; + } + if (!op.operationId.equals(uniqueName)) { + LOGGER.warn("generated unique operationId `" + uniqueName + "`"); + } + op.operationId = uniqueName; + op.operationIdLowerCase = uniqueName.toLowerCase(); + op.operationIdCamelCase = DefaultCodegen.camelize(uniqueName); + op.operationIdSnakeCase = DefaultCodegen.underscore(uniqueName); + opList.add(op); + op.baseName = tag; // prevent aliasing/sharing of operation.vendorExtensions reference op.vendorExtensions = new LinkedHashMap(); @@ -539,7 +591,7 @@ public CodegenOperation fromOperation(String resourcePath, String httpMethod, Op String dataType = genEnums && param.isEnum ? param.datatypeWithEnum : param.dataType; - String paramNameType = toDedupedName(toTypeName("Param", param.paramName), dataType, !param.isEnum); + String paramNameType = toDedupedModelName(toTypeName("Param", param.paramName), dataType, !param.isEnum); param.vendorExtensions.put(X_PARAM_NAME_TYPE, paramNameType); HashMap props = new HashMap<>(); @@ -554,7 +606,6 @@ public CodegenOperation fromOperation(String resourcePath, String httpMethod, Op processReturnType(op); - return op; } @Override @@ -647,6 +698,7 @@ public CodegenModel fromModel(String name, Model mod, Map allDefi model.classname = generateNextName(model.classname); } typeNames.add(model.classname); + modelTypeNames.add(model.classname); // From the model name, compute the prefix for the fields. String prefix = StringUtils.uncapitalize(model.classname); @@ -721,7 +773,7 @@ private void processProducesConsumes(CodegenOperation op) { } if (op.hasProduces) { for (Map m : op.produces) { - processMediaType(op,m); + processMediaType(op, m); processInlineProducesContentType(op, m); } } @@ -753,7 +805,7 @@ private void SetNoContent(CodegenOperation op, String inlineExtentionName) { op.vendorExtensions.put(inlineExtentionName, m); } - private String toDedupedName(String paramNameType, String dataType, Boolean appendDataType) { + private String toDedupedModelName(String paramNameType, String dataType, Boolean appendDataType) { if (appendDataType && uniqueParamNameTypes.containsKey(paramNameType) && !isDuplicate(paramNameType, dataType)) { @@ -768,6 +820,7 @@ private String toDedupedName(String paramNameType, String dataType, Boolean appe } typeNames.add(paramNameType); + modelTypeNames.add(paramNameType); return paramNameType; } @@ -842,7 +895,9 @@ private void processMediaType(CodegenOperation op, Map m) { if (isJsonMimeType(mediaType)) { m.put(X_MEDIA_IS_JSON, "true"); } - + if (isWildcardMimeType(mediaType)) { + m.put(X_MEDIA_IS_WILDCARD, "true"); + } if (!knownMimeDataTypes.containsValue(mimeType) && !unknownMimeTypesContainsType(mimeType)) { unknownMimeTypes.add(m); } @@ -968,6 +1023,20 @@ public String toModelName(String name) { public String toModelFilename(String name) { return toTypeName("Model", name); } + public String toApiName(String name) { + if (name.length() == 0) { + return "Default"; + } + return toTypeName("Api", name); + } + @Override + public String toApiFilename(String name) { + return toTypeName("Api", name); + } + @Override + public String apiFileFolder() { + return outputFolder + File.separator + sourceFolder + File.separator + apiPackage().replace('.', File.separatorChar) + File.separator + "API"; + } public String toTypeName(String prefix, String name) { name = escapeIdentifier(prefix, camelize(sanitizeName(name))); return name; @@ -978,17 +1047,7 @@ public String toOperationId(String operationId) { throw new RuntimeException("Empty method/operation name (operationId) not allowed"); } operationId = escapeIdentifier("op",camelize(sanitizeName(operationId), true)); - String uniqueName = operationId; - String uniqueNameType = toTypeName("Op", operationId); - while (typeNames.contains(uniqueNameType)) { - uniqueName = generateNextName(uniqueName); - uniqueNameType = toTypeName("Op", uniqueName); - } - typeNames.add(uniqueNameType); - if(!operationId.equals(uniqueName)) { - LOGGER.warn("generated unique operationId `" + uniqueName + "`"); - } - return uniqueName; + return operationId; } public String escapeIdentifier(String prefix, String name) { if(StringUtils.isBlank(prefix)) return name; @@ -1011,6 +1070,10 @@ static boolean isJsonMimeType(String mime) { return mime != null && JSON_MIME_PATTERN.matcher(mime).matches(); } + static boolean isWildcardMimeType(String mime) { + return mime != null && mime.equals("*/*"); + } + @Override public String toDefaultValue(Property p) { if (p instanceof StringProperty) { @@ -1100,7 +1163,7 @@ public String toEnumName(CodegenProperty var) { if (duplicateEnum.getLeft()) { paramNameType = duplicateEnum.getRight(); } else { - paramNameType = toDedupedName(paramNameType, enumValues, false); + paramNameType = toDedupedModelName(paramNameType, enumValues, false); var.datatypeWithEnum = paramNameType; updateCodegenPropertyEnum(var); addEnumToUniques(paramNameType, var.datatype, enumValues, var.allowableValues, var.description); diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/API.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/API.mustache index d86611826c7..2048ac89fe2 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/API.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/API.mustache @@ -1,22 +1,16 @@ {{>partial_header}} {-| -Module : {{title}}.API +Module : {{title}}.API.{{classname}} -} -{-# LANGUAGE ConstraintKinds #-} -{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE InstanceSigs #-} +{-# LANGUAGE MonoLocalBinds #-} {-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} -module {{title}}.API where +module {{title}}.API.{{classname}} where import {{title}}.Core import {{title}}.MimeTypes @@ -24,8 +18,6 @@ import {{title}}.Model as M import qualified Data.Aeson as A import qualified Data.ByteString as B -import qualified Data.ByteString.Base64 as B64 -import qualified Data.ByteString.Char8 as BC import qualified Data.ByteString.Lazy as BL import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) import qualified Data.Foldable as P @@ -39,16 +31,12 @@ import qualified Data.Text.Encoding as T import qualified Data.Text.Lazy as TL import qualified Data.Text.Lazy.Encoding as TL import qualified Data.Time as TI -import qualified GHC.Base as P (Alternative) -import qualified Lens.Micro as L import qualified Network.HTTP.Client.MultipartFormData as NH import qualified Network.HTTP.Media as ME import qualified Network.HTTP.Types as NH import qualified Web.FormUrlEncoded as WH import qualified Web.HttpApiData as WH -import Data.Monoid ((<>)) -import Data.Function ((&)) import Data.Text (Text) import GHC.Base ((<|>)) @@ -56,7 +44,7 @@ import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Dou import qualified Prelude as P -- * Operations -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{#vendorExtensions.x-hasNewTag}} +{{#operations}}{{#operation}}{{#vendorExtensions.x-hasNewTag}} -- ** {{baseName}}{{/vendorExtensions.x-hasNewTag}} @@ -100,75 +88,11 @@ instance HasOptionalParam {{{vendorExtensions.x-operationType}}} {{{vendorExtens applyOptionalParam req ({{{vendorExtensions.x-paramNameType}}} xs) = {{#isHeaderParam}}req `setHeader` {{>_headerColl}} ("{{{baseName}}}", xs){{/isHeaderParam}}{{#isQueryParam}}req `setQuery` {{>_queryColl}} ("{{{baseName}}}", Just xs){{/isQueryParam}}{{#isFormParam}}{{#isFile}}req `_addMultiFormPart` NH.partFileSource "{{{baseName}}}" xs{{/isFile}}{{^isFile}}{{#isMultipart}}req `_addMultiFormPart` NH.partLBS "{{{baseName}}}" (mimeRender' MimeMultipartFormData xs){{/isMultipart}}{{^isMultipart}}req `addForm` {{>_formColl}} ("{{{baseName}}}", xs){{/isMultipart}}{{/isFile}}{{/isFormParam}}{{/required}}{{/isBodyParam}}{{/allParams}}{{/vendorExtensions.x-hasOptionalParams}}{{#hasConsumes}} -{{#consumes}}-- | @{{{mediaType}}}@ -instance Consumes {{{vendorExtensions.x-operationType}}} {{{x-mediaDataType}}} +{{#consumes}}-- | @{{{mediaType}}}@{{^x-mediaIsWildcard}} +instance Consumes {{{vendorExtensions.x-operationType}}} {{{x-mediaDataType}}}{{/x-mediaIsWildcard}}{{#x-mediaIsWildcard}} +instance MimeType mtype => Consumes {{{vendorExtensions.x-operationType}}} mtype{{/x-mediaIsWildcard}} {{/consumes}}{{/hasConsumes}}{{#hasProduces}} -{{#produces}}-- | @{{{mediaType}}}@ -instance Produces {{{vendorExtensions.x-operationType}}} {{{x-mediaDataType}}} -{{/produces}}{{/hasProduces}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - - --- * Parameter newtypes -{{#x-allUniqueParams}}{{#x-newtype}} -newtype {{{x-paramNameType}}} = {{{x-paramNameType}}} { un{{{x-paramNameType}}} :: {{{x-dataType}}} } deriving (P.Eq, P.Show{{#x-isBodyParam}}, A.ToJSON{{/x-isBodyParam}}){{/x-newtype}}{{/x-allUniqueParams}} - -{{#authMethods}}{{#-first}}-- * Auth Methods - -{{/-first}}{{#isBasic}}-- ** {{name}} -data {{name}} = - {{name}} B.ByteString B.ByteString -- ^ username password - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod {{name}} where - applyAuthMethod _ a@({{name}} user pw) req = - P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ]) - -{{/isBasic}}{{#isApiKey}}-- ** {{name}} -data {{name}} = - {{name}} Text -- ^ secret - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod {{name}} where - applyAuthMethod _ a@({{name}} secret) req = - P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req {{#isKeyInHeader}}`setHeader` toHeader ("{{keyParamName}}", secret){{/isKeyInHeader}}{{^isKeyInHeader}}`setQuery` toQuery ("{{keyParamName}}", Just secret){{/isKeyInHeader}} - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - -{{/isApiKey}}{{#isOAuth}}-- ** {{name}} -data {{name}} = - {{name}} Text -- ^ secret - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod {{name}} where - applyAuthMethod _ a@({{name}} secret) req = - P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - -{{/isOAuth}}{{/authMethods}} - -{{#x-hasUnknownMimeTypes}} --- * Custom Mime Types - -{{#x-unknownMimeTypes}}-- ** {{{x-mediaDataType}}} - -data {{{x-mediaDataType}}} = {{{x-mediaDataType}}} deriving (P.Typeable) - --- | @{{{mediaType}}}@ -instance MimeType {{{x-mediaDataType}}} where - mimeType _ = Just $ P.fromString "{{{mediaType}}}"{{#x-mediaIsJson}} -instance A.ToJSON a => MimeRender {{{x-mediaDataType}}} a where mimeRender _ = A.encode -instance A.FromJSON a => MimeUnrender {{{x-mediaDataType}}} a where mimeUnrender _ = A.eitherDecode{{/x-mediaIsJson}} --- instance MimeRender {{{x-mediaDataType}}} T.Text where mimeRender _ = undefined --- instance MimeUnrender {{{x-mediaDataType}}} T.Text where mimeUnrender _ = undefined - -{{/x-unknownMimeTypes}}{{/x-hasUnknownMimeTypes}} +{{#produces}}-- | @{{{mediaType}}}@{{^x-mediaIsWildcard}} +instance Produces {{{vendorExtensions.x-operationType}}} {{{x-mediaDataType}}}{{/x-mediaIsWildcard}}{{#x-mediaIsWildcard}} +instance MimeType mtype => Produces {{{vendorExtensions.x-operationType}}} mtype{{/x-mediaIsWildcard}} +{{/produces}}{{/hasProduces}}{{/operation}}{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/APIS.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/APIS.mustache new file mode 100644 index 00000000000..65d5d45ba67 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/APIS.mustache @@ -0,0 +1,10 @@ +{{>partial_header}} +{-| +Module : {{title}}.API +-} + +module {{title}}.API + ( {{#apiInfo}}{{#apis}}module {{title}}.API.{{classname}} + {{#hasMore}}, {{/hasMore}}{{/apis}}{{/apiInfo}}) where +{{#apiInfo}}{{#apis}} +import {{title}}.API.{{classname}}{{/apis}}{{/apiInfo}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/MimeTypes.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/MimeTypes.mustache index 072a8634c8d..b0652932dc5 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/MimeTypes.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/MimeTypes.mustache @@ -190,3 +190,21 @@ instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BC -- | @P.Right . P.const NoContent@ instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent + + +{{#x-hasUnknownMimeTypes}} +-- * Custom Mime Types + +{{#x-unknownMimeTypes}}-- ** {{{x-mediaDataType}}} + +data {{{x-mediaDataType}}} = {{{x-mediaDataType}}} deriving (P.Typeable) + +-- | @{{{mediaType}}}@ +instance MimeType {{{x-mediaDataType}}} where + mimeType _ = Just $ P.fromString "{{{mediaType}}}"{{#x-mediaIsJson}} +instance A.ToJSON a => MimeRender {{{x-mediaDataType}}} a where mimeRender _ = A.encode +instance A.FromJSON a => MimeUnrender {{{x-mediaDataType}}} a where mimeUnrender _ = A.eitherDecode{{/x-mediaIsJson}} +-- instance MimeRender {{{x-mediaDataType}}} T.Text where mimeRender _ = undefined +-- instance MimeUnrender {{{x-mediaDataType}}} T.Text where mimeUnrender _ = undefined + +{{/x-unknownMimeTypes}}{{/x-hasUnknownMimeTypes}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/Model.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/Model.mustache index 3613d9588d1..5d249c1efb4 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/Model.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/Model.mustache @@ -27,8 +27,10 @@ import Data.Aeson ((.:),(.:!),(.:?),(.=)) import qualified Control.Arrow as P (left) import qualified Data.Aeson as A import qualified Data.ByteString as B +import qualified Data.ByteString.Base64 as B64 +import qualified Data.ByteString.Char8 as BC import qualified Data.ByteString.Lazy as BL -import qualified Data.Data as P (Data, Typeable) +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) import qualified Data.Foldable as P import qualified Data.HashMap.Lazy as HM import qualified Data.Map as Map @@ -37,13 +39,16 @@ import qualified Data.Set as Set import qualified Data.Text as T import qualified Data.Text.Encoding as T import qualified Data.Time as TI +import qualified Lens.Micro as L import qualified Web.FormUrlEncoded as WH import qualified Web.HttpApiData as WH import Control.Applicative ((<|>)) import Control.Applicative (Alternative) +import Data.Function ((&)) +import Data.Monoid ((<>)) import Data.Text (Text) -import Prelude (($), (.),(<$>),(<*>),(>>=),(=<<),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import Prelude (($),(/=),(.),(<$>),(<*>),(>>=),(=<<),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) import qualified Prelude as P @@ -51,6 +56,12 @@ import qualified Prelude as P {{#imports}}import {{import}} {{/imports}} +-- * Parameter newtypes +{{#x-allUniqueParams}}{{#x-newtype}} + +-- ** {{{x-paramNameType}}} +newtype {{{x-paramNameType}}} = {{{x-paramNameType}}} { un{{{x-paramNameType}}} :: {{{x-dataType}}} } deriving (P.Eq, P.Show{{#x-isBodyParam}}, A.ToJSON{{/x-isBodyParam}}){{/x-newtype}}{{/x-allUniqueParams}} + -- * Models {{#models}} @@ -139,4 +150,48 @@ to{{{x-paramNameType}}} :: {{{x-dataType}}} -> P.Either String {{{x-paramNameTyp to{{{x-paramNameType}}} = \case{{#allowableValues}}{{#enumVars}} {{{value}}} -> P.Right {{{name}}}{{/enumVars}}{{/allowableValues}} s -> P.Left $ "to{{{x-paramNameType}}}: enum parse failure: " P.++ P.show s -{{/x-enum}}{{/x-allUniqueParams}}{{/x-hasEnumSection}} \ No newline at end of file +{{/x-enum}}{{/x-allUniqueParams}}{{/x-hasEnumSection}} + +{{#authMethods}}{{#-first}}-- * Auth Methods + +{{/-first}}{{#isBasic}}-- ** {{name}} +data {{name}} = + {{name}} B.ByteString B.ByteString -- ^ username password + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod {{name}} where + applyAuthMethod _ a@({{name}} user pw) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ]) + +{{/isBasic}}{{#isApiKey}}-- ** {{name}} +data {{name}} = + {{name}} Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod {{name}} where + applyAuthMethod _ a@({{name}} secret) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req {{#isKeyInHeader}}`setHeader` toHeader ("{{keyParamName}}", secret){{/isKeyInHeader}}{{^isKeyInHeader}}`setQuery` toQuery ("{{keyParamName}}", Just secret){{/isKeyInHeader}} + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + +{{/isApiKey}}{{#isOAuth}}-- ** {{name}} +data {{name}} = + {{name}} Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod {{name}} where + applyAuthMethod _ a@({{name}} secret) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + +{{/isOAuth}}{{/authMethods}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/README.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/README.mustache index fbfe6a20c45..c25c548fe6d 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/README.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/README.mustache @@ -58,6 +58,7 @@ These options allow some customization of the code generation process. | OPTION | DESCRIPTION | DEFAULT | ACTUAL | | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------- | +| allowNonUniqueOperationIds | allow *different* API modules to contain the same operationId. Each API must be imported qualified | false | {{{x-allowNonUniqueOperationIds}}} | | allowFromJsonNulls | allow JSON Null during model decoding from JSON | true | {{{allowFromJsonNulls}}} | | allowToJsonNulls | allow emitting JSON Null during model encoding to JSON | false | {{{allowToJsonNulls}}} | | dateFormat | format string used to parse/render a date | %Y-%m-%d | {{{dateFormat}}} | diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/TopLevel.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/TopLevel.mustache index 485b41c504c..b3c2e3bdf93 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/TopLevel.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/TopLevel.mustache @@ -4,8 +4,8 @@ Module : {{title}} -} module {{title}} - ( module {{title}}.API - , module {{title}}.Client + ( {{^x-allowNonUniqueOperationIds}} module {{title}}.API + ,{{/x-allowNonUniqueOperationIds}} module {{title}}.Client , module {{title}}.Core , module {{title}}.Logging , module {{title}}.MimeTypes @@ -13,10 +13,10 @@ module {{title}} , module {{title}}.ModelLens ) where -import {{title}}.API +{{^x-allowNonUniqueOperationIds}}import {{title}}.API{{/x-allowNonUniqueOperationIds}} import {{title}}.Client import {{title}}.Core import {{title}}.Logging import {{title}}.MimeTypes import {{title}}.Model -import {{title}}.ModelLens +import {{title}}.ModelLens \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/haskell-http-client.cabal.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/haskell-http-client.cabal.mustache index 2b0b517b845..cb911bec7dd 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/haskell-http-client.cabal.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/haskell-http-client.cabal.mustache @@ -36,34 +36,35 @@ library lib ghc-options: -Wall -funbox-strict-fields build-depends: - base >=4.7 && <5.0 - , transformers >=0.4.0.0 - , mtl >=2.2.1 - , unordered-containers - , aeson >=1.0 && <2.0 - , bytestring >=0.10.0 && <0.11 + aeson >=1.0 && <2.0 + , base >=4.7 && <5.0 , base64-bytestring >1.0 && <2.0 + , bytestring >=0.10.0 && <0.11 + , case-insensitive , containers >=0.5.0.0 && <0.6 - , http-types >=0.8 && <0.11 + , deepseq >= 1.4 && <1.6 + , exceptions >= 0.4 + , http-api-data >= 0.3.4 && <0.4 , http-client >=0.5 && <0.6 , http-client-tls - , http-api-data >= 0.3.4 && <0.4 , http-media >= 0.4 && < 0.8 - , text >=0.11 && <1.3 - , time >=1.5 && <1.9 + , http-types >=0.8 && <0.12 , iso8601-time >=0.1.3 && <0.2.0 - , vector >=0.10.9 && <0.13 + , microlens >= 0.4.3 && <0.5 + , mtl >=2.2.1 , network >=2.6.2 && <2.7 , random >=1.1 - , exceptions >= 0.4 - , {{^x-useMonadLogger}}katip >=0.4 && < 0.6{{/x-useMonadLogger}}{{#x-useMonadLogger}}monad-logger >=0.3 && <0.4{{/x-useMonadLogger}} , safe-exceptions <0.2 - , case-insensitive - , microlens >= 0.4.3 && <0.5 - , deepseq >= 1.4 && <1.6 + , text >=0.11 && <1.3 + , time >=1.5 && <1.9 + , transformers >=0.4.0.0 + , unordered-containers + , vector >=0.10.9 && <0.13 + , {{^x-useMonadLogger}}katip >=0.4 && < 0.6{{/x-useMonadLogger}}{{#x-useMonadLogger}}monad-logger >=0.3 && <0.4{{/x-useMonadLogger}} exposed-modules: - {{title}} - {{title}}.API + {{title}}{{^x-allowNonUniqueOperationIds}} + {{title}}.API{{/x-allowNonUniqueOperationIds}}{{#apiInfo}}{{#apis}} + {{title}}.API.{{classname}}{{/apis}}{{/apiInfo}} {{title}}.Client {{title}}.Core {{title}}.Logging @@ -81,21 +82,21 @@ test-suite tests tests ghc-options: -Wall -fno-warn-orphans build-depends: - base >=4.7 && <5.0 - , transformers >=0.4.0.0 - , mtl >=2.2.1 - , unordered-containers - , {{package}} + {{package}} + , QuickCheck + , aeson + , base >=4.7 && <5.0 , bytestring >=0.10.0 && <0.11 , containers , hspec >=1.8 + , iso8601-time + , mtl >=2.2.1 + , semigroups , text , time - , iso8601-time - , aeson + , transformers >=0.4.0.0 + , unordered-containers , vector - , semigroups - , QuickCheck other-modules: ApproxEq Instances diff --git a/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Test.mustache b/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Test.mustache index bc82ad90638..cfa211d3ae7 100644 --- a/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Test.mustache +++ b/modules/swagger-codegen/src/main/resources/haskell-http-client/tests/Test.mustache @@ -17,7 +17,7 @@ import {{title}}.MimeTypes main :: IO () main = - hspec $ modifyMaxSize (const 10) $ do + hspec $ modifyMaxSize (const 5) $ do describe "JSON instances" $ do pure () {{#models}}{{#model}}propMimeEq MimeJSON (Proxy :: Proxy {{classname}}) diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/haskellhttpclient/HaskellHttpClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/haskellhttpclient/HaskellHttpClientOptionsTest.java index 050d522229e..3f85fa388e9 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/haskellhttpclient/HaskellHttpClientOptionsTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/haskellhttpclient/HaskellHttpClientOptionsTest.java @@ -30,6 +30,8 @@ protected void setExpectations() { times = 1; clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(HaskellHttpClientOptionsProvider.SORT_PARAMS_VALUE)); times = 1; + clientCodegen.setAllowNonUniqueOperationIds(Boolean.valueOf(HaskellHttpClientOptionsProvider.ALLOW_NONUNIQUE_OPERATION_IDS)); + times = 1; clientCodegen.setAllowFromJsonNulls(Boolean.valueOf(HaskellHttpClientOptionsProvider.ALLOW_FROMJSON_NULLS)); times = 1; clientCodegen.setAllowToJsonNulls(Boolean.valueOf(HaskellHttpClientOptionsProvider.ALLOW_TOJSON_NULLS)); diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/HaskellHttpClientOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/HaskellHttpClientOptionsProvider.java index 6a6af94a9ea..0700349477a 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/HaskellHttpClientOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/HaskellHttpClientOptionsProvider.java @@ -14,6 +14,7 @@ public class HaskellHttpClientOptionsProvider implements OptionsProvider { public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String HIDE_GENERATION_TIMESTAMP = "true"; + public static final String ALLOW_NONUNIQUE_OPERATION_IDS = "false"; public static final String ALLOW_FROMJSON_NULLS = "true"; public static final String ALLOW_TOJSON_NULLS = "false"; public static final String DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%S%Q%z"; @@ -42,6 +43,7 @@ public Map createOptions() { .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, HIDE_GENERATION_TIMESTAMP) + .put(HaskellHttpClientCodegen.PROP_ALLOW_NONUNIQUE_OPERATION_IDS, ALLOW_NONUNIQUE_OPERATION_IDS) .put(HaskellHttpClientCodegen.PROP_ALLOW_FROMJSON_NULLS, ALLOW_FROMJSON_NULLS) .put(HaskellHttpClientCodegen.PROP_ALLOW_TOJSON_NULLS, ALLOW_TOJSON_NULLS) .put(HaskellHttpClientCodegen.PROP_DATETIME_FORMAT, DATETIME_FORMAT) diff --git a/samples/client/petstore/haskell-http-client/.swagger-codegen/VERSION b/samples/client/petstore/haskell-http-client/.swagger-codegen/VERSION index f9f7450d135..cc6612c36e0 100644 --- a/samples/client/petstore/haskell-http-client/.swagger-codegen/VERSION +++ b/samples/client/petstore/haskell-http-client/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.0 \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/README.md b/samples/client/petstore/haskell-http-client/README.md index 7664d49eab7..85512a541f6 100644 --- a/samples/client/petstore/haskell-http-client/README.md +++ b/samples/client/petstore/haskell-http-client/README.md @@ -58,6 +58,7 @@ These options allow some customization of the code generation process. | OPTION | DESCRIPTION | DEFAULT | ACTUAL | | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------- | +| allowNonUniqueOperationIds | allow *different* API modules to contain the same operationId. Each API must be imported qualified | false | false | | allowFromJsonNulls | allow JSON Null during model decoding from JSON | true | true | | allowToJsonNulls | allow emitting JSON Null during model encoding to JSON | false | false | | dateFormat | format string used to parse/render a date | %Y-%m-%d | %Y-%m-%d | diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-AnotherFake.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-AnotherFake.html new file mode 100644 index 00000000000..7763cb96b28 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-AnotherFake.html @@ -0,0 +1,4 @@ +SwaggerPetstore.API.AnotherFake

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.API.AnotherFake

Description

 

Synopsis

Operations

AnotherFake

testSpecialTags

testSpecialTags Source #

Arguments

:: (Consumes TestSpecialTags contentType, MimeRender contentType Client) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestSpecialTags contentType Client accept 
PATCH /another-fake/dummy

To test special tags

To test special tags

data TestSpecialTags Source #

Instances

Produces TestSpecialTags MimeJSON Source #
application/json
Consumes TestSpecialTags MimeJSON Source #
application/json
HasBodyParam TestSpecialTags Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestSpecialTags contentType res accept -> Client -> SwaggerPetstoreRequest TestSpecialTags contentType res accept Source #

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-Fake.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-Fake.html new file mode 100644 index 00000000000..fbf388e823c --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-Fake.html @@ -0,0 +1,4 @@ +SwaggerPetstore.API.Fake

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.API.Fake

Description

 

Synopsis

Operations

Fake

fakeOuterBooleanSerialize

fakeOuterBooleanSerialize Source #

Arguments

:: Consumes FakeOuterBooleanSerialize contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> SwaggerPetstoreRequest FakeOuterBooleanSerialize contentType OuterBoolean accept 
POST /fake/outer/boolean

Test serialization of outer boolean types

fakeOuterCompositeSerialize

fakeOuterCompositeSerialize Source #

Arguments

:: Consumes FakeOuterCompositeSerialize contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> SwaggerPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite accept 
POST /fake/outer/composite

Test serialization of object with outer number type

fakeOuterNumberSerialize

fakeOuterNumberSerialize Source #

Arguments

:: Consumes FakeOuterNumberSerialize contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> SwaggerPetstoreRequest FakeOuterNumberSerialize contentType OuterNumber accept 
POST /fake/outer/number

Test serialization of outer number types

fakeOuterStringSerialize

fakeOuterStringSerialize Source #

Arguments

:: Consumes FakeOuterStringSerialize contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> SwaggerPetstoreRequest FakeOuterStringSerialize contentType OuterString accept 
POST /fake/outer/string

Test serialization of outer string types

testClientModel

testClientModel Source #

Arguments

:: (Consumes TestClientModel contentType, MimeRender contentType Client) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClientModel contentType Client accept 
PATCH /fake

To test "client" model

To test "client" model

data TestClientModel Source #

Instances

Produces TestClientModel MimeJSON Source #
application/json
Consumes TestClientModel MimeJSON Source #
application/json
HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestClientModel contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestClientModel contentType res accept -> Client -> SwaggerPetstoreRequest TestClientModel contentType res accept Source #

testEndpointParameters

testEndpointParameters Source #

Arguments

:: Consumes TestEndpointParameters contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Number

"number" - None

-> ParamDouble

"double" - None

-> PatternWithoutDelimiter

"patternWithoutDelimiter" - None

-> Byte

"byte" - None

-> SwaggerPetstoreRequest TestEndpointParameters contentType res accept 
POST /fake

Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트

Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트

AuthMethod: AuthBasicHttpBasicTest

Note: Has Produces instances, but no response schema

data TestEndpointParameters Source #

Instances

Produces TestEndpointParameters MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Produces TestEndpointParameters MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
Consumes TestEndpointParameters MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Consumes TestEndpointParameters MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - None

HasOptionalParam TestEndpointParameters ParamString Source #

Optional Param "string" - None

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

HasOptionalParam TestEndpointParameters ParamDateTime Source #

Optional Param "dateTime" - None

HasOptionalParam TestEndpointParameters ParamDate Source #

Optional Param "date" - None

HasOptionalParam TestEndpointParameters ParamBinary Source #

Optional Param "binary" - None

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

testEnumParameters

testEnumParameters Source #

Arguments

:: Consumes TestEnumParameters contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> SwaggerPetstoreRequest TestEnumParameters contentType res accept 
GET /fake

To test enum parameters

To test enum parameters

Note: Has Produces instances, but no response schema

data TestEnumParameters Source #

Instances

MimeType mtype => Produces TestEnumParameters mtype Source #
*/*
MimeType mtype => Consumes TestEnumParameters mtype Source #
*/*
HasOptionalParam TestEnumParameters EnumQueryStringArray Source #

Optional Param "enum_query_string_array" - Query parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumQueryString Source #

Optional Param "enum_query_string" - Query parameter enum test (string)

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

Optional Param "enum_query_integer" - Query parameter enum test (double)

HasOptionalParam TestEnumParameters EnumQueryDouble Source #

Optional Param "enum_query_double" - Query parameter enum test (double)

HasOptionalParam TestEnumParameters EnumHeaderStringArray Source #

Optional Param "enum_header_string_array" - Header parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumHeaderString Source #

Optional Param "enum_header_string" - Header parameter enum test (string)

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

Optional Param "enum_form_string_array" - Form parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumFormString Source #

Optional Param "enum_form_string" - Form parameter enum test (string)

testInlineAdditionalProperties

testInlineAdditionalProperties Source #

Arguments

:: (Consumes TestInlineAdditionalProperties contentType, MimeRender contentType Value) 
=> ContentType contentType

request content-type (MimeType)

-> Value

"param" - request body

-> SwaggerPetstoreRequest TestInlineAdditionalProperties contentType NoContent MimeNoContent 
POST /fake/inline-additionalProperties

test inline additionalProperties

testJsonFormData

testJsonFormData Source #

Arguments

:: Consumes TestJsonFormData contentType 
=> ContentType contentType

request content-type (MimeType)

-> Param

"param" - field1

-> Param2

"param2" - field2

-> SwaggerPetstoreRequest TestJsonFormData contentType NoContent MimeNoContent 
GET /fake/jsonFormData

test json serialization of form data

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-FakeClassnameTags123.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-FakeClassnameTags123.html new file mode 100644 index 00000000000..fe65b297a43 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-FakeClassnameTags123.html @@ -0,0 +1,4 @@ +SwaggerPetstore.API.FakeClassnameTags123

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.API.FakeClassnameTags123

Description

 

Synopsis

Operations

FakeClassnameTags123

testClassname

testClassname Source #

Arguments

:: (Consumes TestClassname contentType, MimeRender contentType Client) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClassname contentType Client accept 
PATCH /fake_classname_test

To test class name in snake case

AuthMethod: AuthApiKeyApiKeyQuery

data TestClassname Source #

Instances

Produces TestClassname MimeJSON Source #
application/json
Consumes TestClassname MimeJSON Source #
application/json
HasBodyParam TestClassname Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestClassname contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestClassname contentType res accept -> Client -> SwaggerPetstoreRequest TestClassname contentType res accept Source #

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-Pet.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-Pet.html new file mode 100644 index 00000000000..202d9dc05f1 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-Pet.html @@ -0,0 +1,4 @@ +SwaggerPetstore.API.Pet

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.API.Pet

Description

 

Synopsis

Operations

Pet

addPet

addPet Source #

Arguments

:: (Consumes AddPet contentType, MimeRender contentType Pet) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Pet

"body" - Pet object that needs to be added to the store

-> SwaggerPetstoreRequest AddPet contentType res accept 
POST /pet

Add a new pet to the store

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

data AddPet Source #

Instances

Produces AddPet MimeXML Source #
application/xml
Produces AddPet MimeJSON Source #
application/json
Consumes AddPet MimeXML Source #
application/xml
Consumes AddPet MimeJSON Source #
application/json
HasBodyParam AddPet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes AddPet contentType, MimeRender contentType Pet) => SwaggerPetstoreRequest AddPet contentType res accept -> Pet -> SwaggerPetstoreRequest AddPet contentType res accept Source #

deletePet

deletePet Source #

Arguments

:: Accept accept

request accept (MimeType)

-> PetId

"petId" - Pet id to delete

-> SwaggerPetstoreRequest DeletePet MimeNoContent res accept 
DELETE /pet/{petId}

Deletes a pet

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

data DeletePet Source #

Instances

findPetsByStatus

findPetsByStatus Source #

Arguments

:: Accept accept

request accept (MimeType)

-> Status

"status" - Status values that need to be considered for filter

-> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] accept 
GET /pet/findByStatus

Finds Pets by status

Multiple status values can be provided with comma separated strings

AuthMethod: AuthOAuthPetstoreAuth

findPetsByTags

findPetsByTags Source #

Arguments

:: Accept accept

request accept (MimeType)

-> Tags

"tags" - Tags to filter by

-> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept 

Deprecated:

GET /pet/findByTags

Finds Pets by tags

Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

AuthMethod: AuthOAuthPetstoreAuth

getPetById

getPetById Source #

Arguments

:: Accept accept

request accept (MimeType)

-> PetId

"petId" - ID of pet to return

-> SwaggerPetstoreRequest GetPetById MimeNoContent Pet accept 
GET /pet/{petId}

Find pet by ID

Returns a single pet

AuthMethod: AuthApiKeyApiKey

data GetPetById Source #

Instances

updatePet

updatePet Source #

Arguments

:: (Consumes UpdatePet contentType, MimeRender contentType Pet) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Pet

"body" - Pet object that needs to be added to the store

-> SwaggerPetstoreRequest UpdatePet contentType res accept 
PUT /pet

Update an existing pet

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

data UpdatePet Source #

Instances

Produces UpdatePet MimeXML Source #
application/xml
Produces UpdatePet MimeJSON Source #
application/json
Consumes UpdatePet MimeXML Source #
application/xml
Consumes UpdatePet MimeJSON Source #
application/json
HasBodyParam UpdatePet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => SwaggerPetstoreRequest UpdatePet contentType res accept -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res accept Source #

updatePetWithForm

updatePetWithForm Source #

Arguments

:: Consumes UpdatePetWithForm contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> PetId

"petId" - ID of pet that needs to be updated

-> SwaggerPetstoreRequest UpdatePetWithForm contentType res accept 
POST /pet/{petId}

Updates a pet in the store with form data

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

data UpdatePetWithForm Source #

Instances

Produces UpdatePetWithForm MimeXML Source #
application/xml
Produces UpdatePetWithForm MimeJSON Source #
application/json
Consumes UpdatePetWithForm MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
HasOptionalParam UpdatePetWithForm StatusText Source #

Optional Param "status" - Updated status of the pet

HasOptionalParam UpdatePetWithForm Name2 Source #

Optional Param "name" - Updated name of the pet

uploadFile

uploadFile Source #

Arguments

:: Consumes UploadFile contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> PetId

"petId" - ID of pet to update

-> SwaggerPetstoreRequest UploadFile contentType ApiResponse accept 
POST /pet/{petId}/uploadImage

uploads an image

AuthMethod: AuthOAuthPetstoreAuth

data UploadFile Source #

Instances

Produces UploadFile MimeJSON Source #
application/json
Consumes UploadFile MimeMultipartFormData Source #
multipart/form-data
HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

Methods

applyOptionalParam :: SwaggerPetstoreRequest UploadFile contentType res accept -> File -> SwaggerPetstoreRequest UploadFile contentType res accept Source #

(-&-) :: SwaggerPetstoreRequest UploadFile contentType res accept -> File -> SwaggerPetstoreRequest UploadFile contentType res accept Source #

HasOptionalParam UploadFile AdditionalMetadata Source #

Optional Param "additionalMetadata" - Additional data to pass to server

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-Store.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-Store.html new file mode 100644 index 00000000000..b442dd9fc03 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-Store.html @@ -0,0 +1,4 @@ +SwaggerPetstore.API.Store

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.API.Store

Description

 

Operations

Store

deleteOrder

deleteOrder Source #

Arguments

:: Accept accept

request accept (MimeType)

-> OrderIdText

"orderId" - ID of the order that needs to be deleted

-> SwaggerPetstoreRequest DeleteOrder MimeNoContent res accept 
DELETE /store/order/{order_id}

Delete purchase order by ID

For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors

Note: Has Produces instances, but no response schema

data DeleteOrder Source #

Instances

getInventory

getInventory Source #

Arguments

:: Accept accept

request accept (MimeType)

-> SwaggerPetstoreRequest GetInventory MimeNoContent (Map String Int) accept 
GET /store/inventory

Returns pet inventories by status

Returns a map of status codes to quantities

AuthMethod: AuthApiKeyApiKey

data GetInventory Source #

Instances

getOrderById

getOrderById Source #

Arguments

:: Accept accept

request accept (MimeType)

-> OrderId

"orderId" - ID of pet that needs to be fetched

-> SwaggerPetstoreRequest GetOrderById MimeNoContent Order accept 
GET /store/order/{order_id}

Find purchase order by ID

For valid response try integer IDs with value 5 or 10. Other values will generated exceptions

placeOrder

placeOrder Source #

Arguments

:: (Consumes PlaceOrder contentType, MimeRender contentType Order) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Order

"body" - order placed for purchasing the pet

-> SwaggerPetstoreRequest PlaceOrder contentType Order accept 
POST /store/order

Place an order for a pet

data PlaceOrder Source #

Instances

Produces PlaceOrder MimeXML Source #
application/xml
Produces PlaceOrder MimeJSON Source #
application/json
HasBodyParam PlaceOrder Order Source #

Body Param "body" - order placed for purchasing the pet

Methods

setBodyParam :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => SwaggerPetstoreRequest PlaceOrder contentType res accept -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res accept Source #

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-User.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-User.html new file mode 100644 index 00000000000..b7034452693 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API-User.html @@ -0,0 +1,4 @@ +SwaggerPetstore.API.User

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.API.User

Description

 

Operations

User

createUser

createUser Source #

Arguments

:: (Consumes CreateUser contentType, MimeRender contentType User) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> User

"body" - Created user object

-> SwaggerPetstoreRequest CreateUser contentType res accept 
POST /user

Create user

This can only be done by the logged in user.

Note: Has Produces instances, but no response schema

data CreateUser Source #

Instances

Produces CreateUser MimeXML Source #
application/xml
Produces CreateUser MimeJSON Source #
application/json
HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res accept -> User -> SwaggerPetstoreRequest CreateUser contentType res accept Source #

createUsersWithArrayInput

createUsersWithArrayInput Source #

Arguments

:: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Body

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res accept 
POST /user/createWithArray

Creates list of users with given input array

Note: Has Produces instances, but no response schema

createUsersWithListInput

createUsersWithListInput Source #

Arguments

:: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Body

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithListInput contentType res accept 
POST /user/createWithList

Creates list of users with given input array

Note: Has Produces instances, but no response schema

deleteUser

deleteUser Source #

Arguments

:: Accept accept

request accept (MimeType)

-> Username

"username" - The name that needs to be deleted

-> SwaggerPetstoreRequest DeleteUser MimeNoContent res accept 
DELETE /user/{username}

Delete user

This can only be done by the logged in user.

Note: Has Produces instances, but no response schema

data DeleteUser Source #

Instances

getUserByName

getUserByName Source #

Arguments

:: Accept accept

request accept (MimeType)

-> Username

"username" - The name that needs to be fetched. Use user1 for testing.

-> SwaggerPetstoreRequest GetUserByName MimeNoContent User accept 
GET /user/{username}

Get user by user name

loginUser

loginUser Source #

Arguments

:: Accept accept

request accept (MimeType)

-> Username

"username" - The user name for login

-> Password

"password" - The password for login in clear text

-> SwaggerPetstoreRequest LoginUser MimeNoContent Text accept 
GET /user/login

Logs user into the system

data LoginUser Source #

Instances

logoutUser

logoutUser Source #

Arguments

:: Accept accept

request accept (MimeType)

-> SwaggerPetstoreRequest LogoutUser MimeNoContent res accept 
GET /user/logout

Logs out current logged in user session

Note: Has Produces instances, but no response schema

data LogoutUser Source #

Instances

updateUser

updateUser Source #

Arguments

:: (Consumes UpdateUser contentType, MimeRender contentType User) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Username

"username" - name that need to be deleted

-> User

"body" - Updated user object

-> SwaggerPetstoreRequest UpdateUser contentType res accept 
PUT /user/{username}

Updated user

This can only be done by the logged in user.

Note: Has Produces instances, but no response schema

data UpdateUser Source #

Instances

Produces UpdateUser MimeXML Source #
application/xml
Produces UpdateUser MimeJSON Source #
application/json
HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest UpdateUser contentType res accept -> User -> SwaggerPetstoreRequest UpdateUser contentType res accept Source #

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API.html index 86e48a669a9..93d06ff9c7c 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-API.html @@ -1,4 +1,4 @@ SwaggerPetstore.API

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.API

Description

 

Synopsis

Operations

AnotherFake

testSpecialTags

testSpecialTags Source #

Arguments

:: (Consumes TestSpecialTags contentType, MimeRender contentType Client) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestSpecialTags contentType Client accept 
PATCH /another-fake/dummy

To test special tags

To test special tags

data TestSpecialTags Source #

Instances

Produces TestSpecialTags MimeJSON Source #
application/json
Consumes TestSpecialTags MimeJSON Source #
application/json
HasBodyParam TestSpecialTags Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestSpecialTags contentType res accept -> Client -> SwaggerPetstoreRequest TestSpecialTags contentType res accept Source #

Fake

fakeOuterBooleanSerialize

fakeOuterBooleanSerialize Source #

Arguments

:: Consumes FakeOuterBooleanSerialize contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> SwaggerPetstoreRequest FakeOuterBooleanSerialize contentType OuterBoolean accept 
POST /fake/outer/boolean

Test serialization of outer boolean types

fakeOuterCompositeSerialize

fakeOuterCompositeSerialize Source #

Arguments

:: Consumes FakeOuterCompositeSerialize contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> SwaggerPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite accept 
POST /fake/outer/composite

Test serialization of object with outer number type

fakeOuterNumberSerialize

fakeOuterNumberSerialize Source #

Arguments

:: Consumes FakeOuterNumberSerialize contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> SwaggerPetstoreRequest FakeOuterNumberSerialize contentType OuterNumber accept 
POST /fake/outer/number

Test serialization of outer number types

fakeOuterStringSerialize

fakeOuterStringSerialize Source #

Arguments

:: Consumes FakeOuterStringSerialize contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> SwaggerPetstoreRequest FakeOuterStringSerialize contentType OuterString accept 
POST /fake/outer/string

Test serialization of outer string types

testClientModel

testClientModel Source #

Arguments

:: (Consumes TestClientModel contentType, MimeRender contentType Client) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClientModel contentType Client accept 
PATCH /fake

To test "client" model

To test "client" model

data TestClientModel Source #

Instances

Produces TestClientModel MimeJSON Source #
application/json
Consumes TestClientModel MimeJSON Source #
application/json
HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestClientModel contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestClientModel contentType res accept -> Client -> SwaggerPetstoreRequest TestClientModel contentType res accept Source #

testEndpointParameters

testEndpointParameters Source #

Arguments

:: Consumes TestEndpointParameters contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Number

"number" - None

-> ParamDouble

"double" - None

-> PatternWithoutDelimiter

"patternWithoutDelimiter" - None

-> Byte

"byte" - None

-> SwaggerPetstoreRequest TestEndpointParameters contentType res accept 
POST /fake

Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트

Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트

AuthMethod: AuthBasicHttpBasicTest

Note: Has Produces instances, but no response schema

data TestEndpointParameters Source #

Instances

Produces TestEndpointParameters MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Produces TestEndpointParameters MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
Consumes TestEndpointParameters MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Consumes TestEndpointParameters MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - None

HasOptionalParam TestEndpointParameters ParamString Source #

Optional Param "string" - None

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

HasOptionalParam TestEndpointParameters ParamDateTime Source #

Optional Param "dateTime" - None

HasOptionalParam TestEndpointParameters ParamDate Source #

Optional Param "date" - None

HasOptionalParam TestEndpointParameters ParamBinary Source #

Optional Param "binary" - None

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

testEnumParameters

testEnumParameters Source #

Arguments

:: Consumes TestEnumParameters contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> SwaggerPetstoreRequest TestEnumParameters contentType res accept 
GET /fake

To test enum parameters

To test enum parameters

Note: Has Produces instances, but no response schema

data TestEnumParameters Source #

Instances

Produces TestEnumParameters MimeAny Source #
*/*
Consumes TestEnumParameters MimeAny Source #
*/*
HasOptionalParam TestEnumParameters EnumQueryStringArray Source #

Optional Param "enum_query_string_array" - Query parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumQueryString Source #

Optional Param "enum_query_string" - Query parameter enum test (string)

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

Optional Param "enum_query_integer" - Query parameter enum test (double)

HasOptionalParam TestEnumParameters EnumQueryDouble Source #

Optional Param "enum_query_double" - Query parameter enum test (double)

HasOptionalParam TestEnumParameters EnumHeaderStringArray Source #

Optional Param "enum_header_string_array" - Header parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumHeaderString Source #

Optional Param "enum_header_string" - Header parameter enum test (string)

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

Optional Param "enum_form_string_array" - Form parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumFormString Source #

Optional Param "enum_form_string" - Form parameter enum test (string)

testInlineAdditionalProperties

testInlineAdditionalProperties Source #

Arguments

:: (Consumes TestInlineAdditionalProperties contentType, MimeRender contentType Value) 
=> ContentType contentType

request content-type (MimeType)

-> Value

"param" - request body

-> SwaggerPetstoreRequest TestInlineAdditionalProperties contentType NoContent MimeNoContent 
POST /fake/inline-additionalProperties

test inline additionalProperties

testJsonFormData

testJsonFormData Source #

Arguments

:: Consumes TestJsonFormData contentType 
=> ContentType contentType

request content-type (MimeType)

-> Param

"param" - field1

-> Param2

"param2" - field2

-> SwaggerPetstoreRequest TestJsonFormData contentType NoContent MimeNoContent 
GET /fake/jsonFormData

test json serialization of form data

FakeClassnameTags123

testClassname

testClassname Source #

Arguments

:: (Consumes TestClassname contentType, MimeRender contentType Client) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Client

"body" - client model

-> SwaggerPetstoreRequest TestClassname contentType Client accept 
PATCH /fake_classname_test

To test class name in snake case

AuthMethod: AuthApiKeyApiKeyQuery

data TestClassname Source #

Instances

Produces TestClassname MimeJSON Source #
application/json
Consumes TestClassname MimeJSON Source #
application/json
HasBodyParam TestClassname Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestClassname contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestClassname contentType res accept -> Client -> SwaggerPetstoreRequest TestClassname contentType res accept Source #

Pet

addPet

addPet Source #

Arguments

:: (Consumes AddPet contentType, MimeRender contentType Pet) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Pet

"body" - Pet object that needs to be added to the store

-> SwaggerPetstoreRequest AddPet contentType res accept 
POST /pet

Add a new pet to the store

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

data AddPet Source #

Instances

Produces AddPet MimeXML Source #
application/xml
Produces AddPet MimeJSON Source #
application/json
Consumes AddPet MimeXML Source #
application/xml
Consumes AddPet MimeJSON Source #
application/json
HasBodyParam AddPet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes AddPet contentType, MimeRender contentType Pet) => SwaggerPetstoreRequest AddPet contentType res accept -> Pet -> SwaggerPetstoreRequest AddPet contentType res accept Source #

deletePet

deletePet Source #

Arguments

:: Accept accept

request accept (MimeType)

-> PetId

"petId" - Pet id to delete

-> SwaggerPetstoreRequest DeletePet MimeNoContent res accept 
DELETE /pet/{petId}

Deletes a pet

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

data DeletePet Source #

Instances

findPetsByStatus

findPetsByStatus Source #

Arguments

:: Accept accept

request accept (MimeType)

-> Status

"status" - Status values that need to be considered for filter

-> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] accept 
GET /pet/findByStatus

Finds Pets by status

Multiple status values can be provided with comma separated strings

AuthMethod: AuthOAuthPetstoreAuth

findPetsByTags

findPetsByTags Source #

Arguments

:: Accept accept

request accept (MimeType)

-> Tags

"tags" - Tags to filter by

-> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept 

Deprecated:

GET /pet/findByTags

Finds Pets by tags

Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

AuthMethod: AuthOAuthPetstoreAuth

getPetById

getPetById Source #

Arguments

:: Accept accept

request accept (MimeType)

-> PetId

"petId" - ID of pet to return

-> SwaggerPetstoreRequest GetPetById MimeNoContent Pet accept 
GET /pet/{petId}

Find pet by ID

Returns a single pet

AuthMethod: AuthApiKeyApiKey

data GetPetById Source #

Instances

updatePet

updatePet Source #

Arguments

:: (Consumes UpdatePet contentType, MimeRender contentType Pet) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Pet

"body" - Pet object that needs to be added to the store

-> SwaggerPetstoreRequest UpdatePet contentType res accept 
PUT /pet

Update an existing pet

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

data UpdatePet Source #

Instances

Produces UpdatePet MimeXML Source #
application/xml
Produces UpdatePet MimeJSON Source #
application/json
Consumes UpdatePet MimeXML Source #
application/xml
Consumes UpdatePet MimeJSON Source #
application/json
HasBodyParam UpdatePet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => SwaggerPetstoreRequest UpdatePet contentType res accept -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res accept Source #

updatePetWithForm

updatePetWithForm Source #

Arguments

:: Consumes UpdatePetWithForm contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> PetId

"petId" - ID of pet that needs to be updated

-> SwaggerPetstoreRequest UpdatePetWithForm contentType res accept 
POST /pet/{petId}

Updates a pet in the store with form data

AuthMethod: AuthOAuthPetstoreAuth

Note: Has Produces instances, but no response schema

data UpdatePetWithForm Source #

Instances

Produces UpdatePetWithForm MimeXML Source #
application/xml
Produces UpdatePetWithForm MimeJSON Source #
application/json
Consumes UpdatePetWithForm MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
HasOptionalParam UpdatePetWithForm StatusText Source #

Optional Param "status" - Updated status of the pet

HasOptionalParam UpdatePetWithForm Name2 Source #

Optional Param "name" - Updated name of the pet

uploadFile

uploadFile Source #

Arguments

:: Consumes UploadFile contentType 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> PetId

"petId" - ID of pet to update

-> SwaggerPetstoreRequest UploadFile contentType ApiResponse accept 
POST /pet/{petId}/uploadImage

uploads an image

AuthMethod: AuthOAuthPetstoreAuth

data UploadFile Source #

Instances

Produces UploadFile MimeJSON Source #
application/json
Consumes UploadFile MimeMultipartFormData Source #
multipart/form-data
HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

Methods

applyOptionalParam :: SwaggerPetstoreRequest UploadFile contentType res accept -> File -> SwaggerPetstoreRequest UploadFile contentType res accept Source #

(-&-) :: SwaggerPetstoreRequest UploadFile contentType res accept -> File -> SwaggerPetstoreRequest UploadFile contentType res accept Source #

HasOptionalParam UploadFile AdditionalMetadata Source #

Optional Param "additionalMetadata" - Additional data to pass to server

Store

deleteOrder

deleteOrder Source #

Arguments

:: Accept accept

request accept (MimeType)

-> OrderIdText

"orderId" - ID of the order that needs to be deleted

-> SwaggerPetstoreRequest DeleteOrder MimeNoContent res accept 
DELETE /store/order/{order_id}

Delete purchase order by ID

For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors

Note: Has Produces instances, but no response schema

data DeleteOrder Source #

Instances

getInventory

getInventory Source #

Arguments

:: Accept accept

request accept (MimeType)

-> SwaggerPetstoreRequest GetInventory MimeNoContent (Map String Int) accept 
GET /store/inventory

Returns pet inventories by status

Returns a map of status codes to quantities

AuthMethod: AuthApiKeyApiKey

data GetInventory Source #

Instances

getOrderById

getOrderById Source #

Arguments

:: Accept accept

request accept (MimeType)

-> OrderId

"orderId" - ID of pet that needs to be fetched

-> SwaggerPetstoreRequest GetOrderById MimeNoContent Order accept 
GET /store/order/{order_id}

Find purchase order by ID

For valid response try integer IDs with value 5 or 10. Other values will generated exceptions

placeOrder

placeOrder Source #

Arguments

:: (Consumes PlaceOrder contentType, MimeRender contentType Order) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Order

"body" - order placed for purchasing the pet

-> SwaggerPetstoreRequest PlaceOrder contentType Order accept 
POST /store/order

Place an order for a pet

data PlaceOrder Source #

Instances

Produces PlaceOrder MimeXML Source #
application/xml
Produces PlaceOrder MimeJSON Source #
application/json
HasBodyParam PlaceOrder Order Source #

Body Param "body" - order placed for purchasing the pet

Methods

setBodyParam :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => SwaggerPetstoreRequest PlaceOrder contentType res accept -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res accept Source #

User

createUser

createUser Source #

Arguments

:: (Consumes CreateUser contentType, MimeRender contentType User) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> User

"body" - Created user object

-> SwaggerPetstoreRequest CreateUser contentType res accept 
POST /user

Create user

This can only be done by the logged in user.

Note: Has Produces instances, but no response schema

data CreateUser Source #

Instances

Produces CreateUser MimeXML Source #
application/xml
Produces CreateUser MimeJSON Source #
application/json
HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res accept -> User -> SwaggerPetstoreRequest CreateUser contentType res accept Source #

createUsersWithArrayInput

createUsersWithArrayInput Source #

Arguments

:: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Body

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res accept 
POST /user/createWithArray

Creates list of users with given input array

Note: Has Produces instances, but no response schema

createUsersWithListInput

createUsersWithListInput Source #

Arguments

:: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Body

"body" - List of user object

-> SwaggerPetstoreRequest CreateUsersWithListInput contentType res accept 
POST /user/createWithList

Creates list of users with given input array

Note: Has Produces instances, but no response schema

deleteUser

deleteUser Source #

Arguments

:: Accept accept

request accept (MimeType)

-> Username

"username" - The name that needs to be deleted

-> SwaggerPetstoreRequest DeleteUser MimeNoContent res accept 
DELETE /user/{username}

Delete user

This can only be done by the logged in user.

Note: Has Produces instances, but no response schema

data DeleteUser Source #

Instances

getUserByName

getUserByName Source #

Arguments

:: Accept accept

request accept (MimeType)

-> Username

"username" - The name that needs to be fetched. Use user1 for testing.

-> SwaggerPetstoreRequest GetUserByName MimeNoContent User accept 
GET /user/{username}

Get user by user name

loginUser

loginUser Source #

Arguments

:: Accept accept

request accept (MimeType)

-> Username

"username" - The user name for login

-> Password

"password" - The password for login in clear text

-> SwaggerPetstoreRequest LoginUser MimeNoContent Text accept 
GET /user/login

Logs user into the system

data LoginUser Source #

Instances

logoutUser

logoutUser Source #

Arguments

:: Accept accept

request accept (MimeType)

-> SwaggerPetstoreRequest LogoutUser MimeNoContent res accept 
GET /user/logout

Logs out current logged in user session

Note: Has Produces instances, but no response schema

data LogoutUser Source #

Instances

updateUser

updateUser Source #

Arguments

:: (Consumes UpdateUser contentType, MimeRender contentType User) 
=> ContentType contentType

request content-type (MimeType)

-> Accept accept

request accept (MimeType)

-> Username

"username" - name that need to be deleted

-> User

"body" - Updated user object

-> SwaggerPetstoreRequest UpdateUser contentType res accept 
PUT /user/{username}

Updated user

This can only be done by the logged in user.

Note: Has Produces instances, but no response schema

data UpdateUser Source #

Instances

Produces UpdateUser MimeXML Source #
application/xml
Produces UpdateUser MimeJSON Source #
application/json
HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest UpdateUser contentType res accept -> User -> SwaggerPetstoreRequest UpdateUser contentType res accept Source #

Parameter newtypes

newtype ApiKey Source #

Constructors

ApiKey 

Fields

Instances

newtype Body Source #

Constructors

Body 

Fields

Instances

Eq Body Source # 

Methods

(==) :: Body -> Body -> Bool #

(/=) :: Body -> Body -> Bool #

Show Body Source # 

Methods

showsPrec :: Int -> Body -> ShowS #

show :: Body -> String #

showList :: [Body] -> ShowS #

ToJSON Body Source # 
HasBodyParam CreateUsersWithListInput Body Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput Body Source #

Body Param "body" - List of user object

newtype Byte Source #

Constructors

Byte 

Fields

Instances

Eq Byte Source # 

Methods

(==) :: Byte -> Byte -> Bool #

(/=) :: Byte -> Byte -> Bool #

Show Byte Source # 

Methods

showsPrec :: Int -> Byte -> ShowS #

show :: Byte -> String #

showList :: [Byte] -> ShowS #

newtype File Source #

Constructors

File 

Fields

Instances

Eq File Source # 

Methods

(==) :: File -> File -> Bool #

(/=) :: File -> File -> Bool #

Show File Source # 

Methods

showsPrec :: Int -> File -> ShowS #

show :: File -> String #

showList :: [File] -> ShowS #

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

Methods

applyOptionalParam :: SwaggerPetstoreRequest UploadFile contentType res accept -> File -> SwaggerPetstoreRequest UploadFile contentType res accept Source #

(-&-) :: SwaggerPetstoreRequest UploadFile contentType res accept -> File -> SwaggerPetstoreRequest UploadFile contentType res accept Source #

newtype Int32 Source #

Constructors

Int32 

Fields

newtype Int64 Source #

Constructors

Int64 

Fields

newtype Name2 Source #

Constructors

Name2 

Fields

Instances

Eq Name2 Source # 

Methods

(==) :: Name2 -> Name2 -> Bool #

(/=) :: Name2 -> Name2 -> Bool #

Show Name2 Source # 

Methods

showsPrec :: Int -> Name2 -> ShowS #

show :: Name2 -> String #

showList :: [Name2] -> ShowS #

HasOptionalParam UpdatePetWithForm Name2 Source #

Optional Param "name" - Updated name of the pet

newtype Number Source #

Constructors

Number 

Fields

Instances

newtype OrderId Source #

Constructors

OrderId 

Fields

newtype Param Source #

Constructors

Param 

Fields

Instances

Eq Param Source # 

Methods

(==) :: Param -> Param -> Bool #

(/=) :: Param -> Param -> Bool #

Show Param Source # 

Methods

showsPrec :: Int -> Param -> ShowS #

show :: Param -> String #

showList :: [Param] -> ShowS #

newtype Param2 Source #

Constructors

Param2 

Fields

Instances

newtype PetId Source #

Constructors

PetId 

Fields

Instances

Eq PetId Source # 

Methods

(==) :: PetId -> PetId -> Bool #

(/=) :: PetId -> PetId -> Bool #

Show PetId Source # 

Methods

showsPrec :: Int -> PetId -> ShowS #

show :: PetId -> String #

showList :: [PetId] -> ShowS #

newtype Status Source #

Constructors

Status 

Fields

Instances

newtype Tags Source #

Constructors

Tags 

Fields

Instances

Eq Tags Source # 

Methods

(==) :: Tags -> Tags -> Bool #

(/=) :: Tags -> Tags -> Bool #

Show Tags Source # 

Methods

showsPrec :: Int -> Tags -> ShowS #

show :: Tags -> String #

showList :: [Tags] -> ShowS #

newtype Username Source #

Constructors

Username 

Fields

Auth Methods

AuthApiKeyApiKey

AuthApiKeyApiKeyQuery

AuthBasicHttpBasicTest

AuthOAuthPetstoreAuth

Custom Mime Types

MimeJsonCharsetutf8

MimeXmlCharsetutf8

\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.API

Description

 
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Core.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Core.html index 0235617d8ea..47aace02858 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Core.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Core.html @@ -1,4 +1,4 @@ SwaggerPetstore.Core

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Core

Description

 

Synopsis

SwaggerPetstoreConfig

data SwaggerPetstoreConfig Source #

Constructors

SwaggerPetstoreConfig 

Fields

newConfig :: IO SwaggerPetstoreConfig Source #

constructs a default SwaggerPetstoreConfig

configHost:

http://petstore.swagger.io:80/v2

configUserAgent:

"swagger-haskell-http-client/1.0.0"

addAuthMethod :: AuthMethod auth => SwaggerPetstoreConfig -> auth -> SwaggerPetstoreConfig Source #

updates config use AuthMethod on matching requests

withStdoutLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig Source #

updates the config to use stdout logging

withStderrLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig Source #

updates the config to use stderr logging

withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig Source #

updates the config to disable logging

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res accept Source #

Represents a request.

Type Variables:

  • req - request operation
  • contentType - MimeType associated with request body
  • res - response model
  • accept - MimeType associated with response body

Constructors

SwaggerPetstoreRequest 

Fields

Instances

Show (SwaggerPetstoreRequest req contentType res accept) Source # 

Methods

showsPrec :: Int -> SwaggerPetstoreRequest req contentType res accept -> ShowS #

show :: SwaggerPetstoreRequest req contentType res accept -> String #

showList :: [SwaggerPetstoreRequest req contentType res accept] -> ShowS #

rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res accept) Method Source #

rMethod Lens

rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res accept) [ByteString] Source #

rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res accept) Params Source #

rParams Lens

rAuthTypesL :: Lens_' (SwaggerPetstoreRequest req contentType res accept) [TypeRep] Source #

rParams Lens

HasBodyParam

class HasBodyParam req param where Source #

Designates the body parameter of a request

Methods

setBodyParam :: forall contentType res accept. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res accept -> param -> SwaggerPetstoreRequest req contentType res accept Source #

Instances

HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest UpdateUser contentType res accept -> User -> SwaggerPetstoreRequest UpdateUser contentType res accept Source #

HasBodyParam CreateUsersWithListInput Body Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput Body Source #

Body Param "body" - List of user object

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res accept -> User -> SwaggerPetstoreRequest CreateUser contentType res accept Source #

HasBodyParam PlaceOrder Order Source #

Body Param "body" - order placed for purchasing the pet

Methods

setBodyParam :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => SwaggerPetstoreRequest PlaceOrder contentType res accept -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res accept Source #

HasBodyParam UpdatePet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => SwaggerPetstoreRequest UpdatePet contentType res accept -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res accept Source #

HasBodyParam AddPet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes AddPet contentType, MimeRender contentType Pet) => SwaggerPetstoreRequest AddPet contentType res accept -> Pet -> SwaggerPetstoreRequest AddPet contentType res accept Source #

HasBodyParam TestClassname Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestClassname contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestClassname contentType res accept -> Client -> SwaggerPetstoreRequest TestClassname contentType res accept Source #

HasBodyParam TestInlineAdditionalProperties Value Source #

Body Param "param" - request body

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestClientModel contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestClientModel contentType res accept -> Client -> SwaggerPetstoreRequest TestClientModel contentType res accept Source #

HasBodyParam FakeOuterStringSerialize OuterString Source #

Body Param "body" - Input string as post body

HasBodyParam FakeOuterNumberSerialize OuterNumber Source #

Body Param "body" - Input number as post body

HasBodyParam FakeOuterCompositeSerialize OuterComposite Source #

Body Param "body" - Input composite as post body

HasBodyParam FakeOuterBooleanSerialize OuterBoolean Source #

Body Param "body" - Input boolean as post body

HasBodyParam TestSpecialTags Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestSpecialTags contentType res accept -> Client -> SwaggerPetstoreRequest TestSpecialTags contentType res accept Source #

HasOptionalParam

class HasOptionalParam req param where Source #

Designates the optional parameters of a request

Minimal complete definition

applyOptionalParam | (-&-)

Methods

applyOptionalParam :: SwaggerPetstoreRequest req contentType res accept -> param -> SwaggerPetstoreRequest req contentType res accept Source #

Apply an optional parameter to a request

(-&-) :: SwaggerPetstoreRequest req contentType res accept -> param -> SwaggerPetstoreRequest req contentType res accept infixl 2 Source #

infix operator / alias for addOptionalParam

Instances

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

Methods

applyOptionalParam :: SwaggerPetstoreRequest UploadFile contentType res accept -> File -> SwaggerPetstoreRequest UploadFile contentType res accept Source #

(-&-) :: SwaggerPetstoreRequest UploadFile contentType res accept -> File -> SwaggerPetstoreRequest UploadFile contentType res accept Source #

HasOptionalParam UploadFile AdditionalMetadata Source #

Optional Param "additionalMetadata" - Additional data to pass to server

HasOptionalParam UpdatePetWithForm StatusText Source #

Optional Param "status" - Updated status of the pet

HasOptionalParam UpdatePetWithForm Name2 Source #

Optional Param "name" - Updated name of the pet

HasOptionalParam DeletePet ApiKey Source # 

Methods

applyOptionalParam :: SwaggerPetstoreRequest DeletePet contentType res accept -> ApiKey -> SwaggerPetstoreRequest DeletePet contentType res accept Source #

(-&-) :: SwaggerPetstoreRequest DeletePet contentType res accept -> ApiKey -> SwaggerPetstoreRequest DeletePet contentType res accept Source #

HasOptionalParam TestEnumParameters EnumQueryStringArray Source #

Optional Param "enum_query_string_array" - Query parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumQueryString Source #

Optional Param "enum_query_string" - Query parameter enum test (string)

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

Optional Param "enum_query_integer" - Query parameter enum test (double)

HasOptionalParam TestEnumParameters EnumQueryDouble Source #

Optional Param "enum_query_double" - Query parameter enum test (double)

HasOptionalParam TestEnumParameters EnumHeaderStringArray Source #

Optional Param "enum_header_string_array" - Header parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumHeaderString Source #

Optional Param "enum_header_string" - Header parameter enum test (string)

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

Optional Param "enum_form_string_array" - Form parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumFormString Source #

Optional Param "enum_form_string" - Form parameter enum test (string)

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - None

HasOptionalParam TestEndpointParameters ParamString Source #

Optional Param "string" - None

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

HasOptionalParam TestEndpointParameters ParamDateTime Source #

Optional Param "dateTime" - None

HasOptionalParam TestEndpointParameters ParamDate Source #

Optional Param "date" - None

HasOptionalParam TestEndpointParameters ParamBinary Source #

Optional Param "binary" - None

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

data Params Source #

Request Params

Instances

SwaggerPetstoreRequest Utils

_mkRequest Source #

Arguments

:: Method

Method

-> [ByteString]

Endpoint

-> SwaggerPetstoreRequest req contentType res accept

req: Request Type, res: Response Type

setHeader :: SwaggerPetstoreRequest req contentType res accept -> [Header] -> SwaggerPetstoreRequest req contentType res accept Source #

removeHeader :: SwaggerPetstoreRequest req contentType res accept -> [HeaderName] -> SwaggerPetstoreRequest req contentType res accept Source #

_setContentTypeHeader :: forall req contentType res accept. MimeType contentType => SwaggerPetstoreRequest req contentType res accept -> SwaggerPetstoreRequest req contentType res accept Source #

_setAcceptHeader :: forall req contentType res accept. MimeType accept => SwaggerPetstoreRequest req contentType res accept -> SwaggerPetstoreRequest req contentType res accept Source #

setQuery :: SwaggerPetstoreRequest req contentType res accept -> [QueryItem] -> SwaggerPetstoreRequest req contentType res accept Source #

addForm :: SwaggerPetstoreRequest req contentType res accept -> Form -> SwaggerPetstoreRequest req contentType res accept Source #

_addMultiFormPart :: SwaggerPetstoreRequest req contentType res accept -> Part -> SwaggerPetstoreRequest req contentType res accept Source #

_setBodyBS :: SwaggerPetstoreRequest req contentType res accept -> ByteString -> SwaggerPetstoreRequest req contentType res accept Source #

_setBodyLBS :: SwaggerPetstoreRequest req contentType res accept -> ByteString -> SwaggerPetstoreRequest req contentType res accept Source #

_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res accept -> Proxy authMethod -> SwaggerPetstoreRequest req contentType res accept Source #

Params Utils

Swagger CollectionFormat Utils

data CollectionFormat Source #

Determines the format of the array if type array is used.

Constructors

CommaSeparated

CSV format for multiple parameters.

SpaceSeparated

Also called SSV

TabSeparated

Also called TSV

PipeSeparated

`value1|value2|value2`

MultiParamArray

Using multiple GET parameters, e.g. `foo=bar&foo=baz`. This is valid only for parameters in "query" (Query) or "formData" (Form)

_toColl :: Traversable f => CollectionFormat -> (f a -> [(b, ByteString)]) -> f [a] -> [(b, ByteString)] Source #

_toCollA :: (Traversable f, Traversable t, Alternative t) => CollectionFormat -> (f (t a) -> [(b, t ByteString)]) -> f (t [a]) -> [(b, t ByteString)] Source #

_toCollA' :: (Monoid c, Traversable f, Traversable t, Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)] Source #

AuthMethods

class Typeable a => AuthMethod a where Source #

Provides a method to apply auth methods to requests

Minimal complete definition

applyAuthMethod

Methods

applyAuthMethod :: SwaggerPetstoreConfig -> a -> SwaggerPetstoreRequest req contentType res accept -> IO (SwaggerPetstoreRequest req contentType res accept) Source #

data AnyAuthMethod Source #

An existential wrapper for any AuthMethod

Constructors

AuthMethod a => AnyAuthMethod a 

Instances

AuthMethod AnyAuthMethod Source # 

Methods

applyAuthMethod :: SwaggerPetstoreConfig -> AnyAuthMethod -> SwaggerPetstoreRequest req contentType res accept -> IO (SwaggerPetstoreRequest req contentType res accept) Source #

_applyAuthMethods :: SwaggerPetstoreRequest req contentType res accept -> SwaggerPetstoreConfig -> IO (SwaggerPetstoreRequest req contentType res accept) Source #

apply all matching AuthMethods in config to request

Utils

_omitNulls :: [(Text, Value)] -> Value Source #

Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON)

_toFormItem :: (ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) Source #

Encodes fields using WH.toQueryParam

_emptyToNothing :: Maybe String -> Maybe String Source #

Collapse (Just "") to Nothing

_memptyToNothing :: (Monoid a, Eq a) => Maybe a -> Maybe a Source #

Collapse (Just mempty) to Nothing

DateTime Formatting

newtype DateTime Source #

Constructors

DateTime 

Fields

Instances

Eq DateTime Source # 
Data DateTime Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DateTime -> c DateTime #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DateTime #

toConstr :: DateTime -> Constr #

dataTypeOf :: DateTime -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c DateTime) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DateTime) #

gmapT :: (forall b. Data b => b -> b) -> DateTime -> DateTime #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DateTime -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DateTime -> r #

gmapQ :: (forall d. Data d => d -> u) -> DateTime -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DateTime -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

Ord DateTime Source # 
Show DateTime Source # 
ToJSON DateTime Source # 
FromJSON DateTime Source # 
NFData DateTime Source # 

Methods

rnf :: DateTime -> () #

ToHttpApiData DateTime Source # 
FromHttpApiData DateTime Source # 
FormatTime DateTime Source # 
ParseTime DateTime Source # 
MimeRender MimeMultipartFormData DateTime Source # 

_readDateTime :: (ParseTime t, Monad m, Alternative m) => String -> m t Source #

_parseISO8601

_showDateTime :: (t ~ UTCTime, FormatTime t) => t -> String Source #

TI.formatISO8601Millis

_parseISO8601 :: (ParseTime t, Monad m, Alternative m) => String -> m t Source #

parse an ISO8601 date-time string

Date Formatting

newtype Date Source #

Constructors

Date 

Fields

Instances

Enum Date Source # 

Methods

succ :: Date -> Date #

pred :: Date -> Date #

toEnum :: Int -> Date #

fromEnum :: Date -> Int #

enumFrom :: Date -> [Date] #

enumFromThen :: Date -> Date -> [Date] #

enumFromTo :: Date -> Date -> [Date] #

enumFromThenTo :: Date -> Date -> Date -> [Date] #

Eq Date Source # 

Methods

(==) :: Date -> Date -> Bool #

(/=) :: Date -> Date -> Bool #

Data Date Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Date -> c Date #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Date #

toConstr :: Date -> Constr #

dataTypeOf :: Date -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Date) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Date) #

gmapT :: (forall b. Data b => b -> b) -> Date -> Date #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Date -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Date -> r #

gmapQ :: (forall d. Data d => d -> u) -> Date -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Date -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Date -> m Date #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Date -> m Date #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Date -> m Date #

Ord Date Source # 

Methods

compare :: Date -> Date -> Ordering #

(<) :: Date -> Date -> Bool #

(<=) :: Date -> Date -> Bool #

(>) :: Date -> Date -> Bool #

(>=) :: Date -> Date -> Bool #

max :: Date -> Date -> Date #

min :: Date -> Date -> Date #

Show Date Source # 

Methods

showsPrec :: Int -> Date -> ShowS #

show :: Date -> String #

showList :: [Date] -> ShowS #

Ix Date Source # 

Methods

range :: (Date, Date) -> [Date] #

index :: (Date, Date) -> Date -> Int #

unsafeIndex :: (Date, Date) -> Date -> Int

inRange :: (Date, Date) -> Date -> Bool #

rangeSize :: (Date, Date) -> Int #

unsafeRangeSize :: (Date, Date) -> Int

ToJSON Date Source # 
FromJSON Date Source # 
NFData Date Source # 

Methods

rnf :: Date -> () #

ToHttpApiData Date Source # 
FromHttpApiData Date Source # 
FormatTime Date Source # 
ParseTime Date Source # 

Methods

buildTime :: TimeLocale -> [(Char, String)] -> Maybe Date #

MimeRender MimeMultipartFormData Date Source # 

_readDate :: (ParseTime t, Monad m) => String -> m t Source #

TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"

_showDate :: FormatTime t => t -> String Source #

TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"

Byte/Binary Formatting

newtype ByteArray Source #

base64 encoded characters

Constructors

ByteArray 

Instances

Eq ByteArray Source # 
Data ByteArray Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ByteArray -> c ByteArray #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ByteArray #

toConstr :: ByteArray -> Constr #

dataTypeOf :: ByteArray -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c ByteArray) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ByteArray) #

gmapT :: (forall b. Data b => b -> b) -> ByteArray -> ByteArray #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ByteArray -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ByteArray -> r #

gmapQ :: (forall d. Data d => d -> u) -> ByteArray -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ByteArray -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

Ord ByteArray Source # 
Show ByteArray Source # 
ToJSON ByteArray Source # 
FromJSON ByteArray Source # 
NFData ByteArray Source # 

Methods

rnf :: ByteArray -> () #

ToHttpApiData ByteArray Source # 
FromHttpApiData ByteArray Source # 
MimeRender MimeMultipartFormData ByteArray Source # 

_readByteArray :: Monad m => Text -> m ByteArray Source #

read base64 encoded characters

_showByteArray :: ByteArray -> Text Source #

show base64 encoded characters

newtype Binary Source #

any sequence of octets

Constructors

Binary 

Fields

Instances

Eq Binary Source # 

Methods

(==) :: Binary -> Binary -> Bool #

(/=) :: Binary -> Binary -> Bool #

Data Binary Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Binary -> c Binary #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Binary #

toConstr :: Binary -> Constr #

dataTypeOf :: Binary -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Binary) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Binary) #

gmapT :: (forall b. Data b => b -> b) -> Binary -> Binary #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Binary -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Binary -> r #

gmapQ :: (forall d. Data d => d -> u) -> Binary -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Binary -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

Ord Binary Source # 
Show Binary Source # 
ToJSON Binary Source # 
FromJSON Binary Source # 
NFData Binary Source # 

Methods

rnf :: Binary -> () #

ToHttpApiData Binary Source # 
FromHttpApiData Binary Source # 
MimeRender MimeMultipartFormData Binary Source # 

Lens Type Aliases

type Lens_' s a = Lens_ s s a a Source #

type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t Source #

\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Core

Description

 

Synopsis

SwaggerPetstoreConfig

data SwaggerPetstoreConfig Source #

Constructors

SwaggerPetstoreConfig 

Fields

newConfig :: IO SwaggerPetstoreConfig Source #

constructs a default SwaggerPetstoreConfig

configHost:

http://petstore.swagger.io:80/v2

configUserAgent:

"swagger-haskell-http-client/1.0.0"

addAuthMethod :: AuthMethod auth => SwaggerPetstoreConfig -> auth -> SwaggerPetstoreConfig Source #

updates config use AuthMethod on matching requests

withStdoutLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig Source #

updates the config to use stdout logging

withStderrLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig Source #

updates the config to use stderr logging

withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig Source #

updates the config to disable logging

SwaggerPetstoreRequest

data SwaggerPetstoreRequest req contentType res accept Source #

Represents a request.

Type Variables:

  • req - request operation
  • contentType - MimeType associated with request body
  • res - response model
  • accept - MimeType associated with response body

Constructors

SwaggerPetstoreRequest 

Fields

Instances

Show (SwaggerPetstoreRequest req contentType res accept) Source # 

Methods

showsPrec :: Int -> SwaggerPetstoreRequest req contentType res accept -> ShowS #

show :: SwaggerPetstoreRequest req contentType res accept -> String #

showList :: [SwaggerPetstoreRequest req contentType res accept] -> ShowS #

rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res accept) Method Source #

rMethod Lens

rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res accept) [ByteString] Source #

rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res accept) Params Source #

rParams Lens

rAuthTypesL :: Lens_' (SwaggerPetstoreRequest req contentType res accept) [TypeRep] Source #

rParams Lens

HasBodyParam

class HasBodyParam req param where Source #

Designates the body parameter of a request

Methods

setBodyParam :: forall contentType res accept. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res accept -> param -> SwaggerPetstoreRequest req contentType res accept Source #

Instances

HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest UpdateUser contentType res accept -> User -> SwaggerPetstoreRequest UpdateUser contentType res accept Source #

HasBodyParam CreateUsersWithListInput Body Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput Body Source #

Body Param "body" - List of user object

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res accept -> User -> SwaggerPetstoreRequest CreateUser contentType res accept Source #

HasBodyParam PlaceOrder Order Source #

Body Param "body" - order placed for purchasing the pet

Methods

setBodyParam :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => SwaggerPetstoreRequest PlaceOrder contentType res accept -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res accept Source #

HasBodyParam UpdatePet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => SwaggerPetstoreRequest UpdatePet contentType res accept -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res accept Source #

HasBodyParam AddPet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes AddPet contentType, MimeRender contentType Pet) => SwaggerPetstoreRequest AddPet contentType res accept -> Pet -> SwaggerPetstoreRequest AddPet contentType res accept Source #

HasBodyParam TestClassname Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestClassname contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestClassname contentType res accept -> Client -> SwaggerPetstoreRequest TestClassname contentType res accept Source #

HasBodyParam TestInlineAdditionalProperties Value Source #

Body Param "param" - request body

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestClientModel contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestClientModel contentType res accept -> Client -> SwaggerPetstoreRequest TestClientModel contentType res accept Source #

HasBodyParam FakeOuterStringSerialize OuterString Source #

Body Param "body" - Input string as post body

HasBodyParam FakeOuterNumberSerialize OuterNumber Source #

Body Param "body" - Input number as post body

HasBodyParam FakeOuterCompositeSerialize OuterComposite Source #

Body Param "body" - Input composite as post body

HasBodyParam FakeOuterBooleanSerialize OuterBoolean Source #

Body Param "body" - Input boolean as post body

HasBodyParam TestSpecialTags Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestSpecialTags contentType res accept -> Client -> SwaggerPetstoreRequest TestSpecialTags contentType res accept Source #

HasOptionalParam

class HasOptionalParam req param where Source #

Designates the optional parameters of a request

Minimal complete definition

applyOptionalParam | (-&-)

Methods

applyOptionalParam :: SwaggerPetstoreRequest req contentType res accept -> param -> SwaggerPetstoreRequest req contentType res accept Source #

Apply an optional parameter to a request

(-&-) :: SwaggerPetstoreRequest req contentType res accept -> param -> SwaggerPetstoreRequest req contentType res accept infixl 2 Source #

infix operator / alias for addOptionalParam

Instances

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

Methods

applyOptionalParam :: SwaggerPetstoreRequest UploadFile contentType res accept -> File -> SwaggerPetstoreRequest UploadFile contentType res accept Source #

(-&-) :: SwaggerPetstoreRequest UploadFile contentType res accept -> File -> SwaggerPetstoreRequest UploadFile contentType res accept Source #

HasOptionalParam UploadFile AdditionalMetadata Source #

Optional Param "additionalMetadata" - Additional data to pass to server

HasOptionalParam UpdatePetWithForm StatusText Source #

Optional Param "status" - Updated status of the pet

HasOptionalParam UpdatePetWithForm Name2 Source #

Optional Param "name" - Updated name of the pet

HasOptionalParam DeletePet ApiKey Source # 

Methods

applyOptionalParam :: SwaggerPetstoreRequest DeletePet contentType res accept -> ApiKey -> SwaggerPetstoreRequest DeletePet contentType res accept Source #

(-&-) :: SwaggerPetstoreRequest DeletePet contentType res accept -> ApiKey -> SwaggerPetstoreRequest DeletePet contentType res accept Source #

HasOptionalParam TestEnumParameters EnumQueryStringArray Source #

Optional Param "enum_query_string_array" - Query parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumQueryString Source #

Optional Param "enum_query_string" - Query parameter enum test (string)

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

Optional Param "enum_query_integer" - Query parameter enum test (double)

HasOptionalParam TestEnumParameters EnumQueryDouble Source #

Optional Param "enum_query_double" - Query parameter enum test (double)

HasOptionalParam TestEnumParameters EnumHeaderStringArray Source #

Optional Param "enum_header_string_array" - Header parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumHeaderString Source #

Optional Param "enum_header_string" - Header parameter enum test (string)

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

Optional Param "enum_form_string_array" - Form parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumFormString Source #

Optional Param "enum_form_string" - Form parameter enum test (string)

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - None

HasOptionalParam TestEndpointParameters ParamString Source #

Optional Param "string" - None

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

HasOptionalParam TestEndpointParameters ParamDateTime Source #

Optional Param "dateTime" - None

HasOptionalParam TestEndpointParameters ParamDate Source #

Optional Param "date" - None

HasOptionalParam TestEndpointParameters ParamBinary Source #

Optional Param "binary" - None

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

data Params Source #

Request Params

Instances

SwaggerPetstoreRequest Utils

_mkRequest Source #

Arguments

:: Method

Method

-> [ByteString]

Endpoint

-> SwaggerPetstoreRequest req contentType res accept

req: Request Type, res: Response Type

setHeader :: SwaggerPetstoreRequest req contentType res accept -> [Header] -> SwaggerPetstoreRequest req contentType res accept Source #

removeHeader :: SwaggerPetstoreRequest req contentType res accept -> [HeaderName] -> SwaggerPetstoreRequest req contentType res accept Source #

_setContentTypeHeader :: forall req contentType res accept. MimeType contentType => SwaggerPetstoreRequest req contentType res accept -> SwaggerPetstoreRequest req contentType res accept Source #

_setAcceptHeader :: forall req contentType res accept. MimeType accept => SwaggerPetstoreRequest req contentType res accept -> SwaggerPetstoreRequest req contentType res accept Source #

setQuery :: SwaggerPetstoreRequest req contentType res accept -> [QueryItem] -> SwaggerPetstoreRequest req contentType res accept Source #

addForm :: SwaggerPetstoreRequest req contentType res accept -> Form -> SwaggerPetstoreRequest req contentType res accept Source #

_addMultiFormPart :: SwaggerPetstoreRequest req contentType res accept -> Part -> SwaggerPetstoreRequest req contentType res accept Source #

_setBodyBS :: SwaggerPetstoreRequest req contentType res accept -> ByteString -> SwaggerPetstoreRequest req contentType res accept Source #

_setBodyLBS :: SwaggerPetstoreRequest req contentType res accept -> ByteString -> SwaggerPetstoreRequest req contentType res accept Source #

_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res accept -> Proxy authMethod -> SwaggerPetstoreRequest req contentType res accept Source #

Params Utils

Swagger CollectionFormat Utils

data CollectionFormat Source #

Determines the format of the array if type array is used.

Constructors

CommaSeparated

CSV format for multiple parameters.

SpaceSeparated

Also called SSV

TabSeparated

Also called TSV

PipeSeparated

`value1|value2|value2`

MultiParamArray

Using multiple GET parameters, e.g. `foo=bar&foo=baz`. This is valid only for parameters in "query" (Query) or "formData" (Form)

_toColl :: Traversable f => CollectionFormat -> (f a -> [(b, ByteString)]) -> f [a] -> [(b, ByteString)] Source #

_toCollA :: (Traversable f, Traversable t, Alternative t) => CollectionFormat -> (f (t a) -> [(b, t ByteString)]) -> f (t [a]) -> [(b, t ByteString)] Source #

_toCollA' :: (Monoid c, Traversable f, Traversable t, Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)] Source #

AuthMethods

class Typeable a => AuthMethod a where Source #

Provides a method to apply auth methods to requests

Minimal complete definition

applyAuthMethod

Methods

applyAuthMethod :: SwaggerPetstoreConfig -> a -> SwaggerPetstoreRequest req contentType res accept -> IO (SwaggerPetstoreRequest req contentType res accept) Source #

data AnyAuthMethod Source #

An existential wrapper for any AuthMethod

Constructors

AuthMethod a => AnyAuthMethod a 

Instances

AuthMethod AnyAuthMethod Source # 

Methods

applyAuthMethod :: SwaggerPetstoreConfig -> AnyAuthMethod -> SwaggerPetstoreRequest req contentType res accept -> IO (SwaggerPetstoreRequest req contentType res accept) Source #

_applyAuthMethods :: SwaggerPetstoreRequest req contentType res accept -> SwaggerPetstoreConfig -> IO (SwaggerPetstoreRequest req contentType res accept) Source #

apply all matching AuthMethods in config to request

Utils

_omitNulls :: [(Text, Value)] -> Value Source #

Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON)

_toFormItem :: (ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) Source #

Encodes fields using WH.toQueryParam

_emptyToNothing :: Maybe String -> Maybe String Source #

Collapse (Just "") to Nothing

_memptyToNothing :: (Monoid a, Eq a) => Maybe a -> Maybe a Source #

Collapse (Just mempty) to Nothing

DateTime Formatting

newtype DateTime Source #

Constructors

DateTime 

Fields

Instances

Eq DateTime Source # 
Data DateTime Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DateTime -> c DateTime #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DateTime #

toConstr :: DateTime -> Constr #

dataTypeOf :: DateTime -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c DateTime) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DateTime) #

gmapT :: (forall b. Data b => b -> b) -> DateTime -> DateTime #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DateTime -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DateTime -> r #

gmapQ :: (forall d. Data d => d -> u) -> DateTime -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DateTime -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

Ord DateTime Source # 
Show DateTime Source # 
ToJSON DateTime Source # 
FromJSON DateTime Source # 
NFData DateTime Source # 

Methods

rnf :: DateTime -> () #

ToHttpApiData DateTime Source # 
FromHttpApiData DateTime Source # 
FormatTime DateTime Source # 
ParseTime DateTime Source # 
MimeRender MimeMultipartFormData DateTime Source # 

_readDateTime :: (ParseTime t, Monad m, Alternative m) => String -> m t Source #

_parseISO8601

_showDateTime :: (t ~ UTCTime, FormatTime t) => t -> String Source #

TI.formatISO8601Millis

_parseISO8601 :: (ParseTime t, Monad m, Alternative m) => String -> m t Source #

parse an ISO8601 date-time string

Date Formatting

newtype Date Source #

Constructors

Date 

Fields

Instances

Enum Date Source # 

Methods

succ :: Date -> Date #

pred :: Date -> Date #

toEnum :: Int -> Date #

fromEnum :: Date -> Int #

enumFrom :: Date -> [Date] #

enumFromThen :: Date -> Date -> [Date] #

enumFromTo :: Date -> Date -> [Date] #

enumFromThenTo :: Date -> Date -> Date -> [Date] #

Eq Date Source # 

Methods

(==) :: Date -> Date -> Bool #

(/=) :: Date -> Date -> Bool #

Data Date Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Date -> c Date #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Date #

toConstr :: Date -> Constr #

dataTypeOf :: Date -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Date) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Date) #

gmapT :: (forall b. Data b => b -> b) -> Date -> Date #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Date -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Date -> r #

gmapQ :: (forall d. Data d => d -> u) -> Date -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Date -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Date -> m Date #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Date -> m Date #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Date -> m Date #

Ord Date Source # 

Methods

compare :: Date -> Date -> Ordering #

(<) :: Date -> Date -> Bool #

(<=) :: Date -> Date -> Bool #

(>) :: Date -> Date -> Bool #

(>=) :: Date -> Date -> Bool #

max :: Date -> Date -> Date #

min :: Date -> Date -> Date #

Show Date Source # 

Methods

showsPrec :: Int -> Date -> ShowS #

show :: Date -> String #

showList :: [Date] -> ShowS #

Ix Date Source # 

Methods

range :: (Date, Date) -> [Date] #

index :: (Date, Date) -> Date -> Int #

unsafeIndex :: (Date, Date) -> Date -> Int

inRange :: (Date, Date) -> Date -> Bool #

rangeSize :: (Date, Date) -> Int #

unsafeRangeSize :: (Date, Date) -> Int

ToJSON Date Source # 
FromJSON Date Source # 
NFData Date Source # 

Methods

rnf :: Date -> () #

ToHttpApiData Date Source # 
FromHttpApiData Date Source # 
FormatTime Date Source # 
ParseTime Date Source # 

Methods

buildTime :: TimeLocale -> [(Char, String)] -> Maybe Date #

MimeRender MimeMultipartFormData Date Source # 

_readDate :: (ParseTime t, Monad m) => String -> m t Source #

TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"

_showDate :: FormatTime t => t -> String Source #

TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"

Byte/Binary Formatting

newtype ByteArray Source #

base64 encoded characters

Constructors

ByteArray 

Instances

Eq ByteArray Source # 
Data ByteArray Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ByteArray -> c ByteArray #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ByteArray #

toConstr :: ByteArray -> Constr #

dataTypeOf :: ByteArray -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c ByteArray) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ByteArray) #

gmapT :: (forall b. Data b => b -> b) -> ByteArray -> ByteArray #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ByteArray -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ByteArray -> r #

gmapQ :: (forall d. Data d => d -> u) -> ByteArray -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ByteArray -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

Ord ByteArray Source # 
Show ByteArray Source # 
ToJSON ByteArray Source # 
FromJSON ByteArray Source # 
NFData ByteArray Source # 

Methods

rnf :: ByteArray -> () #

ToHttpApiData ByteArray Source # 
FromHttpApiData ByteArray Source # 
MimeRender MimeMultipartFormData ByteArray Source # 

_readByteArray :: Monad m => Text -> m ByteArray Source #

read base64 encoded characters

_showByteArray :: ByteArray -> Text Source #

show base64 encoded characters

newtype Binary Source #

any sequence of octets

Constructors

Binary 

Fields

Instances

Eq Binary Source # 

Methods

(==) :: Binary -> Binary -> Bool #

(/=) :: Binary -> Binary -> Bool #

Data Binary Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Binary -> c Binary #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Binary #

toConstr :: Binary -> Constr #

dataTypeOf :: Binary -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Binary) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Binary) #

gmapT :: (forall b. Data b => b -> b) -> Binary -> Binary #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Binary -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Binary -> r #

gmapQ :: (forall d. Data d => d -> u) -> Binary -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Binary -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

Ord Binary Source # 
Show Binary Source # 
ToJSON Binary Source # 
FromJSON Binary Source # 
NFData Binary Source # 

Methods

rnf :: Binary -> () #

ToHttpApiData Binary Source # 
FromHttpApiData Binary Source # 
MimeRender MimeMultipartFormData Binary Source # 

Lens Type Aliases

type Lens_' s a = Lens_ s s a a Source #

type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t Source #

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-MimeTypes.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-MimeTypes.html index 4bcd209f199..9dd84788368 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-MimeTypes.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-MimeTypes.html @@ -1,4 +1,4 @@ SwaggerPetstore.MimeTypes

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.MimeTypes

Description

 

ContentType MimeType

data ContentType a Source #

Constructors

MimeType a => ContentType 

Fields

Accept MimeType

data Accept a Source #

Constructors

MimeType a => Accept 

Fields

Consumes Class

Produces Class

class MimeType mtype => Produces req mtype Source #

Instances

Produces UpdateUser MimeXML Source #
application/xml
Produces UpdateUser MimeJSON Source #
application/json
Produces LogoutUser MimeXML Source #
application/xml
Produces LogoutUser MimeJSON Source #
application/json
Produces LoginUser MimeXML Source #
application/xml
Produces LoginUser MimeJSON Source #
application/json
Produces GetUserByName MimeXML Source #
application/xml
Produces GetUserByName MimeJSON Source #
application/json
Produces DeleteUser MimeXML Source #
application/xml
Produces DeleteUser MimeJSON Source #
application/json
Produces CreateUsersWithListInput MimeXML Source #
application/xml
Produces CreateUsersWithListInput MimeJSON Source #
application/json
Produces CreateUsersWithArrayInput MimeXML Source #
application/xml
Produces CreateUsersWithArrayInput MimeJSON Source #
application/json
Produces CreateUser MimeXML Source #
application/xml
Produces CreateUser MimeJSON Source #
application/json
Produces PlaceOrder MimeXML Source #
application/xml
Produces PlaceOrder MimeJSON Source #
application/json
Produces GetOrderById MimeXML Source #
application/xml
Produces GetOrderById MimeJSON Source #
application/json
Produces GetInventory MimeJSON Source #
application/json
Produces DeleteOrder MimeXML Source #
application/xml
Produces DeleteOrder MimeJSON Source #
application/json
Produces UploadFile MimeJSON Source #
application/json
Produces UpdatePetWithForm MimeXML Source #
application/xml
Produces UpdatePetWithForm MimeJSON Source #
application/json
Produces UpdatePet MimeXML Source #
application/xml
Produces UpdatePet MimeJSON Source #
application/json
Produces GetPetById MimeXML Source #
application/xml
Produces GetPetById MimeJSON Source #
application/json
Produces FindPetsByTags MimeXML Source #
application/xml
Produces FindPetsByTags MimeJSON Source #
application/json
Produces FindPetsByStatus MimeXML Source #
application/xml
Produces FindPetsByStatus MimeJSON Source #
application/json
Produces DeletePet MimeXML Source #
application/xml
Produces DeletePet MimeJSON Source #
application/json
Produces AddPet MimeXML Source #
application/xml
Produces AddPet MimeJSON Source #
application/json
Produces TestClassname MimeJSON Source #
application/json
Produces TestEnumParameters MimeAny Source #
*/*
Produces TestEndpointParameters MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Produces TestEndpointParameters MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
Produces TestClientModel MimeJSON Source #
application/json
Produces TestSpecialTags MimeJSON Source #
application/json

Default Mime Types

data MimeJSON Source #

Constructors

MimeJSON 

Instances

MimeType MimeJSON Source #
application/json; charset=utf-8
FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
ToJSON a => MimeRender MimeJSON a Source #

encode

Produces UpdateUser MimeJSON Source #
application/json
Produces LogoutUser MimeJSON Source #
application/json
Produces LoginUser MimeJSON Source #
application/json
Produces GetUserByName MimeJSON Source #
application/json
Produces DeleteUser MimeJSON Source #
application/json
Produces CreateUsersWithListInput MimeJSON Source #
application/json
Produces CreateUsersWithArrayInput MimeJSON Source #
application/json
Produces CreateUser MimeJSON Source #
application/json
Produces PlaceOrder MimeJSON Source #
application/json
Produces GetOrderById MimeJSON Source #
application/json
Produces GetInventory MimeJSON Source #
application/json
Produces DeleteOrder MimeJSON Source #
application/json
Produces UploadFile MimeJSON Source #
application/json
Produces UpdatePetWithForm MimeJSON Source #
application/json
Produces UpdatePet MimeJSON Source #
application/json
Produces GetPetById MimeJSON Source #
application/json
Produces FindPetsByTags MimeJSON Source #
application/json
Produces FindPetsByStatus MimeJSON Source #
application/json
Produces DeletePet MimeJSON Source #
application/json
Produces AddPet MimeJSON Source #
application/json
Produces TestClassname MimeJSON Source #
application/json
Produces TestClientModel MimeJSON Source #
application/json
Produces TestSpecialTags MimeJSON Source #
application/json
Consumes UpdatePet MimeJSON Source #
application/json
Consumes AddPet MimeJSON Source #
application/json
Consumes TestClassname MimeJSON Source #
application/json
Consumes TestJsonFormData MimeJSON Source #
application/json
Consumes TestInlineAdditionalProperties MimeJSON Source #
application/json
Consumes TestClientModel MimeJSON Source #
application/json
Consumes TestSpecialTags MimeJSON Source #
application/json

data MimePlainText Source #

Constructors

MimePlainText 

Instances

MimeType MimePlainText Source #
text/plain; charset=utf-8
MimeUnrender MimePlainText ByteString Source #
P.Right . P.id
MimeUnrender MimePlainText String Source #
P.Right . BCL.unpack
MimeUnrender MimePlainText Text Source #
P.left P.show . TL.decodeUtf8'
MimeRender MimePlainText ByteString Source #
P.id
MimeRender MimePlainText String Source #
BCL.pack
MimeRender MimePlainText Text Source #
BL.fromStrict . T.encodeUtf8

data MimeMultipartFormData Source #

Constructors

MimeMultipartFormData 

Instances

MimeType MimeMultipartFormData Source #
multipart/form-data
MimeRender MimeMultipartFormData Bool Source # 
MimeRender MimeMultipartFormData Char Source # 
MimeRender MimeMultipartFormData Double Source # 
MimeRender MimeMultipartFormData Float Source # 
MimeRender MimeMultipartFormData Int Source # 
MimeRender MimeMultipartFormData Integer Source # 
MimeRender MimeMultipartFormData ByteString Source # 
MimeRender MimeMultipartFormData String Source # 
MimeRender MimeMultipartFormData Text Source # 
MimeRender MimeMultipartFormData Binary Source # 
MimeRender MimeMultipartFormData ByteArray Source # 
MimeRender MimeMultipartFormData Date Source # 
MimeRender MimeMultipartFormData DateTime Source # 
MimeRender MimeMultipartFormData OuterEnum Source # 
MimeRender MimeMultipartFormData EnumClass Source # 
MimeRender MimeMultipartFormData E'Status2 Source # 
MimeRender MimeMultipartFormData E'Status Source # 
MimeRender MimeMultipartFormData E'JustSymbol Source # 
MimeRender MimeMultipartFormData E'Inner2 Source # 
MimeRender MimeMultipartFormData E'Inner Source # 
MimeRender MimeMultipartFormData E'EnumString Source # 
MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 
MimeRender MimeMultipartFormData E'EnumNumber Source # 
MimeRender MimeMultipartFormData E'EnumInteger Source # 
MimeRender MimeMultipartFormData E'EnumFormString Source # 
MimeRender MimeMultipartFormData E'ArrayEnum Source # 
Consumes UploadFile MimeMultipartFormData Source #
multipart/form-data

data MimeOctetStream Source #

Constructors

MimeOctetStream 

Instances

MimeType MimeOctetStream Source #
application/octet-stream
MimeUnrender MimeOctetStream ByteString Source #
P.Right . P.id
MimeUnrender MimeOctetStream String Source #
P.Right . BCL.unpack
MimeUnrender MimeOctetStream Text Source #
P.left P.show . T.decodeUtf8' . BL.toStrict
MimeRender MimeOctetStream ByteString Source #
P.id
MimeRender MimeOctetStream String Source #
BCL.pack
MimeRender MimeOctetStream Text Source #
BL.fromStrict . T.encodeUtf8

MimeType Class

class Typeable mtype => MimeType mtype where Source #

Minimal complete definition

mimeType | mimeTypes

Instances

MimeType MimeAny Source #
"*/*"
MimeType MimeNoContent Source # 
MimeType MimeOctetStream Source #
application/octet-stream
MimeType MimeMultipartFormData Source #
multipart/form-data
MimeType MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
MimeType MimePlainText Source #
text/plain; charset=utf-8
MimeType MimeXML Source #
application/xml; charset=utf-8
MimeType MimeJSON Source #
application/json; charset=utf-8
MimeType MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
MimeType MimeJsonCharsetutf8 Source #
application/json; charset=utf-8

MimeRender Class

class MimeType mtype => MimeRender mtype x where Source #

Minimal complete definition

mimeRender

Methods

mimeRender :: Proxy mtype -> x -> ByteString Source #

mimeRender' :: mtype -> x -> ByteString Source #

Instances

MimeRender MimeNoContent NoContent Source #
P.Right . P.const NoContent
MimeRender MimeOctetStream ByteString Source #
P.id
MimeRender MimeOctetStream String Source #
BCL.pack
MimeRender MimeOctetStream Text Source #
BL.fromStrict . T.encodeUtf8
MimeRender MimeMultipartFormData Bool Source # 
MimeRender MimeMultipartFormData Char Source # 
MimeRender MimeMultipartFormData Double Source # 
MimeRender MimeMultipartFormData Float Source # 
MimeRender MimeMultipartFormData Int Source # 
MimeRender MimeMultipartFormData Integer Source # 
MimeRender MimeMultipartFormData ByteString Source # 
MimeRender MimeMultipartFormData String Source # 
MimeRender MimeMultipartFormData Text Source # 
MimeRender MimeMultipartFormData Binary Source # 
MimeRender MimeMultipartFormData ByteArray Source # 
MimeRender MimeMultipartFormData Date Source # 
MimeRender MimeMultipartFormData DateTime Source # 
MimeRender MimeMultipartFormData OuterEnum Source # 
MimeRender MimeMultipartFormData EnumClass Source # 
MimeRender MimeMultipartFormData E'Status2 Source # 
MimeRender MimeMultipartFormData E'Status Source # 
MimeRender MimeMultipartFormData E'JustSymbol Source # 
MimeRender MimeMultipartFormData E'Inner2 Source # 
MimeRender MimeMultipartFormData E'Inner Source # 
MimeRender MimeMultipartFormData E'EnumString Source # 
MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 
MimeRender MimeMultipartFormData E'EnumNumber Source # 
MimeRender MimeMultipartFormData E'EnumInteger Source # 
MimeRender MimeMultipartFormData E'EnumFormString Source # 
MimeRender MimeMultipartFormData E'ArrayEnum Source # 
ToForm a => MimeRender MimeFormUrlEncoded a Source #
WH.urlEncodeAsForm
MimeRender MimePlainText ByteString Source #
P.id
MimeRender MimePlainText String Source #
BCL.pack
MimeRender MimePlainText Text Source #
BL.fromStrict . T.encodeUtf8
ToJSON a => MimeRender MimeJSON a Source #

encode

ToJSON a => MimeRender MimeJsonCharsetutf8 a Source # 

MimeUnrender Class

class MimeType mtype => MimeUnrender mtype o where Source #

Minimal complete definition

mimeUnrender

Instances

MimeUnrender MimeNoContent NoContent Source #
P.Right . P.const NoContent
MimeUnrender MimeOctetStream ByteString Source #
P.Right . P.id
MimeUnrender MimeOctetStream String Source #
P.Right . BCL.unpack
MimeUnrender MimeOctetStream Text Source #
P.left P.show . T.decodeUtf8' . BL.toStrict
FromForm a => MimeUnrender MimeFormUrlEncoded a Source #
P.left T.unpack . WH.urlDecodeAsForm
MimeUnrender MimePlainText ByteString Source #
P.Right . P.id
MimeUnrender MimePlainText String Source #
P.Right . BCL.unpack
MimeUnrender MimePlainText Text Source #
P.left P.show . TL.decodeUtf8'
FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
FromJSON a => MimeUnrender MimeJsonCharsetutf8 a Source # 
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.MimeTypes

Description

 

ContentType MimeType

data ContentType a Source #

Constructors

MimeType a => ContentType 

Fields

Accept MimeType

data Accept a Source #

Constructors

MimeType a => Accept 

Fields

Consumes Class

Produces Class

class MimeType mtype => Produces req mtype Source #

Instances

Produces UpdateUser MimeXML Source #
application/xml
Produces UpdateUser MimeJSON Source #
application/json
Produces LogoutUser MimeXML Source #
application/xml
Produces LogoutUser MimeJSON Source #
application/json
Produces LoginUser MimeXML Source #
application/xml
Produces LoginUser MimeJSON Source #
application/json
Produces GetUserByName MimeXML Source #
application/xml
Produces GetUserByName MimeJSON Source #
application/json
Produces DeleteUser MimeXML Source #
application/xml
Produces DeleteUser MimeJSON Source #
application/json
Produces CreateUsersWithListInput MimeXML Source #
application/xml
Produces CreateUsersWithListInput MimeJSON Source #
application/json
Produces CreateUsersWithArrayInput MimeXML Source #
application/xml
Produces CreateUsersWithArrayInput MimeJSON Source #
application/json
Produces CreateUser MimeXML Source #
application/xml
Produces CreateUser MimeJSON Source #
application/json
Produces PlaceOrder MimeXML Source #
application/xml
Produces PlaceOrder MimeJSON Source #
application/json
Produces GetOrderById MimeXML Source #
application/xml
Produces GetOrderById MimeJSON Source #
application/json
Produces GetInventory MimeJSON Source #
application/json
Produces DeleteOrder MimeXML Source #
application/xml
Produces DeleteOrder MimeJSON Source #
application/json
Produces UploadFile MimeJSON Source #
application/json
Produces UpdatePetWithForm MimeXML Source #
application/xml
Produces UpdatePetWithForm MimeJSON Source #
application/json
Produces UpdatePet MimeXML Source #
application/xml
Produces UpdatePet MimeJSON Source #
application/json
Produces GetPetById MimeXML Source #
application/xml
Produces GetPetById MimeJSON Source #
application/json
Produces FindPetsByTags MimeXML Source #
application/xml
Produces FindPetsByTags MimeJSON Source #
application/json
Produces FindPetsByStatus MimeXML Source #
application/xml
Produces FindPetsByStatus MimeJSON Source #
application/json
Produces DeletePet MimeXML Source #
application/xml
Produces DeletePet MimeJSON Source #
application/json
Produces AddPet MimeXML Source #
application/xml
Produces AddPet MimeJSON Source #
application/json
Produces TestClassname MimeJSON Source #
application/json
MimeType mtype => Produces TestEnumParameters mtype Source #
*/*
Produces TestEndpointParameters MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
Produces TestEndpointParameters MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
Produces TestClientModel MimeJSON Source #
application/json
Produces TestSpecialTags MimeJSON Source #
application/json

Default Mime Types

data MimeJSON Source #

Constructors

MimeJSON 

Instances

MimeType MimeJSON Source #
application/json; charset=utf-8
FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
ToJSON a => MimeRender MimeJSON a Source #

encode

Produces UpdateUser MimeJSON Source #
application/json
Produces LogoutUser MimeJSON Source #
application/json
Produces LoginUser MimeJSON Source #
application/json
Produces GetUserByName MimeJSON Source #
application/json
Produces DeleteUser MimeJSON Source #
application/json
Produces CreateUsersWithListInput MimeJSON Source #
application/json
Produces CreateUsersWithArrayInput MimeJSON Source #
application/json
Produces CreateUser MimeJSON Source #
application/json
Produces PlaceOrder MimeJSON Source #
application/json
Produces GetOrderById MimeJSON Source #
application/json
Produces GetInventory MimeJSON Source #
application/json
Produces DeleteOrder MimeJSON Source #
application/json
Produces UploadFile MimeJSON Source #
application/json
Produces UpdatePetWithForm MimeJSON Source #
application/json
Produces UpdatePet MimeJSON Source #
application/json
Produces GetPetById MimeJSON Source #
application/json
Produces FindPetsByTags MimeJSON Source #
application/json
Produces FindPetsByStatus MimeJSON Source #
application/json
Produces DeletePet MimeJSON Source #
application/json
Produces AddPet MimeJSON Source #
application/json
Produces TestClassname MimeJSON Source #
application/json
Produces TestClientModel MimeJSON Source #
application/json
Produces TestSpecialTags MimeJSON Source #
application/json
Consumes UpdatePet MimeJSON Source #
application/json
Consumes AddPet MimeJSON Source #
application/json
Consumes TestClassname MimeJSON Source #
application/json
Consumes TestJsonFormData MimeJSON Source #
application/json
Consumes TestInlineAdditionalProperties MimeJSON Source #
application/json
Consumes TestClientModel MimeJSON Source #
application/json
Consumes TestSpecialTags MimeJSON Source #
application/json

data MimePlainText Source #

Constructors

MimePlainText 

Instances

MimeType MimePlainText Source #
text/plain; charset=utf-8
MimeUnrender MimePlainText ByteString Source #
P.Right . P.id
MimeUnrender MimePlainText String Source #
P.Right . BCL.unpack
MimeUnrender MimePlainText Text Source #
P.left P.show . TL.decodeUtf8'
MimeRender MimePlainText ByteString Source #
P.id
MimeRender MimePlainText String Source #
BCL.pack
MimeRender MimePlainText Text Source #
BL.fromStrict . T.encodeUtf8

data MimeMultipartFormData Source #

Constructors

MimeMultipartFormData 

Instances

MimeType MimeMultipartFormData Source #
multipart/form-data
MimeRender MimeMultipartFormData Bool Source # 
MimeRender MimeMultipartFormData Char Source # 
MimeRender MimeMultipartFormData Double Source # 
MimeRender MimeMultipartFormData Float Source # 
MimeRender MimeMultipartFormData Int Source # 
MimeRender MimeMultipartFormData Integer Source # 
MimeRender MimeMultipartFormData ByteString Source # 
MimeRender MimeMultipartFormData String Source # 
MimeRender MimeMultipartFormData Text Source # 
MimeRender MimeMultipartFormData Binary Source # 
MimeRender MimeMultipartFormData ByteArray Source # 
MimeRender MimeMultipartFormData Date Source # 
MimeRender MimeMultipartFormData DateTime Source # 
MimeRender MimeMultipartFormData OuterEnum Source # 
MimeRender MimeMultipartFormData EnumClass Source # 
MimeRender MimeMultipartFormData E'Status2 Source # 
MimeRender MimeMultipartFormData E'Status Source # 
MimeRender MimeMultipartFormData E'JustSymbol Source # 
MimeRender MimeMultipartFormData E'Inner2 Source # 
MimeRender MimeMultipartFormData E'Inner Source # 
MimeRender MimeMultipartFormData E'EnumString Source # 
MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 
MimeRender MimeMultipartFormData E'EnumNumber Source # 
MimeRender MimeMultipartFormData E'EnumInteger Source # 
MimeRender MimeMultipartFormData E'EnumFormString Source # 
MimeRender MimeMultipartFormData E'ArrayEnum Source # 
Consumes UploadFile MimeMultipartFormData Source #
multipart/form-data

data MimeOctetStream Source #

Constructors

MimeOctetStream 

Instances

MimeType MimeOctetStream Source #
application/octet-stream
MimeUnrender MimeOctetStream ByteString Source #
P.Right . P.id
MimeUnrender MimeOctetStream String Source #
P.Right . BCL.unpack
MimeUnrender MimeOctetStream Text Source #
P.left P.show . T.decodeUtf8' . BL.toStrict
MimeRender MimeOctetStream ByteString Source #
P.id
MimeRender MimeOctetStream String Source #
BCL.pack
MimeRender MimeOctetStream Text Source #
BL.fromStrict . T.encodeUtf8

MimeType Class

class Typeable mtype => MimeType mtype where Source #

Minimal complete definition

mimeType | mimeTypes

Instances

MimeType MimeXmlCharsetutf8 Source #
application/xml; charset=utf-8
MimeType MimeJsonCharsetutf8 Source #
application/json; charset=utf-8
MimeType MimeAny Source #
"*/*"
MimeType MimeNoContent Source # 
MimeType MimeOctetStream Source #
application/octet-stream
MimeType MimeMultipartFormData Source #
multipart/form-data
MimeType MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
MimeType MimePlainText Source #
text/plain; charset=utf-8
MimeType MimeXML Source #
application/xml; charset=utf-8
MimeType MimeJSON Source #
application/json; charset=utf-8

MimeRender Class

class MimeType mtype => MimeRender mtype x where Source #

Minimal complete definition

mimeRender

Methods

mimeRender :: Proxy mtype -> x -> ByteString Source #

mimeRender' :: mtype -> x -> ByteString Source #

Instances

ToJSON a => MimeRender MimeJsonCharsetutf8 a Source # 
MimeRender MimeNoContent NoContent Source #
P.Right . P.const NoContent
MimeRender MimeOctetStream ByteString Source #
P.id
MimeRender MimeOctetStream String Source #
BCL.pack
MimeRender MimeOctetStream Text Source #
BL.fromStrict . T.encodeUtf8
MimeRender MimeMultipartFormData Bool Source # 
MimeRender MimeMultipartFormData Char Source # 
MimeRender MimeMultipartFormData Double Source # 
MimeRender MimeMultipartFormData Float Source # 
MimeRender MimeMultipartFormData Int Source # 
MimeRender MimeMultipartFormData Integer Source # 
MimeRender MimeMultipartFormData ByteString Source # 
MimeRender MimeMultipartFormData String Source # 
MimeRender MimeMultipartFormData Text Source # 
MimeRender MimeMultipartFormData Binary Source # 
MimeRender MimeMultipartFormData ByteArray Source # 
MimeRender MimeMultipartFormData Date Source # 
MimeRender MimeMultipartFormData DateTime Source # 
MimeRender MimeMultipartFormData OuterEnum Source # 
MimeRender MimeMultipartFormData EnumClass Source # 
MimeRender MimeMultipartFormData E'Status2 Source # 
MimeRender MimeMultipartFormData E'Status Source # 
MimeRender MimeMultipartFormData E'JustSymbol Source # 
MimeRender MimeMultipartFormData E'Inner2 Source # 
MimeRender MimeMultipartFormData E'Inner Source # 
MimeRender MimeMultipartFormData E'EnumString Source # 
MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 
MimeRender MimeMultipartFormData E'EnumNumber Source # 
MimeRender MimeMultipartFormData E'EnumInteger Source # 
MimeRender MimeMultipartFormData E'EnumFormString Source # 
MimeRender MimeMultipartFormData E'ArrayEnum Source # 
ToForm a => MimeRender MimeFormUrlEncoded a Source #
WH.urlEncodeAsForm
MimeRender MimePlainText ByteString Source #
P.id
MimeRender MimePlainText String Source #
BCL.pack
MimeRender MimePlainText Text Source #
BL.fromStrict . T.encodeUtf8
ToJSON a => MimeRender MimeJSON a Source #

encode

MimeUnrender Class

class MimeType mtype => MimeUnrender mtype o where Source #

Minimal complete definition

mimeUnrender

Instances

FromJSON a => MimeUnrender MimeJsonCharsetutf8 a Source # 
MimeUnrender MimeNoContent NoContent Source #
P.Right . P.const NoContent
MimeUnrender MimeOctetStream ByteString Source #
P.Right . P.id
MimeUnrender MimeOctetStream String Source #
P.Right . BCL.unpack
MimeUnrender MimeOctetStream Text Source #
P.left P.show . T.decodeUtf8' . BL.toStrict
FromForm a => MimeUnrender MimeFormUrlEncoded a Source #
P.left T.unpack . WH.urlDecodeAsForm
MimeUnrender MimePlainText ByteString Source #
P.Right . P.id
MimeUnrender MimePlainText String Source #
P.Right . BCL.unpack
MimeUnrender MimePlainText Text Source #
P.left P.show . TL.decodeUtf8'
FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode

Custom Mime Types

MimeJsonCharsetutf8

MimeXmlCharsetutf8

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html index f69c3e38902..010865ecb7c 100644 --- a/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html +++ b/samples/client/petstore/haskell-http-client/docs/SwaggerPetstore-Model.html @@ -1,10 +1,10 @@ SwaggerPetstore.Model

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Model

Description

 

Synopsis

Models

AdditionalPropertiesClass

mkAdditionalPropertiesClass :: AdditionalPropertiesClass Source #

Construct a value of type AdditionalPropertiesClass (by applying it's required fields, if any)

Animal

data Animal Source #

Animal

Constructors

Animal 

Fields

mkAnimal Source #

Arguments

:: Text

animalClassName

-> Animal 

Construct a value of type Animal (by applying it's required fields, if any)

AnimalFarm

mkAnimalFarm :: AnimalFarm Source #

Construct a value of type AnimalFarm (by applying it's required fields, if any)

ApiResponse

mkApiResponse :: ApiResponse Source #

Construct a value of type ApiResponse (by applying it's required fields, if any)

ArrayOfArrayOfNumberOnly

mkArrayOfArrayOfNumberOnly :: ArrayOfArrayOfNumberOnly Source #

Construct a value of type ArrayOfArrayOfNumberOnly (by applying it's required fields, if any)

ArrayOfNumberOnly

mkArrayOfNumberOnly :: ArrayOfNumberOnly Source #

Construct a value of type ArrayOfNumberOnly (by applying it's required fields, if any)

ArrayTest

mkArrayTest :: ArrayTest Source #

Construct a value of type ArrayTest (by applying it's required fields, if any)

Capitalization

mkCapitalization :: Capitalization Source #

Construct a value of type Capitalization (by applying it's required fields, if any)

Category

mkCategory :: Category Source #

Construct a value of type Category (by applying it's required fields, if any)

ClassModel

data ClassModel Source #

ClassModel - Model for testing model with "_class" property

Constructors

ClassModel 

Fields

mkClassModel :: ClassModel Source #

Construct a value of type ClassModel (by applying it's required fields, if any)

Client

data Client Source #

Client

Constructors

Client 

Fields

Instances

Eq Client Source # 

Methods

(==) :: Client -> Client -> Bool #

(/=) :: Client -> Client -> Bool #

Show Client Source # 
ToJSON Client Source #

ToJSON Client

FromJSON Client Source #

FromJSON Client

HasBodyParam TestClassname Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestClassname contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestClassname contentType res accept -> Client -> SwaggerPetstoreRequest TestClassname contentType res accept Source #

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestClientModel contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestClientModel contentType res accept -> Client -> SwaggerPetstoreRequest TestClientModel contentType res accept Source #

HasBodyParam TestSpecialTags Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestSpecialTags contentType res accept -> Client -> SwaggerPetstoreRequest TestSpecialTags contentType res accept Source #

mkClient :: Client Source #

Construct a value of type Client (by applying it's required fields, if any)

EnumArrays

mkEnumArrays :: EnumArrays Source #

Construct a value of type EnumArrays (by applying it's required fields, if any)

EnumTest

mkEnumTest :: EnumTest Source #

Construct a value of type EnumTest (by applying it's required fields, if any)

FormatTest

mkFormatTest Source #

Construct a value of type FormatTest (by applying it's required fields, if any)

HasOnlyReadOnly

mkHasOnlyReadOnly :: HasOnlyReadOnly Source #

Construct a value of type HasOnlyReadOnly (by applying it's required fields, if any)

MapTest

data MapTest Source #

MapTest

Constructors

MapTest 

Fields

mkMapTest :: MapTest Source #

Construct a value of type MapTest (by applying it's required fields, if any)

MixedPropertiesAndAdditionalPropertiesClass

data MixedPropertiesAndAdditionalPropertiesClass Source #

MixedPropertiesAndAdditionalPropertiesClass

Model200Response

mkModel200Response :: Model200Response Source #

Construct a value of type Model200Response (by applying it's required fields, if any)

ModelList

mkModelList :: ModelList Source #

Construct a value of type ModelList (by applying it's required fields, if any)

ModelReturn

mkModelReturn :: ModelReturn Source #

Construct a value of type ModelReturn (by applying it's required fields, if any)

Name

data Name Source #

Name - Model for testing model name same as property name

Constructors

Name 

Fields

Instances

mkName Source #

Arguments

:: Int

nameName

-> Name 

Construct a value of type Name (by applying it's required fields, if any)

NumberOnly

mkNumberOnly :: NumberOnly Source #

Construct a value of type NumberOnly (by applying it's required fields, if any)

Order

data Order Source #

Order

Constructors

Order 

Fields

Instances

Eq Order Source # 

Methods

(==) :: Order -> Order -> Bool #

(/=) :: Order -> Order -> Bool #

Show Order Source # 

Methods

showsPrec :: Int -> Order -> ShowS #

show :: Order -> String #

showList :: [Order] -> ShowS #

ToJSON Order Source #

ToJSON Order

FromJSON Order Source #

FromJSON Order

HasBodyParam PlaceOrder Order Source #

Body Param "body" - order placed for purchasing the pet

Methods

setBodyParam :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => SwaggerPetstoreRequest PlaceOrder contentType res accept -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res accept Source #

mkOrder :: Order Source #

Construct a value of type Order (by applying it's required fields, if any)

OuterBoolean

newtype OuterBoolean Source #

OuterBoolean

Constructors

OuterBoolean 

Fields

OuterComposite

mkOuterComposite :: OuterComposite Source #

Construct a value of type OuterComposite (by applying it's required fields, if any)

OuterNumber

OuterString

Pet

data Pet Source #

Pet

Constructors

Pet 

Fields

Instances

Eq Pet Source # 

Methods

(==) :: Pet -> Pet -> Bool #

(/=) :: Pet -> Pet -> Bool #

Show Pet Source # 

Methods

showsPrec :: Int -> Pet -> ShowS #

show :: Pet -> String #

showList :: [Pet] -> ShowS #

ToJSON Pet Source #

ToJSON Pet

FromJSON Pet Source #

FromJSON Pet

HasBodyParam UpdatePet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => SwaggerPetstoreRequest UpdatePet contentType res accept -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res accept Source #

HasBodyParam AddPet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes AddPet contentType, MimeRender contentType Pet) => SwaggerPetstoreRequest AddPet contentType res accept -> Pet -> SwaggerPetstoreRequest AddPet contentType res accept Source #

mkPet Source #

Arguments

:: Text

petName

-> [Text]

petPhotoUrls

-> Pet 

Construct a value of type Pet (by applying it's required fields, if any)

ReadOnlyFirst

mkReadOnlyFirst :: ReadOnlyFirst Source #

Construct a value of type ReadOnlyFirst (by applying it's required fields, if any)

SpecialModelName

mkSpecialModelName :: SpecialModelName Source #

Construct a value of type SpecialModelName (by applying it's required fields, if any)

Tag

data Tag Source #

Tag

Constructors

Tag 

Fields

Instances

Eq Tag Source # 

Methods

(==) :: Tag -> Tag -> Bool #

(/=) :: Tag -> Tag -> Bool #

Show Tag Source # 

Methods

showsPrec :: Int -> Tag -> ShowS #

show :: Tag -> String #

showList :: [Tag] -> ShowS #

ToJSON Tag Source #

ToJSON Tag

FromJSON Tag Source #

FromJSON Tag

mkTag :: Tag Source #

Construct a value of type Tag (by applying it's required fields, if any)

User

data User Source #

User

Constructors

User 

Fields

Instances

Eq User Source # 

Methods

(==) :: User -> User -> Bool #

(/=) :: User -> User -> Bool #

Show User Source # 

Methods

showsPrec :: Int -> User -> ShowS #

show :: User -> String #

showList :: [User] -> ShowS #

ToJSON User Source #

ToJSON User

FromJSON User Source #

FromJSON User

HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest UpdateUser contentType res accept -> User -> SwaggerPetstoreRequest UpdateUser contentType res accept Source #

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res accept -> User -> SwaggerPetstoreRequest CreateUser contentType res accept Source #

mkUser :: User Source #

Construct a value of type User (by applying it's required fields, if any)

Cat

data Cat Source #

Cat

Constructors

Cat 

Fields

Instances

Eq Cat Source # 

Methods

(==) :: Cat -> Cat -> Bool #

(/=) :: Cat -> Cat -> Bool #

Show Cat Source # 

Methods

showsPrec :: Int -> Cat -> ShowS #

show :: Cat -> String #

showList :: [Cat] -> ShowS #

ToJSON Cat Source #

ToJSON Cat

FromJSON Cat Source #

FromJSON Cat

mkCat Source #

Arguments

:: Text

catClassName

-> Cat 

Construct a value of type Cat (by applying it's required fields, if any)

Dog

data Dog Source #

Dog

Constructors

Dog 

Fields

Instances

Eq Dog Source # 

Methods

(==) :: Dog -> Dog -> Bool #

(/=) :: Dog -> Dog -> Bool #

Show Dog Source # 

Methods

showsPrec :: Int -> Dog -> ShowS #

show :: Dog -> String #

showList :: [Dog] -> ShowS #

ToJSON Dog Source #

ToJSON Dog

FromJSON Dog Source #

FromJSON Dog

mkDog Source #

Arguments

:: Text

dogClassName

-> Dog 

Construct a value of type Dog (by applying it's required fields, if any)

Enums

E'ArrayEnum

data E'ArrayEnum Source #

Enum of Text

Constructors

E'ArrayEnum'Fish
"fish"
E'ArrayEnum'Crab
"crab"

Instances

Bounded E'ArrayEnum Source # 
Enum E'ArrayEnum Source # 
Eq E'ArrayEnum Source # 
Ord E'ArrayEnum Source # 
Show E'ArrayEnum Source # 
ToJSON E'ArrayEnum Source # 
FromJSON E'ArrayEnum Source # 
ToHttpApiData E'ArrayEnum Source # 
FromHttpApiData E'ArrayEnum Source # 
MimeRender MimeMultipartFormData E'ArrayEnum Source # 

E'EnumFormString

data E'EnumFormString Source #

Enum of Text

Instances

Bounded E'EnumFormString Source # 
Enum E'EnumFormString Source # 
Eq E'EnumFormString Source # 
Ord E'EnumFormString Source # 
Show E'EnumFormString Source # 
ToJSON E'EnumFormString Source # 
FromJSON E'EnumFormString Source # 
ToHttpApiData E'EnumFormString Source # 
FromHttpApiData E'EnumFormString Source # 
MimeRender MimeMultipartFormData E'EnumFormString Source # 

E'EnumInteger

data E'EnumInteger Source #

Enum of Int

Instances

Bounded E'EnumInteger Source # 
Enum E'EnumInteger Source # 
Eq E'EnumInteger Source # 
Ord E'EnumInteger Source # 
Show E'EnumInteger Source # 
ToJSON E'EnumInteger Source # 
FromJSON E'EnumInteger Source # 
ToHttpApiData E'EnumInteger Source # 
FromHttpApiData E'EnumInteger Source # 
MimeRender MimeMultipartFormData E'EnumInteger Source # 

E'EnumNumber

data E'EnumNumber Source #

Enum of Double

Instances

Bounded E'EnumNumber Source # 
Enum E'EnumNumber Source # 
Eq E'EnumNumber Source # 
Ord E'EnumNumber Source # 
Show E'EnumNumber Source # 
ToJSON E'EnumNumber Source # 
FromJSON E'EnumNumber Source # 
ToHttpApiData E'EnumNumber Source # 
FromHttpApiData E'EnumNumber Source # 
MimeRender MimeMultipartFormData E'EnumNumber Source # 

E'EnumQueryInteger

data E'EnumQueryInteger Source #

Enum of Int

Instances

Bounded E'EnumQueryInteger Source # 
Enum E'EnumQueryInteger Source # 
Eq E'EnumQueryInteger Source # 
Ord E'EnumQueryInteger Source # 
Show E'EnumQueryInteger Source # 
ToJSON E'EnumQueryInteger Source # 
FromJSON E'EnumQueryInteger Source # 
ToHttpApiData E'EnumQueryInteger Source # 
FromHttpApiData E'EnumQueryInteger Source # 
MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 

E'EnumString

data E'EnumString Source #

Enum of Text

Instances

Bounded E'EnumString Source # 
Enum E'EnumString Source # 
Eq E'EnumString Source # 
Ord E'EnumString Source # 
Show E'EnumString Source # 
ToJSON E'EnumString Source # 
FromJSON E'EnumString Source # 
ToHttpApiData E'EnumString Source # 
FromHttpApiData E'EnumString Source # 
MimeRender MimeMultipartFormData E'EnumString Source # 

E'Inner

data E'Inner Source #

Enum of Text

Instances

Bounded E'Inner Source # 
Enum E'Inner Source # 
Eq E'Inner Source # 

Methods

(==) :: E'Inner -> E'Inner -> Bool #

(/=) :: E'Inner -> E'Inner -> Bool #

Ord E'Inner Source # 
Show E'Inner Source # 
ToJSON E'Inner Source # 
FromJSON E'Inner Source # 
ToHttpApiData E'Inner Source # 
FromHttpApiData E'Inner Source # 
MimeRender MimeMultipartFormData E'Inner Source # 

E'Inner2

data E'Inner2 Source #

Enum of Text

Instances

Bounded E'Inner2 Source # 
Enum E'Inner2 Source # 
Eq E'Inner2 Source # 
Ord E'Inner2 Source # 
Show E'Inner2 Source # 
ToJSON E'Inner2 Source # 
FromJSON E'Inner2 Source # 
ToHttpApiData E'Inner2 Source # 
FromHttpApiData E'Inner2 Source # 
MimeRender MimeMultipartFormData E'Inner2 Source # 

E'JustSymbol

data E'JustSymbol Source #

Enum of Text

Instances

Bounded E'JustSymbol Source # 
Enum E'JustSymbol Source # 
Eq E'JustSymbol Source # 
Ord E'JustSymbol Source # 
Show E'JustSymbol Source # 
ToJSON E'JustSymbol Source # 
FromJSON E'JustSymbol Source # 
ToHttpApiData E'JustSymbol Source # 
FromHttpApiData E'JustSymbol Source # 
MimeRender MimeMultipartFormData E'JustSymbol Source # 

E'Status

data E'Status Source #

Enum of Text . - Order Status

Constructors

E'Status'Placed
"placed"
E'Status'Approved
"approved"
E'Status'Delivered
"delivered"

Instances

Bounded E'Status Source # 
Enum E'Status Source # 
Eq E'Status Source # 
Ord E'Status Source # 
Show E'Status Source # 
ToJSON E'Status Source # 
FromJSON E'Status Source # 
ToHttpApiData E'Status Source # 
FromHttpApiData E'Status Source # 
MimeRender MimeMultipartFormData E'Status Source # 

E'Status2

data E'Status2 Source #

Enum of Text . - pet status in the store

Constructors

E'Status2'Available
"available"
E'Status2'Pending
"pending"
E'Status2'Sold
"sold"

Instances

Bounded E'Status2 Source # 
Enum E'Status2 Source # 
Eq E'Status2 Source # 
Ord E'Status2 Source # 
Show E'Status2 Source # 
ToJSON E'Status2 Source # 
FromJSON E'Status2 Source # 
ToHttpApiData E'Status2 Source # 
FromHttpApiData E'Status2 Source # 
MimeRender MimeMultipartFormData E'Status2 Source # 

EnumClass

data EnumClass Source #

Enum of Text

Constructors

EnumClass'_abc
"_abc"
EnumClass'_efg
"-efg"
EnumClass'_xyz
"(xyz)"

Instances

Bounded EnumClass Source # 
Enum EnumClass Source # 
Eq EnumClass Source # 
Ord EnumClass Source # 
Show EnumClass Source # 
ToJSON EnumClass Source # 
FromJSON EnumClass Source # 
ToHttpApiData EnumClass Source # 
FromHttpApiData EnumClass Source # 
MimeRender MimeMultipartFormData EnumClass Source # 

OuterEnum

data OuterEnum Source #

Enum of Text

Constructors

OuterEnum'Placed
"placed"
OuterEnum'Approved
"approved"
OuterEnum'Delivered
"delivered"

Instances

Bounded OuterEnum Source # 
Enum OuterEnum Source # 
Eq OuterEnum Source # 
Ord OuterEnum Source # 
Show OuterEnum Source # 
ToJSON OuterEnum Source # 
FromJSON OuterEnum Source # 
ToHttpApiData OuterEnum Source # 
FromHttpApiData OuterEnum Source # 
MimeRender MimeMultipartFormData OuterEnum Source # 
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Safe HaskellNone
LanguageHaskell2010

SwaggerPetstore.Model

Description

 

Synopsis

Parameter newtypes

AdditionalMetadata

ApiKey

newtype ApiKey Source #

Constructors

ApiKey 

Fields

Instances

Body

newtype Body Source #

Constructors

Body 

Fields

Instances

Eq Body Source # 

Methods

(==) :: Body -> Body -> Bool #

(/=) :: Body -> Body -> Bool #

Show Body Source # 

Methods

showsPrec :: Int -> Body -> ShowS #

show :: Body -> String #

showList :: [Body] -> ShowS #

ToJSON Body Source # 
HasBodyParam CreateUsersWithListInput Body Source #

Body Param "body" - List of user object

HasBodyParam CreateUsersWithArrayInput Body Source #

Body Param "body" - List of user object

Byte

newtype Byte Source #

Constructors

Byte 

Fields

Instances

Eq Byte Source # 

Methods

(==) :: Byte -> Byte -> Bool #

(/=) :: Byte -> Byte -> Bool #

Show Byte Source # 

Methods

showsPrec :: Int -> Byte -> ShowS #

show :: Byte -> String #

showList :: [Byte] -> ShowS #

Callback

EnumFormString

EnumFormStringArray

EnumHeaderString

EnumHeaderStringArray

EnumQueryDouble

EnumQueryInteger

EnumQueryString

EnumQueryStringArray

File

newtype File Source #

Constructors

File 

Fields

Instances

Eq File Source # 

Methods

(==) :: File -> File -> Bool #

(/=) :: File -> File -> Bool #

Show File Source # 

Methods

showsPrec :: Int -> File -> ShowS #

show :: File -> String #

showList :: [File] -> ShowS #

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

Methods

applyOptionalParam :: SwaggerPetstoreRequest UploadFile contentType res accept -> File -> SwaggerPetstoreRequest UploadFile contentType res accept Source #

(-&-) :: SwaggerPetstoreRequest UploadFile contentType res accept -> File -> SwaggerPetstoreRequest UploadFile contentType res accept Source #

Int32

newtype Int32 Source #

Constructors

Int32 

Fields

Int64

newtype Int64 Source #

Constructors

Int64 

Fields

Name2

newtype Name2 Source #

Constructors

Name2 

Fields

Instances

Eq Name2 Source # 

Methods

(==) :: Name2 -> Name2 -> Bool #

(/=) :: Name2 -> Name2 -> Bool #

Show Name2 Source # 

Methods

showsPrec :: Int -> Name2 -> ShowS #

show :: Name2 -> String #

showList :: [Name2] -> ShowS #

HasOptionalParam UpdatePetWithForm Name2 Source #

Optional Param "name" - Updated name of the pet

Number

newtype Number Source #

Constructors

Number 

Fields

Instances

OrderId

newtype OrderId Source #

Constructors

OrderId 

Fields

OrderIdText

Param

newtype Param Source #

Constructors

Param 

Fields

Instances

Eq Param Source # 

Methods

(==) :: Param -> Param -> Bool #

(/=) :: Param -> Param -> Bool #

Show Param Source # 

Methods

showsPrec :: Int -> Param -> ShowS #

show :: Param -> String #

showList :: [Param] -> ShowS #

Param2

newtype Param2 Source #

Constructors

Param2 

Fields

Instances

ParamBinary

ParamDate

ParamDateTime

ParamDouble

ParamFloat

ParamInteger

ParamString

Password

PatternWithoutDelimiter

PetId

newtype PetId Source #

Constructors

PetId 

Fields

Instances

Eq PetId Source # 

Methods

(==) :: PetId -> PetId -> Bool #

(/=) :: PetId -> PetId -> Bool #

Show PetId Source # 

Methods

showsPrec :: Int -> PetId -> ShowS #

show :: PetId -> String #

showList :: [PetId] -> ShowS #

Status

newtype Status Source #

Constructors

Status 

Fields

Instances

StatusText

Tags

newtype Tags Source #

Constructors

Tags 

Fields

Instances

Eq Tags Source # 

Methods

(==) :: Tags -> Tags -> Bool #

(/=) :: Tags -> Tags -> Bool #

Show Tags Source # 

Methods

showsPrec :: Int -> Tags -> ShowS #

show :: Tags -> String #

showList :: [Tags] -> ShowS #

Username

newtype Username Source #

Constructors

Username 

Fields

Models

AdditionalPropertiesClass

mkAdditionalPropertiesClass :: AdditionalPropertiesClass Source #

Construct a value of type AdditionalPropertiesClass (by applying it's required fields, if any)

Animal

data Animal Source #

Animal

Constructors

Animal 

Fields

mkAnimal Source #

Arguments

:: Text

animalClassName

-> Animal 

Construct a value of type Animal (by applying it's required fields, if any)

AnimalFarm

mkAnimalFarm :: AnimalFarm Source #

Construct a value of type AnimalFarm (by applying it's required fields, if any)

ApiResponse

mkApiResponse :: ApiResponse Source #

Construct a value of type ApiResponse (by applying it's required fields, if any)

ArrayOfArrayOfNumberOnly

mkArrayOfArrayOfNumberOnly :: ArrayOfArrayOfNumberOnly Source #

Construct a value of type ArrayOfArrayOfNumberOnly (by applying it's required fields, if any)

ArrayOfNumberOnly

mkArrayOfNumberOnly :: ArrayOfNumberOnly Source #

Construct a value of type ArrayOfNumberOnly (by applying it's required fields, if any)

ArrayTest

mkArrayTest :: ArrayTest Source #

Construct a value of type ArrayTest (by applying it's required fields, if any)

Capitalization

mkCapitalization :: Capitalization Source #

Construct a value of type Capitalization (by applying it's required fields, if any)

Category

mkCategory :: Category Source #

Construct a value of type Category (by applying it's required fields, if any)

ClassModel

data ClassModel Source #

ClassModel + Model for testing model with "_class" property

Constructors

ClassModel 

Fields

mkClassModel :: ClassModel Source #

Construct a value of type ClassModel (by applying it's required fields, if any)

Client

data Client Source #

Client

Constructors

Client 

Fields

Instances

Eq Client Source # 

Methods

(==) :: Client -> Client -> Bool #

(/=) :: Client -> Client -> Bool #

Show Client Source # 
ToJSON Client Source #

ToJSON Client

FromJSON Client Source #

FromJSON Client

HasBodyParam TestClassname Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestClassname contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestClassname contentType res accept -> Client -> SwaggerPetstoreRequest TestClassname contentType res accept Source #

HasBodyParam TestClientModel Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestClientModel contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestClientModel contentType res accept -> Client -> SwaggerPetstoreRequest TestClientModel contentType res accept Source #

HasBodyParam TestSpecialTags Client Source #

Body Param "body" - client model

Methods

setBodyParam :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) => SwaggerPetstoreRequest TestSpecialTags contentType res accept -> Client -> SwaggerPetstoreRequest TestSpecialTags contentType res accept Source #

mkClient :: Client Source #

Construct a value of type Client (by applying it's required fields, if any)

EnumArrays

mkEnumArrays :: EnumArrays Source #

Construct a value of type EnumArrays (by applying it's required fields, if any)

EnumTest

mkEnumTest :: EnumTest Source #

Construct a value of type EnumTest (by applying it's required fields, if any)

FormatTest

mkFormatTest Source #

Construct a value of type FormatTest (by applying it's required fields, if any)

HasOnlyReadOnly

mkHasOnlyReadOnly :: HasOnlyReadOnly Source #

Construct a value of type HasOnlyReadOnly (by applying it's required fields, if any)

MapTest

data MapTest Source #

MapTest

Constructors

MapTest 

Fields

mkMapTest :: MapTest Source #

Construct a value of type MapTest (by applying it's required fields, if any)

MixedPropertiesAndAdditionalPropertiesClass

data MixedPropertiesAndAdditionalPropertiesClass Source #

MixedPropertiesAndAdditionalPropertiesClass

Model200Response

mkModel200Response :: Model200Response Source #

Construct a value of type Model200Response (by applying it's required fields, if any)

ModelList

mkModelList :: ModelList Source #

Construct a value of type ModelList (by applying it's required fields, if any)

ModelReturn

mkModelReturn :: ModelReturn Source #

Construct a value of type ModelReturn (by applying it's required fields, if any)

Name

data Name Source #

Name + Model for testing model name same as property name

Constructors

Name 

Fields

Instances

mkName Source #

Arguments

:: Int

nameName

-> Name 

Construct a value of type Name (by applying it's required fields, if any)

NumberOnly

mkNumberOnly :: NumberOnly Source #

Construct a value of type NumberOnly (by applying it's required fields, if any)

Order

data Order Source #

Order

Constructors

Order 

Fields

Instances

Eq Order Source # 

Methods

(==) :: Order -> Order -> Bool #

(/=) :: Order -> Order -> Bool #

Show Order Source # 

Methods

showsPrec :: Int -> Order -> ShowS #

show :: Order -> String #

showList :: [Order] -> ShowS #

ToJSON Order Source #

ToJSON Order

FromJSON Order Source #

FromJSON Order

HasBodyParam PlaceOrder Order Source #

Body Param "body" - order placed for purchasing the pet

Methods

setBodyParam :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => SwaggerPetstoreRequest PlaceOrder contentType res accept -> Order -> SwaggerPetstoreRequest PlaceOrder contentType res accept Source #

mkOrder :: Order Source #

Construct a value of type Order (by applying it's required fields, if any)

OuterBoolean

newtype OuterBoolean Source #

OuterBoolean

Constructors

OuterBoolean 

Fields

OuterComposite

mkOuterComposite :: OuterComposite Source #

Construct a value of type OuterComposite (by applying it's required fields, if any)

OuterNumber

OuterString

Pet

data Pet Source #

Pet

Constructors

Pet 

Fields

Instances

Eq Pet Source # 

Methods

(==) :: Pet -> Pet -> Bool #

(/=) :: Pet -> Pet -> Bool #

Show Pet Source # 

Methods

showsPrec :: Int -> Pet -> ShowS #

show :: Pet -> String #

showList :: [Pet] -> ShowS #

ToJSON Pet Source #

ToJSON Pet

FromJSON Pet Source #

FromJSON Pet

HasBodyParam UpdatePet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => SwaggerPetstoreRequest UpdatePet contentType res accept -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res accept Source #

HasBodyParam AddPet Pet Source #

Body Param "body" - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes AddPet contentType, MimeRender contentType Pet) => SwaggerPetstoreRequest AddPet contentType res accept -> Pet -> SwaggerPetstoreRequest AddPet contentType res accept Source #

mkPet Source #

Arguments

:: Text

petName

-> [Text]

petPhotoUrls

-> Pet 

Construct a value of type Pet (by applying it's required fields, if any)

ReadOnlyFirst

mkReadOnlyFirst :: ReadOnlyFirst Source #

Construct a value of type ReadOnlyFirst (by applying it's required fields, if any)

SpecialModelName

mkSpecialModelName :: SpecialModelName Source #

Construct a value of type SpecialModelName (by applying it's required fields, if any)

Tag

data Tag Source #

Tag

Constructors

Tag 

Fields

Instances

Eq Tag Source # 

Methods

(==) :: Tag -> Tag -> Bool #

(/=) :: Tag -> Tag -> Bool #

Show Tag Source # 

Methods

showsPrec :: Int -> Tag -> ShowS #

show :: Tag -> String #

showList :: [Tag] -> ShowS #

ToJSON Tag Source #

ToJSON Tag

FromJSON Tag Source #

FromJSON Tag

mkTag :: Tag Source #

Construct a value of type Tag (by applying it's required fields, if any)

User

data User Source #

User

Constructors

User 

Fields

Instances

Eq User Source # 

Methods

(==) :: User -> User -> Bool #

(/=) :: User -> User -> Bool #

Show User Source # 

Methods

showsPrec :: Int -> User -> ShowS #

show :: User -> String #

showList :: [User] -> ShowS #

ToJSON User Source #

ToJSON User

FromJSON User Source #

FromJSON User

HasBodyParam UpdateUser User Source #

Body Param "body" - Updated user object

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest UpdateUser contentType res accept -> User -> SwaggerPetstoreRequest UpdateUser contentType res accept Source #

HasBodyParam CreateUser User Source #

Body Param "body" - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => SwaggerPetstoreRequest CreateUser contentType res accept -> User -> SwaggerPetstoreRequest CreateUser contentType res accept Source #

mkUser :: User Source #

Construct a value of type User (by applying it's required fields, if any)

Cat

data Cat Source #

Cat

Constructors

Cat 

Fields

Instances

Eq Cat Source # 

Methods

(==) :: Cat -> Cat -> Bool #

(/=) :: Cat -> Cat -> Bool #

Show Cat Source # 

Methods

showsPrec :: Int -> Cat -> ShowS #

show :: Cat -> String #

showList :: [Cat] -> ShowS #

ToJSON Cat Source #

ToJSON Cat

FromJSON Cat Source #

FromJSON Cat

mkCat Source #

Arguments

:: Text

catClassName

-> Cat 

Construct a value of type Cat (by applying it's required fields, if any)

Dog

data Dog Source #

Dog

Constructors

Dog 

Fields

Instances

Eq Dog Source # 

Methods

(==) :: Dog -> Dog -> Bool #

(/=) :: Dog -> Dog -> Bool #

Show Dog Source # 

Methods

showsPrec :: Int -> Dog -> ShowS #

show :: Dog -> String #

showList :: [Dog] -> ShowS #

ToJSON Dog Source #

ToJSON Dog

FromJSON Dog Source #

FromJSON Dog

mkDog Source #

Arguments

:: Text

dogClassName

-> Dog 

Construct a value of type Dog (by applying it's required fields, if any)

Enums

E'ArrayEnum

data E'ArrayEnum Source #

Enum of Text

Constructors

E'ArrayEnum'Fish
"fish"
E'ArrayEnum'Crab
"crab"

Instances

Bounded E'ArrayEnum Source # 
Enum E'ArrayEnum Source # 
Eq E'ArrayEnum Source # 
Ord E'ArrayEnum Source # 
Show E'ArrayEnum Source # 
ToJSON E'ArrayEnum Source # 
FromJSON E'ArrayEnum Source # 
ToHttpApiData E'ArrayEnum Source # 
FromHttpApiData E'ArrayEnum Source # 
MimeRender MimeMultipartFormData E'ArrayEnum Source # 

E'EnumFormString

data E'EnumFormString Source #

Enum of Text

Instances

Bounded E'EnumFormString Source # 
Enum E'EnumFormString Source # 
Eq E'EnumFormString Source # 
Ord E'EnumFormString Source # 
Show E'EnumFormString Source # 
ToJSON E'EnumFormString Source # 
FromJSON E'EnumFormString Source # 
ToHttpApiData E'EnumFormString Source # 
FromHttpApiData E'EnumFormString Source # 
MimeRender MimeMultipartFormData E'EnumFormString Source # 

E'EnumInteger

data E'EnumInteger Source #

Enum of Int

Instances

Bounded E'EnumInteger Source # 
Enum E'EnumInteger Source # 
Eq E'EnumInteger Source # 
Ord E'EnumInteger Source # 
Show E'EnumInteger Source # 
ToJSON E'EnumInteger Source # 
FromJSON E'EnumInteger Source # 
ToHttpApiData E'EnumInteger Source # 
FromHttpApiData E'EnumInteger Source # 
MimeRender MimeMultipartFormData E'EnumInteger Source # 

E'EnumNumber

data E'EnumNumber Source #

Enum of Double

Instances

Bounded E'EnumNumber Source # 
Enum E'EnumNumber Source # 
Eq E'EnumNumber Source # 
Ord E'EnumNumber Source # 
Show E'EnumNumber Source # 
ToJSON E'EnumNumber Source # 
FromJSON E'EnumNumber Source # 
ToHttpApiData E'EnumNumber Source # 
FromHttpApiData E'EnumNumber Source # 
MimeRender MimeMultipartFormData E'EnumNumber Source # 

E'EnumQueryInteger

data E'EnumQueryInteger Source #

Enum of Int

Instances

Bounded E'EnumQueryInteger Source # 
Enum E'EnumQueryInteger Source # 
Eq E'EnumQueryInteger Source # 
Ord E'EnumQueryInteger Source # 
Show E'EnumQueryInteger Source # 
ToJSON E'EnumQueryInteger Source # 
FromJSON E'EnumQueryInteger Source # 
ToHttpApiData E'EnumQueryInteger Source # 
FromHttpApiData E'EnumQueryInteger Source # 
MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 

E'EnumString

data E'EnumString Source #

Enum of Text

Instances

Bounded E'EnumString Source # 
Enum E'EnumString Source # 
Eq E'EnumString Source # 
Ord E'EnumString Source # 
Show E'EnumString Source # 
ToJSON E'EnumString Source # 
FromJSON E'EnumString Source # 
ToHttpApiData E'EnumString Source # 
FromHttpApiData E'EnumString Source # 
MimeRender MimeMultipartFormData E'EnumString Source # 

E'Inner

data E'Inner Source #

Enum of Text

Instances

Bounded E'Inner Source # 
Enum E'Inner Source # 
Eq E'Inner Source # 

Methods

(==) :: E'Inner -> E'Inner -> Bool #

(/=) :: E'Inner -> E'Inner -> Bool #

Ord E'Inner Source # 
Show E'Inner Source # 
ToJSON E'Inner Source # 
FromJSON E'Inner Source # 
ToHttpApiData E'Inner Source # 
FromHttpApiData E'Inner Source # 
MimeRender MimeMultipartFormData E'Inner Source # 

E'Inner2

data E'Inner2 Source #

Enum of Text

Instances

Bounded E'Inner2 Source # 
Enum E'Inner2 Source # 
Eq E'Inner2 Source # 
Ord E'Inner2 Source # 
Show E'Inner2 Source # 
ToJSON E'Inner2 Source # 
FromJSON E'Inner2 Source # 
ToHttpApiData E'Inner2 Source # 
FromHttpApiData E'Inner2 Source # 
MimeRender MimeMultipartFormData E'Inner2 Source # 

E'JustSymbol

data E'JustSymbol Source #

Enum of Text

Instances

Bounded E'JustSymbol Source # 
Enum E'JustSymbol Source # 
Eq E'JustSymbol Source # 
Ord E'JustSymbol Source # 
Show E'JustSymbol Source # 
ToJSON E'JustSymbol Source # 
FromJSON E'JustSymbol Source # 
ToHttpApiData E'JustSymbol Source # 
FromHttpApiData E'JustSymbol Source # 
MimeRender MimeMultipartFormData E'JustSymbol Source # 

E'Status

data E'Status Source #

Enum of Text . + Order Status

Constructors

E'Status'Placed
"placed"
E'Status'Approved
"approved"
E'Status'Delivered
"delivered"

Instances

Bounded E'Status Source # 
Enum E'Status Source # 
Eq E'Status Source # 
Ord E'Status Source # 
Show E'Status Source # 
ToJSON E'Status Source # 
FromJSON E'Status Source # 
ToHttpApiData E'Status Source # 
FromHttpApiData E'Status Source # 
MimeRender MimeMultipartFormData E'Status Source # 

E'Status2

data E'Status2 Source #

Enum of Text . + pet status in the store

Constructors

E'Status2'Available
"available"
E'Status2'Pending
"pending"
E'Status2'Sold
"sold"

Instances

Bounded E'Status2 Source # 
Enum E'Status2 Source # 
Eq E'Status2 Source # 
Ord E'Status2 Source # 
Show E'Status2 Source # 
ToJSON E'Status2 Source # 
FromJSON E'Status2 Source # 
ToHttpApiData E'Status2 Source # 
FromHttpApiData E'Status2 Source # 
MimeRender MimeMultipartFormData E'Status2 Source # 

EnumClass

data EnumClass Source #

Enum of Text

Constructors

EnumClass'_abc
"_abc"
EnumClass'_efg
"-efg"
EnumClass'_xyz
"(xyz)"

Instances

Bounded EnumClass Source # 
Enum EnumClass Source # 
Eq EnumClass Source # 
Ord EnumClass Source # 
Show EnumClass Source # 
ToJSON EnumClass Source # 
FromJSON EnumClass Source # 
ToHttpApiData EnumClass Source # 
FromHttpApiData EnumClass Source # 
MimeRender MimeMultipartFormData EnumClass Source # 

OuterEnum

data OuterEnum Source #

Enum of Text

Constructors

OuterEnum'Placed
"placed"
OuterEnum'Approved
"approved"
OuterEnum'Delivered
"delivered"

Instances

Bounded OuterEnum Source # 
Enum OuterEnum Source # 
Eq OuterEnum Source # 
Ord OuterEnum Source # 
Show OuterEnum Source # 
ToJSON OuterEnum Source # 
FromJSON OuterEnum Source # 
ToHttpApiData OuterEnum Source # 
FromHttpApiData OuterEnum Source # 
MimeRender MimeMultipartFormData OuterEnum Source # 

Auth Methods

AuthApiKeyApiKey

AuthApiKeyApiKeyQuery

AuthBasicHttpBasicTest

AuthOAuthPetstoreAuth

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-A.html b/samples/client/petstore/haskell-http-client/docs/doc-index-A.html index 6b0525d754b..f0262def934 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-A.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-A.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - A)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - A

Accept 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
addAuthMethodSwaggerPetstore.Core, SwaggerPetstore
addFormSwaggerPetstore.Core, SwaggerPetstore
AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AdditionalPropertiesClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapOfMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapOfMapPropertyLSwaggerPetstore.ModelLens, SwaggerPetstore
additionalPropertiesClassMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapPropertyLSwaggerPetstore.ModelLens, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
Animal 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
animalClassNameSwaggerPetstore.Model, SwaggerPetstore
animalClassNameLSwaggerPetstore.ModelLens, SwaggerPetstore
animalColorSwaggerPetstore.Model, SwaggerPetstore
animalColorLSwaggerPetstore.ModelLens, SwaggerPetstore
AnimalFarm 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AnyAuthMethod 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
ApiKey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.ModelLens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.ModelLens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.ModelLens, SwaggerPetstore
applyAuthMethodSwaggerPetstore.Core, SwaggerPetstore
applyOptionalParamSwaggerPetstore.Core, SwaggerPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
ArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
ArrayTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerLSwaggerPetstore.ModelLens, SwaggerPetstore
arrayTestArrayArrayOfModelSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfModelLSwaggerPetstore.ModelLens, SwaggerPetstore
arrayTestArrayOfStringSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayOfStringLSwaggerPetstore.ModelLens, SwaggerPetstore
AuthApiKeyApiKey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AuthApiKeyApiKeyQuery 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AuthBasicHttpBasicTest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AuthMethodSwaggerPetstore.Core, SwaggerPetstore
AuthMethodException 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
AuthOAuthPetstoreAuth 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - A

Accept 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
addAuthMethodSwaggerPetstore.Core, SwaggerPetstore
addFormSwaggerPetstore.Core, SwaggerPetstore
AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AdditionalPropertiesClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapOfMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapOfMapPropertyLSwaggerPetstore.ModelLens, SwaggerPetstore
additionalPropertiesClassMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapPropertyLSwaggerPetstore.ModelLens, SwaggerPetstore
AddPetSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
Animal 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
animalClassNameSwaggerPetstore.Model, SwaggerPetstore
animalClassNameLSwaggerPetstore.ModelLens, SwaggerPetstore
animalColorSwaggerPetstore.Model, SwaggerPetstore
animalColorLSwaggerPetstore.ModelLens, SwaggerPetstore
AnimalFarm 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AnyAuthMethod 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
ApiKey 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.ModelLens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.ModelLens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.ModelLens, SwaggerPetstore
applyAuthMethodSwaggerPetstore.Core, SwaggerPetstore
applyOptionalParamSwaggerPetstore.Core, SwaggerPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
ArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
ArrayTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerLSwaggerPetstore.ModelLens, SwaggerPetstore
arrayTestArrayArrayOfModelSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfModelLSwaggerPetstore.ModelLens, SwaggerPetstore
arrayTestArrayOfStringSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayOfStringLSwaggerPetstore.ModelLens, SwaggerPetstore
AuthApiKeyApiKey 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AuthApiKeyApiKeyQuery 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AuthBasicHttpBasicTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AuthMethodSwaggerPetstore.Core, SwaggerPetstore
AuthMethodException 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
AuthOAuthPetstoreAuth 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-All.html b/samples/client/petstore/haskell-http-client/docs/doc-index-All.html index c83eda77f87..2033b440cb9 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-All.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-All.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index

-&-SwaggerPetstore.Core, SwaggerPetstore
Accept 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
addAuthMethodSwaggerPetstore.Core, SwaggerPetstore
addFormSwaggerPetstore.Core, SwaggerPetstore
AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AdditionalPropertiesClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapOfMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapOfMapPropertyLSwaggerPetstore.ModelLens, SwaggerPetstore
additionalPropertiesClassMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapPropertyLSwaggerPetstore.ModelLens, SwaggerPetstore
AddPetSwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API, SwaggerPetstore
Animal 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
animalClassNameSwaggerPetstore.Model, SwaggerPetstore
animalClassNameLSwaggerPetstore.ModelLens, SwaggerPetstore
animalColorSwaggerPetstore.Model, SwaggerPetstore
animalColorLSwaggerPetstore.ModelLens, SwaggerPetstore
AnimalFarm 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AnyAuthMethod 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
ApiKey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.ModelLens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.ModelLens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.ModelLens, SwaggerPetstore
applyAuthMethodSwaggerPetstore.Core, SwaggerPetstore
applyOptionalParamSwaggerPetstore.Core, SwaggerPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
ArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
ArrayTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerLSwaggerPetstore.ModelLens, SwaggerPetstore
arrayTestArrayArrayOfModelSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfModelLSwaggerPetstore.ModelLens, SwaggerPetstore
arrayTestArrayOfStringSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayOfStringLSwaggerPetstore.ModelLens, SwaggerPetstore
AuthApiKeyApiKey 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AuthApiKeyApiKeyQuery 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AuthBasicHttpBasicTest 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
AuthMethodSwaggerPetstore.Core, SwaggerPetstore
AuthMethodException 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
AuthOAuthPetstoreAuth 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Binary 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
Body 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Byte 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ByteArray 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
Callback 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Capitalization 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
capitalizationAttNameSwaggerPetstore.Model, SwaggerPetstore
capitalizationAttNameLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationCapitalCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalCamelLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationCapitalSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalSnakeLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationScaEthFlowPointsSwaggerPetstore.Model, SwaggerPetstore
capitalizationScaEthFlowPointsLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationSmallCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallCamelLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationSmallSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallSnakeLSwaggerPetstore.ModelLens, SwaggerPetstore
Cat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
catClassNameSwaggerPetstore.Model, SwaggerPetstore
catClassNameLSwaggerPetstore.ModelLens, SwaggerPetstore
catColorSwaggerPetstore.Model, SwaggerPetstore
catColorLSwaggerPetstore.ModelLens, SwaggerPetstore
catDeclawedSwaggerPetstore.Model, SwaggerPetstore
catDeclawedLSwaggerPetstore.ModelLens, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.ModelLens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.ModelLens, SwaggerPetstore
ClassModel 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
classModelClassSwaggerPetstore.Model, SwaggerPetstore
classModelClassLSwaggerPetstore.ModelLens, SwaggerPetstore
Client 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
clientClientSwaggerPetstore.Model, SwaggerPetstore
clientClientLSwaggerPetstore.ModelLens, SwaggerPetstore
CollectionFormatSwaggerPetstore.Core, SwaggerPetstore
CommaSeparatedSwaggerPetstore.Core, SwaggerPetstore
configAuthMethodsSwaggerPetstore.Core, SwaggerPetstore
configHostSwaggerPetstore.Core, SwaggerPetstore
configLogContextSwaggerPetstore.Core, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Core, SwaggerPetstore
configUserAgentSwaggerPetstore.Core, SwaggerPetstore
configValidateAuthMethodsSwaggerPetstore.Core, SwaggerPetstore
ConsumesSwaggerPetstore.MimeTypes, SwaggerPetstore
ContentType 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
CreateUserSwaggerPetstore.API, SwaggerPetstore
createUserSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
Date 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
DateTime 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
DeleteOrderSwaggerPetstore.API, SwaggerPetstore
deleteOrderSwaggerPetstore.API, SwaggerPetstore
DeletePetSwaggerPetstore.API, SwaggerPetstore
deletePetSwaggerPetstore.API, SwaggerPetstore
DeleteUserSwaggerPetstore.API, SwaggerPetstore
deleteUserSwaggerPetstore.API, SwaggerPetstore
dispatchInitUnsafeSwaggerPetstore.Client, SwaggerPetstore
dispatchLbsSwaggerPetstore.Client, SwaggerPetstore
dispatchLbsUnsafeSwaggerPetstore.Client, SwaggerPetstore
dispatchMimeSwaggerPetstore.Client, SwaggerPetstore
dispatchMime'SwaggerPetstore.Client, SwaggerPetstore
Dog 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
dogBreedSwaggerPetstore.Model, SwaggerPetstore
dogBreedLSwaggerPetstore.ModelLens, SwaggerPetstore
dogClassNameSwaggerPetstore.Model, SwaggerPetstore
dogClassNameLSwaggerPetstore.ModelLens, SwaggerPetstore
dogColorSwaggerPetstore.Model, SwaggerPetstore
dogColorLSwaggerPetstore.ModelLens, SwaggerPetstore
E'ArrayEnumSwaggerPetstore.Model, SwaggerPetstore
E'ArrayEnum'CrabSwaggerPetstore.Model, SwaggerPetstore
E'ArrayEnum'FishSwaggerPetstore.Model, SwaggerPetstore
E'EnumFormStringSwaggerPetstore.Model, SwaggerPetstore
E'EnumFormString'_abcSwaggerPetstore.Model, SwaggerPetstore
E'EnumFormString'_efgSwaggerPetstore.Model, SwaggerPetstore
E'EnumFormString'_xyzSwaggerPetstore.Model, SwaggerPetstore
E'EnumIntegerSwaggerPetstore.Model, SwaggerPetstore
E'EnumInteger'Num1SwaggerPetstore.Model, SwaggerPetstore
E'EnumInteger'NumMinus_1SwaggerPetstore.Model, SwaggerPetstore
E'EnumNumberSwaggerPetstore.Model, SwaggerPetstore
E'EnumNumber'Num1_Dot_1SwaggerPetstore.Model, SwaggerPetstore
E'EnumNumber'NumMinus_1_Dot_2SwaggerPetstore.Model, SwaggerPetstore
E'EnumQueryIntegerSwaggerPetstore.Model, SwaggerPetstore
E'EnumQueryInteger'Num1SwaggerPetstore.Model, SwaggerPetstore
E'EnumQueryInteger'NumMinus_2SwaggerPetstore.Model, SwaggerPetstore
E'EnumStringSwaggerPetstore.Model, SwaggerPetstore
E'EnumString'EmptySwaggerPetstore.Model, SwaggerPetstore
E'EnumString'LowerSwaggerPetstore.Model, SwaggerPetstore
E'EnumString'UPPERSwaggerPetstore.Model, SwaggerPetstore
E'InnerSwaggerPetstore.Model, SwaggerPetstore
E'Inner'LowerSwaggerPetstore.Model, SwaggerPetstore
E'Inner'UPPERSwaggerPetstore.Model, SwaggerPetstore
E'Inner2SwaggerPetstore.Model, SwaggerPetstore
E'Inner2'DollarSwaggerPetstore.Model, SwaggerPetstore
E'Inner2'GreaterThanSwaggerPetstore.Model, SwaggerPetstore
E'JustSymbolSwaggerPetstore.Model, SwaggerPetstore
E'JustSymbol'DollarSwaggerPetstore.Model, SwaggerPetstore
E'JustSymbol'Greater_Than_Or_Equal_ToSwaggerPetstore.Model, SwaggerPetstore
E'StatusSwaggerPetstore.Model, SwaggerPetstore
E'Status'ApprovedSwaggerPetstore.Model, SwaggerPetstore
E'Status'DeliveredSwaggerPetstore.Model, SwaggerPetstore
E'Status'PlacedSwaggerPetstore.Model, SwaggerPetstore
E'Status2SwaggerPetstore.Model, SwaggerPetstore
E'Status2'AvailableSwaggerPetstore.Model, SwaggerPetstore
E'Status2'PendingSwaggerPetstore.Model, SwaggerPetstore
E'Status2'SoldSwaggerPetstore.Model, SwaggerPetstore
EnumArrays 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumSwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumLSwaggerPetstore.ModelLens, SwaggerPetstore
enumArraysJustSymbolSwaggerPetstore.Model, SwaggerPetstore
enumArraysJustSymbolLSwaggerPetstore.ModelLens, SwaggerPetstore
EnumClassSwaggerPetstore.Model, SwaggerPetstore
EnumClass'_abcSwaggerPetstore.Model, SwaggerPetstore
EnumClass'_efgSwaggerPetstore.Model, SwaggerPetstore
EnumClass'_xyzSwaggerPetstore.Model, SwaggerPetstore
EnumFormString 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
EnumFormStringArray 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
EnumHeaderString 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
EnumHeaderStringArray 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
EnumQueryDouble 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
EnumQueryInteger 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
EnumQueryString 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
EnumQueryStringArray 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
EnumTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumTestEnumIntegerSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumIntegerLSwaggerPetstore.ModelLens, SwaggerPetstore
enumTestEnumNumberSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
enumTestEnumStringSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumStringLSwaggerPetstore.ModelLens, SwaggerPetstore
enumTestOuterEnumSwaggerPetstore.Model, SwaggerPetstore
enumTestOuterEnumLSwaggerPetstore.ModelLens, SwaggerPetstore
FakeOuterBooleanSerializeSwaggerPetstore.API, SwaggerPetstore
fakeOuterBooleanSerializeSwaggerPetstore.API, SwaggerPetstore
FakeOuterCompositeSerializeSwaggerPetstore.API, SwaggerPetstore
fakeOuterCompositeSerializeSwaggerPetstore.API, SwaggerPetstore
FakeOuterNumberSerializeSwaggerPetstore.API, SwaggerPetstore
fakeOuterNumberSerializeSwaggerPetstore.API, SwaggerPetstore
FakeOuterStringSerializeSwaggerPetstore.API, SwaggerPetstore
fakeOuterStringSerializeSwaggerPetstore.API, SwaggerPetstore
File 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
FindPetsByStatusSwaggerPetstore.API, SwaggerPetstore
findPetsByStatusSwaggerPetstore.API, SwaggerPetstore
FindPetsByTagsSwaggerPetstore.API, SwaggerPetstore
findPetsByTagsSwaggerPetstore.API, SwaggerPetstore
FormatTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
formatTestBinarySwaggerPetstore.Model, SwaggerPetstore
formatTestBinaryLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestByteSwaggerPetstore.Model, SwaggerPetstore
formatTestByteLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestDateSwaggerPetstore.Model, SwaggerPetstore
formatTestDateLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestDateTimeSwaggerPetstore.Model, SwaggerPetstore
formatTestDateTimeLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestDoubleSwaggerPetstore.Model, SwaggerPetstore
formatTestDoubleLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestFloatSwaggerPetstore.Model, SwaggerPetstore
formatTestFloatLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestInt32SwaggerPetstore.Model, SwaggerPetstore
formatTestInt32LSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestInt64SwaggerPetstore.Model, SwaggerPetstore
formatTestInt64LSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestIntegerSwaggerPetstore.Model, SwaggerPetstore
formatTestIntegerLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestNumberSwaggerPetstore.Model, SwaggerPetstore
formatTestNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestPasswordSwaggerPetstore.Model, SwaggerPetstore
formatTestPasswordLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestStringSwaggerPetstore.Model, SwaggerPetstore
formatTestStringLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestUuidSwaggerPetstore.Model, SwaggerPetstore
formatTestUuidLSwaggerPetstore.ModelLens, SwaggerPetstore
fromE'ArrayEnumSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumFormStringSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumIntegerSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumNumberSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumQueryIntegerSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumStringSwaggerPetstore.Model, SwaggerPetstore
fromE'InnerSwaggerPetstore.Model, SwaggerPetstore
fromE'Inner2SwaggerPetstore.Model, SwaggerPetstore
fromE'JustSymbolSwaggerPetstore.Model, SwaggerPetstore
fromE'StatusSwaggerPetstore.Model, SwaggerPetstore
fromE'Status2SwaggerPetstore.Model, SwaggerPetstore
fromEnumClassSwaggerPetstore.Model, SwaggerPetstore
fromOuterEnumSwaggerPetstore.Model, SwaggerPetstore
GetInventorySwaggerPetstore.API, SwaggerPetstore
getInventorySwaggerPetstore.API, SwaggerPetstore
GetOrderByIdSwaggerPetstore.API, SwaggerPetstore
getOrderByIdSwaggerPetstore.API, SwaggerPetstore
GetPetByIdSwaggerPetstore.API, SwaggerPetstore
getPetByIdSwaggerPetstore.API, SwaggerPetstore
GetUserByNameSwaggerPetstore.API, SwaggerPetstore
getUserByNameSwaggerPetstore.API, SwaggerPetstore
HasBodyParamSwaggerPetstore.Core, SwaggerPetstore
HasOnlyReadOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarLSwaggerPetstore.ModelLens, SwaggerPetstore
hasOnlyReadOnlyFooSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyFooLSwaggerPetstore.ModelLens, SwaggerPetstore
HasOptionalParamSwaggerPetstore.Core, SwaggerPetstore
initLogContextSwaggerPetstore.Logging, SwaggerPetstore
InitRequest 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
Int32 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Int64 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Lens_SwaggerPetstore.Core, SwaggerPetstore
Lens_'SwaggerPetstore.Core, SwaggerPetstore
levelDebugSwaggerPetstore.Logging, SwaggerPetstore
levelErrorSwaggerPetstore.Logging, SwaggerPetstore
levelInfoSwaggerPetstore.Logging, SwaggerPetstore
LogContextSwaggerPetstore.Logging, SwaggerPetstore
logExceptionsSwaggerPetstore.Logging, SwaggerPetstore
LogExecSwaggerPetstore.Logging, SwaggerPetstore
LogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
LoginUserSwaggerPetstore.API, SwaggerPetstore
loginUserSwaggerPetstore.API, SwaggerPetstore
LogLevelSwaggerPetstore.Logging, SwaggerPetstore
LogoutUserSwaggerPetstore.API, SwaggerPetstore
logoutUserSwaggerPetstore.API, SwaggerPetstore
MapTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
mapTestMapMapOfStringSwaggerPetstore.Model, SwaggerPetstore
mapTestMapMapOfStringLSwaggerPetstore.ModelLens, SwaggerPetstore
mapTestMapOfEnumStringSwaggerPetstore.Model, SwaggerPetstore
mapTestMapOfEnumStringLSwaggerPetstore.ModelLens, SwaggerPetstore
MimeAny 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeError 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
mimeErrorSwaggerPetstore.Client, SwaggerPetstore
mimeErrorResponseSwaggerPetstore.Client, SwaggerPetstore
MimeFormUrlEncoded 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeJSON 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeJsonCharsetutf8 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
MimeMultipartFormData 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeNoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeOctetStream 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimePlainText 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeRenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRender'SwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRenderDefaultMultipartFormDataSwaggerPetstore.MimeTypes, SwaggerPetstore
MimeResult 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
mimeResultSwaggerPetstore.Client, SwaggerPetstore
mimeResultResponseSwaggerPetstore.Client, SwaggerPetstore
MimeTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeType'SwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypesSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypes'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeUnrenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeUnrenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeUnrender'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeXML 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeXmlCharsetutf8 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
MixedPropertiesAndAdditionalPropertiesClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassDateTimeSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassDateTimeLSwaggerPetstore.ModelLens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapLSwaggerPetstore.ModelLens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidLSwaggerPetstore.ModelLens, SwaggerPetstore
mkAdditionalPropertiesClassSwaggerPetstore.Model, SwaggerPetstore
mkAnimalSwaggerPetstore.Model, SwaggerPetstore
mkAnimalFarmSwaggerPetstore.Model, SwaggerPetstore
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkArrayOfArrayOfNumberOnlySwaggerPetstore.Model, SwaggerPetstore
mkArrayOfNumberOnlySwaggerPetstore.Model, SwaggerPetstore
mkArrayTestSwaggerPetstore.Model, SwaggerPetstore
mkCapitalizationSwaggerPetstore.Model, SwaggerPetstore
mkCatSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkClassModelSwaggerPetstore.Model, SwaggerPetstore
mkClientSwaggerPetstore.Model, SwaggerPetstore
mkDogSwaggerPetstore.Model, SwaggerPetstore
mkEnumArraysSwaggerPetstore.Model, SwaggerPetstore
mkEnumTestSwaggerPetstore.Model, SwaggerPetstore
mkFormatTestSwaggerPetstore.Model, SwaggerPetstore
mkHasOnlyReadOnlySwaggerPetstore.Model, SwaggerPetstore
mkMapTestSwaggerPetstore.Model, SwaggerPetstore
mkMixedPropertiesAndAdditionalPropertiesClassSwaggerPetstore.Model, SwaggerPetstore
mkModel200ResponseSwaggerPetstore.Model, SwaggerPetstore
mkModelListSwaggerPetstore.Model, SwaggerPetstore
mkModelReturnSwaggerPetstore.Model, SwaggerPetstore
mkNameSwaggerPetstore.Model, SwaggerPetstore
mkNumberOnlySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkOuterCompositeSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkReadOnlyFirstSwaggerPetstore.Model, SwaggerPetstore
mkSpecialModelNameSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
Model200Response 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
model200ResponseClassSwaggerPetstore.Model, SwaggerPetstore
model200ResponseClassLSwaggerPetstore.ModelLens, SwaggerPetstore
model200ResponseNameSwaggerPetstore.Model, SwaggerPetstore
model200ResponseNameLSwaggerPetstore.ModelLens, SwaggerPetstore
ModelList 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelList123ListSwaggerPetstore.Model, SwaggerPetstore
modelList123ListLSwaggerPetstore.ModelLens, SwaggerPetstore
ModelReturn 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnSwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnLSwaggerPetstore.ModelLens, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.Core, SwaggerPetstore
Name 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
name123NumberSwaggerPetstore.Model, SwaggerPetstore
name123NumberLSwaggerPetstore.ModelLens, SwaggerPetstore
Name2 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
nameNameSwaggerPetstore.Model, SwaggerPetstore
nameNameLSwaggerPetstore.ModelLens, SwaggerPetstore
namePropertySwaggerPetstore.Model, SwaggerPetstore
namePropertyLSwaggerPetstore.ModelLens, SwaggerPetstore
nameSnakeCaseSwaggerPetstore.Model, SwaggerPetstore
nameSnakeCaseLSwaggerPetstore.ModelLens, SwaggerPetstore
newConfigSwaggerPetstore.Core, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
Number 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
NumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
numberOnlyJustNumberSwaggerPetstore.Model, SwaggerPetstore
numberOnlyJustNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.ModelLens, SwaggerPetstore
OrderId 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.ModelLens, SwaggerPetstore
OrderIdText 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.ModelLens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.ModelLens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.ModelLens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.ModelLens, SwaggerPetstore
OuterBoolean 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
OuterComposite 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyBooleanSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyBooleanLSwaggerPetstore.ModelLens, SwaggerPetstore
outerCompositeMyNumberSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
outerCompositeMyStringSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyStringLSwaggerPetstore.ModelLens, SwaggerPetstore
OuterEnumSwaggerPetstore.Model, SwaggerPetstore
OuterEnum'ApprovedSwaggerPetstore.Model, SwaggerPetstore
OuterEnum'DeliveredSwaggerPetstore.Model, SwaggerPetstore
OuterEnum'PlacedSwaggerPetstore.Model, SwaggerPetstore
OuterNumber 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
OuterString 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Param 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Param2 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ParamBinary 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ParamBodySwaggerPetstore.Core, SwaggerPetstore
ParamBodyBSwaggerPetstore.Core, SwaggerPetstore
ParamBodyBLSwaggerPetstore.Core, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.Core, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.Core, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.Core, SwaggerPetstore
ParamDate 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ParamDateTime 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ParamDouble 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ParamFloat 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ParamInteger 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
paramsBodySwaggerPetstore.Core, SwaggerPetstore
paramsBodyLSwaggerPetstore.Core, SwaggerPetstore
paramsHeadersSwaggerPetstore.Core, SwaggerPetstore
paramsHeadersLSwaggerPetstore.Core, SwaggerPetstore
paramsQuerySwaggerPetstore.Core, SwaggerPetstore
paramsQueryLSwaggerPetstore.Core, SwaggerPetstore
ParamString 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Password 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
PatternWithoutDelimiter 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.ModelLens, SwaggerPetstore
PetId 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.ModelLens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.ModelLens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.ModelLens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.ModelLens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.ModelLens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.Core, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
rAuthTypesSwaggerPetstore.Core, SwaggerPetstore
rAuthTypesLSwaggerPetstore.Core, SwaggerPetstore
ReadOnlyFirst 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarLSwaggerPetstore.ModelLens, SwaggerPetstore
readOnlyFirstBazSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBazLSwaggerPetstore.ModelLens, SwaggerPetstore
removeHeaderSwaggerPetstore.Core, SwaggerPetstore
rMethodSwaggerPetstore.Core, SwaggerPetstore
rMethodLSwaggerPetstore.Core, SwaggerPetstore
rParamsSwaggerPetstore.Core, SwaggerPetstore
rParamsLSwaggerPetstore.Core, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.Core, SwaggerPetstore
rUrlPathLSwaggerPetstore.Core, SwaggerPetstore
setBodyParamSwaggerPetstore.Core, SwaggerPetstore
setHeaderSwaggerPetstore.Core, SwaggerPetstore
setQuerySwaggerPetstore.Core, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.Core, SwaggerPetstore
SpecialModelName 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameSwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameLSwaggerPetstore.ModelLens, SwaggerPetstore
Status 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
StatusText 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
stderrLoggingContextSwaggerPetstore.Logging, SwaggerPetstore
stderrLoggingExecSwaggerPetstore.Logging, SwaggerPetstore
stdoutLoggingContextSwaggerPetstore.Logging, SwaggerPetstore
stdoutLoggingExecSwaggerPetstore.Logging, SwaggerPetstore
SwaggerPetstoreConfig 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
TabSeparatedSwaggerPetstore.Core, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.ModelLens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.ModelLens, SwaggerPetstore
Tags 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
TestClassnameSwaggerPetstore.API, SwaggerPetstore
testClassnameSwaggerPetstore.API, SwaggerPetstore
TestClientModelSwaggerPetstore.API, SwaggerPetstore
testClientModelSwaggerPetstore.API, SwaggerPetstore
TestEndpointParametersSwaggerPetstore.API, SwaggerPetstore
testEndpointParametersSwaggerPetstore.API, SwaggerPetstore
TestEnumParametersSwaggerPetstore.API, SwaggerPetstore
testEnumParametersSwaggerPetstore.API, SwaggerPetstore
TestInlineAdditionalPropertiesSwaggerPetstore.API, SwaggerPetstore
testInlineAdditionalPropertiesSwaggerPetstore.API, SwaggerPetstore
TestJsonFormDataSwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API, SwaggerPetstore
toE'ArrayEnumSwaggerPetstore.Model, SwaggerPetstore
toE'EnumFormStringSwaggerPetstore.Model, SwaggerPetstore
toE'EnumIntegerSwaggerPetstore.Model, SwaggerPetstore
toE'EnumNumberSwaggerPetstore.Model, SwaggerPetstore
toE'EnumQueryIntegerSwaggerPetstore.Model, SwaggerPetstore
toE'EnumStringSwaggerPetstore.Model, SwaggerPetstore
toE'InnerSwaggerPetstore.Model, SwaggerPetstore
toE'Inner2SwaggerPetstore.Model, SwaggerPetstore
toE'JustSymbolSwaggerPetstore.Model, SwaggerPetstore
toE'StatusSwaggerPetstore.Model, SwaggerPetstore
toE'Status2SwaggerPetstore.Model, SwaggerPetstore
toEnumClassSwaggerPetstore.Model, SwaggerPetstore
toFormSwaggerPetstore.Core, SwaggerPetstore
toFormCollSwaggerPetstore.Core, SwaggerPetstore
toHeaderSwaggerPetstore.Core, SwaggerPetstore
toHeaderCollSwaggerPetstore.Core, SwaggerPetstore
toOuterEnumSwaggerPetstore.Model, SwaggerPetstore
toPathSwaggerPetstore.Core, SwaggerPetstore
toQuerySwaggerPetstore.Core, SwaggerPetstore
toQueryCollSwaggerPetstore.Core, SwaggerPetstore
unAcceptSwaggerPetstore.MimeTypes, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiKeySwaggerPetstore.API, SwaggerPetstore
unBinarySwaggerPetstore.Core, SwaggerPetstore
unBodySwaggerPetstore.API, SwaggerPetstore
unByteSwaggerPetstore.API, SwaggerPetstore
unByteArraySwaggerPetstore.Core, SwaggerPetstore
unCallbackSwaggerPetstore.API, SwaggerPetstore
unContentTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
unDateSwaggerPetstore.Core, SwaggerPetstore
unDateTimeSwaggerPetstore.Core, SwaggerPetstore
unEnumFormStringSwaggerPetstore.API, SwaggerPetstore
unEnumFormStringArraySwaggerPetstore.API, SwaggerPetstore
unEnumHeaderStringSwaggerPetstore.API, SwaggerPetstore
unEnumHeaderStringArraySwaggerPetstore.API, SwaggerPetstore
unEnumQueryDoubleSwaggerPetstore.API, SwaggerPetstore
unEnumQueryIntegerSwaggerPetstore.API, SwaggerPetstore
unEnumQueryStringSwaggerPetstore.API, SwaggerPetstore
unEnumQueryStringArraySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unInt32SwaggerPetstore.API, SwaggerPetstore
unInt64SwaggerPetstore.API, SwaggerPetstore
unName2SwaggerPetstore.API, SwaggerPetstore
unNumberSwaggerPetstore.API, SwaggerPetstore
unOrderIdSwaggerPetstore.API, SwaggerPetstore
unOrderIdTextSwaggerPetstore.API, SwaggerPetstore
unOuterBooleanSwaggerPetstore.Model, SwaggerPetstore
unOuterNumberSwaggerPetstore.Model, SwaggerPetstore
unOuterStringSwaggerPetstore.Model, SwaggerPetstore
unParamSwaggerPetstore.API, SwaggerPetstore
unParam2SwaggerPetstore.API, SwaggerPetstore
unParamBinarySwaggerPetstore.API, SwaggerPetstore
unParamDateSwaggerPetstore.API, SwaggerPetstore
unParamDateTimeSwaggerPetstore.API, SwaggerPetstore
unParamDoubleSwaggerPetstore.API, SwaggerPetstore
unParamFloatSwaggerPetstore.API, SwaggerPetstore
unParamIntegerSwaggerPetstore.API, SwaggerPetstore
unParamStringSwaggerPetstore.API, SwaggerPetstore
unPasswordSwaggerPetstore.API, SwaggerPetstore
unPatternWithoutDelimiterSwaggerPetstore.API, SwaggerPetstore
unPetIdSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.API, SwaggerPetstore
unStatusTextSwaggerPetstore.API, SwaggerPetstore
unTagsSwaggerPetstore.API, SwaggerPetstore
unUsernameSwaggerPetstore.API, SwaggerPetstore
UpdatePetSwaggerPetstore.API, SwaggerPetstore
updatePetSwaggerPetstore.API, SwaggerPetstore
UpdatePetWithFormSwaggerPetstore.API, SwaggerPetstore
updatePetWithFormSwaggerPetstore.API, SwaggerPetstore
UpdateUserSwaggerPetstore.API, SwaggerPetstore
updateUserSwaggerPetstore.API, SwaggerPetstore
UploadFileSwaggerPetstore.API, SwaggerPetstore
uploadFileSwaggerPetstore.API, SwaggerPetstore
User 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userEmailSwaggerPetstore.Model, SwaggerPetstore
userEmailLSwaggerPetstore.ModelLens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.ModelLens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.ModelLens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.ModelLens, SwaggerPetstore
Username 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.ModelLens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.ModelLens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.ModelLens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.ModelLens, SwaggerPetstore
withNoLoggingSwaggerPetstore.Core, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Core, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Core, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.Core, SwaggerPetstore
_applyAuthMethodsSwaggerPetstore.Core, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Core, SwaggerPetstore
_hasAuthTypeSwaggerPetstore.Core, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Core, SwaggerPetstore
_mkParamsSwaggerPetstore.Core, SwaggerPetstore
_mkRequestSwaggerPetstore.Core, SwaggerPetstore
_omitNullsSwaggerPetstore.Core, SwaggerPetstore
_parseISO8601SwaggerPetstore.Core, SwaggerPetstore
_readBinaryBase64SwaggerPetstore.Core, SwaggerPetstore
_readByteArraySwaggerPetstore.Core, SwaggerPetstore
_readDateSwaggerPetstore.Core, SwaggerPetstore
_readDateTimeSwaggerPetstore.Core, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.Core, SwaggerPetstore
_setBodyBSSwaggerPetstore.Core, SwaggerPetstore
_setBodyLBSSwaggerPetstore.Core, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.Core, SwaggerPetstore
_showBinaryBase64SwaggerPetstore.Core, SwaggerPetstore
_showByteArraySwaggerPetstore.Core, SwaggerPetstore
_showDateSwaggerPetstore.Core, SwaggerPetstore
_showDateTimeSwaggerPetstore.Core, SwaggerPetstore
_toCollSwaggerPetstore.Core, SwaggerPetstore
_toCollASwaggerPetstore.Core, SwaggerPetstore
_toCollA'SwaggerPetstore.Core, SwaggerPetstore
_toFormItemSwaggerPetstore.Core, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index

-&-SwaggerPetstore.Core, SwaggerPetstore
Accept 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
addAuthMethodSwaggerPetstore.Core, SwaggerPetstore
addFormSwaggerPetstore.Core, SwaggerPetstore
AdditionalMetadata 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AdditionalPropertiesClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapOfMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapOfMapPropertyLSwaggerPetstore.ModelLens, SwaggerPetstore
additionalPropertiesClassMapPropertySwaggerPetstore.Model, SwaggerPetstore
additionalPropertiesClassMapPropertyLSwaggerPetstore.ModelLens, SwaggerPetstore
AddPetSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
addPetSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
Animal 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
animalClassNameSwaggerPetstore.Model, SwaggerPetstore
animalClassNameLSwaggerPetstore.ModelLens, SwaggerPetstore
animalColorSwaggerPetstore.Model, SwaggerPetstore
animalColorLSwaggerPetstore.ModelLens, SwaggerPetstore
AnimalFarm 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AnyAuthMethod 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
ApiKey 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
ApiResponse 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeSwaggerPetstore.Model, SwaggerPetstore
apiResponseCodeLSwaggerPetstore.ModelLens, SwaggerPetstore
apiResponseMessageSwaggerPetstore.Model, SwaggerPetstore
apiResponseMessageLSwaggerPetstore.ModelLens, SwaggerPetstore
apiResponseTypeSwaggerPetstore.Model, SwaggerPetstore
apiResponseTypeLSwaggerPetstore.ModelLens, SwaggerPetstore
applyAuthMethodSwaggerPetstore.Core, SwaggerPetstore
applyOptionalParamSwaggerPetstore.Core, SwaggerPetstore
ArrayOfArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfArrayOfNumberOnlyArrayArrayNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
ArrayOfNumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberSwaggerPetstore.Model, SwaggerPetstore
arrayOfNumberOnlyArrayNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
ArrayTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfIntegerLSwaggerPetstore.ModelLens, SwaggerPetstore
arrayTestArrayArrayOfModelSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayArrayOfModelLSwaggerPetstore.ModelLens, SwaggerPetstore
arrayTestArrayOfStringSwaggerPetstore.Model, SwaggerPetstore
arrayTestArrayOfStringLSwaggerPetstore.ModelLens, SwaggerPetstore
AuthApiKeyApiKey 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AuthApiKeyApiKeyQuery 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AuthBasicHttpBasicTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
AuthMethodSwaggerPetstore.Core, SwaggerPetstore
AuthMethodException 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
AuthOAuthPetstoreAuth 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Binary 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
Body 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Byte 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
ByteArray 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
Callback 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Capitalization 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
capitalizationAttNameSwaggerPetstore.Model, SwaggerPetstore
capitalizationAttNameLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationCapitalCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalCamelLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationCapitalSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalSnakeLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationScaEthFlowPointsSwaggerPetstore.Model, SwaggerPetstore
capitalizationScaEthFlowPointsLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationSmallCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallCamelLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationSmallSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallSnakeLSwaggerPetstore.ModelLens, SwaggerPetstore
Cat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
catClassNameSwaggerPetstore.Model, SwaggerPetstore
catClassNameLSwaggerPetstore.ModelLens, SwaggerPetstore
catColorSwaggerPetstore.Model, SwaggerPetstore
catColorLSwaggerPetstore.ModelLens, SwaggerPetstore
catDeclawedSwaggerPetstore.Model, SwaggerPetstore
catDeclawedLSwaggerPetstore.ModelLens, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.ModelLens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.ModelLens, SwaggerPetstore
ClassModel 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
classModelClassSwaggerPetstore.Model, SwaggerPetstore
classModelClassLSwaggerPetstore.ModelLens, SwaggerPetstore
Client 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
clientClientSwaggerPetstore.Model, SwaggerPetstore
clientClientLSwaggerPetstore.ModelLens, SwaggerPetstore
CollectionFormatSwaggerPetstore.Core, SwaggerPetstore
CommaSeparatedSwaggerPetstore.Core, SwaggerPetstore
configAuthMethodsSwaggerPetstore.Core, SwaggerPetstore
configHostSwaggerPetstore.Core, SwaggerPetstore
configLogContextSwaggerPetstore.Core, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Core, SwaggerPetstore
configUserAgentSwaggerPetstore.Core, SwaggerPetstore
configValidateAuthMethodsSwaggerPetstore.Core, SwaggerPetstore
ConsumesSwaggerPetstore.MimeTypes, SwaggerPetstore
ContentType 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
CreateUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
createUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
CreateUsersWithArrayInputSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
createUsersWithArrayInputSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
CreateUsersWithListInputSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
createUsersWithListInputSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
Date 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
DateTime 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
DeleteOrderSwaggerPetstore.API.Store, SwaggerPetstore.API, SwaggerPetstore
deleteOrderSwaggerPetstore.API.Store, SwaggerPetstore.API, SwaggerPetstore
DeletePetSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
deletePetSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
DeleteUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
deleteUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
dispatchInitUnsafeSwaggerPetstore.Client, SwaggerPetstore
dispatchLbsSwaggerPetstore.Client, SwaggerPetstore
dispatchLbsUnsafeSwaggerPetstore.Client, SwaggerPetstore
dispatchMimeSwaggerPetstore.Client, SwaggerPetstore
dispatchMime'SwaggerPetstore.Client, SwaggerPetstore
Dog 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
dogBreedSwaggerPetstore.Model, SwaggerPetstore
dogBreedLSwaggerPetstore.ModelLens, SwaggerPetstore
dogClassNameSwaggerPetstore.Model, SwaggerPetstore
dogClassNameLSwaggerPetstore.ModelLens, SwaggerPetstore
dogColorSwaggerPetstore.Model, SwaggerPetstore
dogColorLSwaggerPetstore.ModelLens, SwaggerPetstore
E'ArrayEnumSwaggerPetstore.Model, SwaggerPetstore
E'ArrayEnum'CrabSwaggerPetstore.Model, SwaggerPetstore
E'ArrayEnum'FishSwaggerPetstore.Model, SwaggerPetstore
E'EnumFormStringSwaggerPetstore.Model, SwaggerPetstore
E'EnumFormString'_abcSwaggerPetstore.Model, SwaggerPetstore
E'EnumFormString'_efgSwaggerPetstore.Model, SwaggerPetstore
E'EnumFormString'_xyzSwaggerPetstore.Model, SwaggerPetstore
E'EnumIntegerSwaggerPetstore.Model, SwaggerPetstore
E'EnumInteger'Num1SwaggerPetstore.Model, SwaggerPetstore
E'EnumInteger'NumMinus_1SwaggerPetstore.Model, SwaggerPetstore
E'EnumNumberSwaggerPetstore.Model, SwaggerPetstore
E'EnumNumber'Num1_Dot_1SwaggerPetstore.Model, SwaggerPetstore
E'EnumNumber'NumMinus_1_Dot_2SwaggerPetstore.Model, SwaggerPetstore
E'EnumQueryIntegerSwaggerPetstore.Model, SwaggerPetstore
E'EnumQueryInteger'Num1SwaggerPetstore.Model, SwaggerPetstore
E'EnumQueryInteger'NumMinus_2SwaggerPetstore.Model, SwaggerPetstore
E'EnumStringSwaggerPetstore.Model, SwaggerPetstore
E'EnumString'EmptySwaggerPetstore.Model, SwaggerPetstore
E'EnumString'LowerSwaggerPetstore.Model, SwaggerPetstore
E'EnumString'UPPERSwaggerPetstore.Model, SwaggerPetstore
E'InnerSwaggerPetstore.Model, SwaggerPetstore
E'Inner'LowerSwaggerPetstore.Model, SwaggerPetstore
E'Inner'UPPERSwaggerPetstore.Model, SwaggerPetstore
E'Inner2SwaggerPetstore.Model, SwaggerPetstore
E'Inner2'DollarSwaggerPetstore.Model, SwaggerPetstore
E'Inner2'GreaterThanSwaggerPetstore.Model, SwaggerPetstore
E'JustSymbolSwaggerPetstore.Model, SwaggerPetstore
E'JustSymbol'DollarSwaggerPetstore.Model, SwaggerPetstore
E'JustSymbol'Greater_Than_Or_Equal_ToSwaggerPetstore.Model, SwaggerPetstore
E'StatusSwaggerPetstore.Model, SwaggerPetstore
E'Status'ApprovedSwaggerPetstore.Model, SwaggerPetstore
E'Status'DeliveredSwaggerPetstore.Model, SwaggerPetstore
E'Status'PlacedSwaggerPetstore.Model, SwaggerPetstore
E'Status2SwaggerPetstore.Model, SwaggerPetstore
E'Status2'AvailableSwaggerPetstore.Model, SwaggerPetstore
E'Status2'PendingSwaggerPetstore.Model, SwaggerPetstore
E'Status2'SoldSwaggerPetstore.Model, SwaggerPetstore
EnumArrays 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumSwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumLSwaggerPetstore.ModelLens, SwaggerPetstore
enumArraysJustSymbolSwaggerPetstore.Model, SwaggerPetstore
enumArraysJustSymbolLSwaggerPetstore.ModelLens, SwaggerPetstore
EnumClassSwaggerPetstore.Model, SwaggerPetstore
EnumClass'_abcSwaggerPetstore.Model, SwaggerPetstore
EnumClass'_efgSwaggerPetstore.Model, SwaggerPetstore
EnumClass'_xyzSwaggerPetstore.Model, SwaggerPetstore
EnumFormString 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
EnumFormStringArray 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
EnumHeaderString 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
EnumHeaderStringArray 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
EnumQueryDouble 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
EnumQueryInteger 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
EnumQueryString 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
EnumQueryStringArray 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
EnumTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumTestEnumIntegerSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumIntegerLSwaggerPetstore.ModelLens, SwaggerPetstore
enumTestEnumNumberSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
enumTestEnumStringSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumStringLSwaggerPetstore.ModelLens, SwaggerPetstore
enumTestOuterEnumSwaggerPetstore.Model, SwaggerPetstore
enumTestOuterEnumLSwaggerPetstore.ModelLens, SwaggerPetstore
FakeOuterBooleanSerializeSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
fakeOuterBooleanSerializeSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
FakeOuterCompositeSerializeSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
fakeOuterCompositeSerializeSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
FakeOuterNumberSerializeSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
fakeOuterNumberSerializeSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
FakeOuterStringSerializeSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
fakeOuterStringSerializeSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
File 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
FindPetsByStatusSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
findPetsByStatusSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
FindPetsByTagsSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
findPetsByTagsSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
FormatTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
formatTestBinarySwaggerPetstore.Model, SwaggerPetstore
formatTestBinaryLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestByteSwaggerPetstore.Model, SwaggerPetstore
formatTestByteLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestDateSwaggerPetstore.Model, SwaggerPetstore
formatTestDateLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestDateTimeSwaggerPetstore.Model, SwaggerPetstore
formatTestDateTimeLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestDoubleSwaggerPetstore.Model, SwaggerPetstore
formatTestDoubleLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestFloatSwaggerPetstore.Model, SwaggerPetstore
formatTestFloatLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestInt32SwaggerPetstore.Model, SwaggerPetstore
formatTestInt32LSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestInt64SwaggerPetstore.Model, SwaggerPetstore
formatTestInt64LSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestIntegerSwaggerPetstore.Model, SwaggerPetstore
formatTestIntegerLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestNumberSwaggerPetstore.Model, SwaggerPetstore
formatTestNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestPasswordSwaggerPetstore.Model, SwaggerPetstore
formatTestPasswordLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestStringSwaggerPetstore.Model, SwaggerPetstore
formatTestStringLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestUuidSwaggerPetstore.Model, SwaggerPetstore
formatTestUuidLSwaggerPetstore.ModelLens, SwaggerPetstore
fromE'ArrayEnumSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumFormStringSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumIntegerSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumNumberSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumQueryIntegerSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumStringSwaggerPetstore.Model, SwaggerPetstore
fromE'InnerSwaggerPetstore.Model, SwaggerPetstore
fromE'Inner2SwaggerPetstore.Model, SwaggerPetstore
fromE'JustSymbolSwaggerPetstore.Model, SwaggerPetstore
fromE'StatusSwaggerPetstore.Model, SwaggerPetstore
fromE'Status2SwaggerPetstore.Model, SwaggerPetstore
fromEnumClassSwaggerPetstore.Model, SwaggerPetstore
fromOuterEnumSwaggerPetstore.Model, SwaggerPetstore
GetInventorySwaggerPetstore.API.Store, SwaggerPetstore.API, SwaggerPetstore
getInventorySwaggerPetstore.API.Store, SwaggerPetstore.API, SwaggerPetstore
GetOrderByIdSwaggerPetstore.API.Store, SwaggerPetstore.API, SwaggerPetstore
getOrderByIdSwaggerPetstore.API.Store, SwaggerPetstore.API, SwaggerPetstore
GetPetByIdSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
getPetByIdSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
GetUserByNameSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
getUserByNameSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
HasBodyParamSwaggerPetstore.Core, SwaggerPetstore
HasOnlyReadOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyBarLSwaggerPetstore.ModelLens, SwaggerPetstore
hasOnlyReadOnlyFooSwaggerPetstore.Model, SwaggerPetstore
hasOnlyReadOnlyFooLSwaggerPetstore.ModelLens, SwaggerPetstore
HasOptionalParamSwaggerPetstore.Core, SwaggerPetstore
initLogContextSwaggerPetstore.Logging, SwaggerPetstore
InitRequest 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
Int32 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Int64 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Lens_SwaggerPetstore.Core, SwaggerPetstore
Lens_'SwaggerPetstore.Core, SwaggerPetstore
levelDebugSwaggerPetstore.Logging, SwaggerPetstore
levelErrorSwaggerPetstore.Logging, SwaggerPetstore
levelInfoSwaggerPetstore.Logging, SwaggerPetstore
LogContextSwaggerPetstore.Logging, SwaggerPetstore
logExceptionsSwaggerPetstore.Logging, SwaggerPetstore
LogExecSwaggerPetstore.Logging, SwaggerPetstore
LogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
LoginUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
loginUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
LogLevelSwaggerPetstore.Logging, SwaggerPetstore
LogoutUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
logoutUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
MapTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
mapTestMapMapOfStringSwaggerPetstore.Model, SwaggerPetstore
mapTestMapMapOfStringLSwaggerPetstore.ModelLens, SwaggerPetstore
mapTestMapOfEnumStringSwaggerPetstore.Model, SwaggerPetstore
mapTestMapOfEnumStringLSwaggerPetstore.ModelLens, SwaggerPetstore
MimeAny 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeError 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
mimeErrorSwaggerPetstore.Client, SwaggerPetstore
mimeErrorResponseSwaggerPetstore.Client, SwaggerPetstore
MimeFormUrlEncoded 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeJSON 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeJsonCharsetutf8 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeMultipartFormData 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeNoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeOctetStream 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimePlainText 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeRenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRender'SwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRenderDefaultMultipartFormDataSwaggerPetstore.MimeTypes, SwaggerPetstore
MimeResult 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
mimeResultSwaggerPetstore.Client, SwaggerPetstore
mimeResultResponseSwaggerPetstore.Client, SwaggerPetstore
MimeTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeType'SwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypesSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypes'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeUnrenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeUnrenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeUnrender'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeXML 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeXmlCharsetutf8 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MixedPropertiesAndAdditionalPropertiesClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassDateTimeSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassDateTimeLSwaggerPetstore.ModelLens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapLSwaggerPetstore.ModelLens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidLSwaggerPetstore.ModelLens, SwaggerPetstore
mkAdditionalPropertiesClassSwaggerPetstore.Model, SwaggerPetstore
mkAnimalSwaggerPetstore.Model, SwaggerPetstore
mkAnimalFarmSwaggerPetstore.Model, SwaggerPetstore
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkArrayOfArrayOfNumberOnlySwaggerPetstore.Model, SwaggerPetstore
mkArrayOfNumberOnlySwaggerPetstore.Model, SwaggerPetstore
mkArrayTestSwaggerPetstore.Model, SwaggerPetstore
mkCapitalizationSwaggerPetstore.Model, SwaggerPetstore
mkCatSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkClassModelSwaggerPetstore.Model, SwaggerPetstore
mkClientSwaggerPetstore.Model, SwaggerPetstore
mkDogSwaggerPetstore.Model, SwaggerPetstore
mkEnumArraysSwaggerPetstore.Model, SwaggerPetstore
mkEnumTestSwaggerPetstore.Model, SwaggerPetstore
mkFormatTestSwaggerPetstore.Model, SwaggerPetstore
mkHasOnlyReadOnlySwaggerPetstore.Model, SwaggerPetstore
mkMapTestSwaggerPetstore.Model, SwaggerPetstore
mkMixedPropertiesAndAdditionalPropertiesClassSwaggerPetstore.Model, SwaggerPetstore
mkModel200ResponseSwaggerPetstore.Model, SwaggerPetstore
mkModelListSwaggerPetstore.Model, SwaggerPetstore
mkModelReturnSwaggerPetstore.Model, SwaggerPetstore
mkNameSwaggerPetstore.Model, SwaggerPetstore
mkNumberOnlySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkOuterCompositeSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkReadOnlyFirstSwaggerPetstore.Model, SwaggerPetstore
mkSpecialModelNameSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
Model200Response 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
model200ResponseClassSwaggerPetstore.Model, SwaggerPetstore
model200ResponseClassLSwaggerPetstore.ModelLens, SwaggerPetstore
model200ResponseNameSwaggerPetstore.Model, SwaggerPetstore
model200ResponseNameLSwaggerPetstore.ModelLens, SwaggerPetstore
ModelList 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelList123ListSwaggerPetstore.Model, SwaggerPetstore
modelList123ListLSwaggerPetstore.ModelLens, SwaggerPetstore
ModelReturn 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnSwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnLSwaggerPetstore.ModelLens, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.Core, SwaggerPetstore
Name 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
name123NumberSwaggerPetstore.Model, SwaggerPetstore
name123NumberLSwaggerPetstore.ModelLens, SwaggerPetstore
Name2 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
nameNameSwaggerPetstore.Model, SwaggerPetstore
nameNameLSwaggerPetstore.ModelLens, SwaggerPetstore
namePropertySwaggerPetstore.Model, SwaggerPetstore
namePropertyLSwaggerPetstore.ModelLens, SwaggerPetstore
nameSnakeCaseSwaggerPetstore.Model, SwaggerPetstore
nameSnakeCaseLSwaggerPetstore.ModelLens, SwaggerPetstore
newConfigSwaggerPetstore.Core, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
Number 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
NumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
numberOnlyJustNumberSwaggerPetstore.Model, SwaggerPetstore
numberOnlyJustNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.ModelLens, SwaggerPetstore
OrderId 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.ModelLens, SwaggerPetstore
OrderIdText 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.ModelLens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.ModelLens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.ModelLens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.ModelLens, SwaggerPetstore
OuterBoolean 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
OuterComposite 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyBooleanSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyBooleanLSwaggerPetstore.ModelLens, SwaggerPetstore
outerCompositeMyNumberSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
outerCompositeMyStringSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyStringLSwaggerPetstore.ModelLens, SwaggerPetstore
OuterEnumSwaggerPetstore.Model, SwaggerPetstore
OuterEnum'ApprovedSwaggerPetstore.Model, SwaggerPetstore
OuterEnum'DeliveredSwaggerPetstore.Model, SwaggerPetstore
OuterEnum'PlacedSwaggerPetstore.Model, SwaggerPetstore
OuterNumber 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
OuterString 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Param 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Param2 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
ParamBinary 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
ParamBodySwaggerPetstore.Core, SwaggerPetstore
ParamBodyBSwaggerPetstore.Core, SwaggerPetstore
ParamBodyBLSwaggerPetstore.Core, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.Core, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.Core, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.Core, SwaggerPetstore
ParamDate 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
ParamDateTime 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
ParamDouble 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
ParamFloat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
ParamInteger 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
paramsBodySwaggerPetstore.Core, SwaggerPetstore
paramsBodyLSwaggerPetstore.Core, SwaggerPetstore
paramsHeadersSwaggerPetstore.Core, SwaggerPetstore
paramsHeadersLSwaggerPetstore.Core, SwaggerPetstore
paramsQuerySwaggerPetstore.Core, SwaggerPetstore
paramsQueryLSwaggerPetstore.Core, SwaggerPetstore
ParamString 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Password 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
PatternWithoutDelimiter 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.ModelLens, SwaggerPetstore
PetId 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.ModelLens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.ModelLens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.ModelLens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.ModelLens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.ModelLens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.Core, SwaggerPetstore
PlaceOrderSwaggerPetstore.API.Store, SwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API.Store, SwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
rAuthTypesSwaggerPetstore.Core, SwaggerPetstore
rAuthTypesLSwaggerPetstore.Core, SwaggerPetstore
ReadOnlyFirst 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBarLSwaggerPetstore.ModelLens, SwaggerPetstore
readOnlyFirstBazSwaggerPetstore.Model, SwaggerPetstore
readOnlyFirstBazLSwaggerPetstore.ModelLens, SwaggerPetstore
removeHeaderSwaggerPetstore.Core, SwaggerPetstore
rMethodSwaggerPetstore.Core, SwaggerPetstore
rMethodLSwaggerPetstore.Core, SwaggerPetstore
rParamsSwaggerPetstore.Core, SwaggerPetstore
rParamsLSwaggerPetstore.Core, SwaggerPetstore
runConfigLogSwaggerPetstore.Client, SwaggerPetstore
runConfigLogWithExceptionsSwaggerPetstore.Client, SwaggerPetstore
runDefaultLogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
runNullLogExecSwaggerPetstore.Logging, SwaggerPetstore
rUrlPathSwaggerPetstore.Core, SwaggerPetstore
rUrlPathLSwaggerPetstore.Core, SwaggerPetstore
setBodyParamSwaggerPetstore.Core, SwaggerPetstore
setHeaderSwaggerPetstore.Core, SwaggerPetstore
setQuerySwaggerPetstore.Core, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.Core, SwaggerPetstore
SpecialModelName 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameSwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameLSwaggerPetstore.ModelLens, SwaggerPetstore
Status 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
StatusText 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
stderrLoggingContextSwaggerPetstore.Logging, SwaggerPetstore
stderrLoggingExecSwaggerPetstore.Logging, SwaggerPetstore
stdoutLoggingContextSwaggerPetstore.Logging, SwaggerPetstore
stdoutLoggingExecSwaggerPetstore.Logging, SwaggerPetstore
SwaggerPetstoreConfig 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
TabSeparatedSwaggerPetstore.Core, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.ModelLens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.ModelLens, SwaggerPetstore
Tags 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
TestClassnameSwaggerPetstore.API.FakeClassnameTags123, SwaggerPetstore.API, SwaggerPetstore
testClassnameSwaggerPetstore.API.FakeClassnameTags123, SwaggerPetstore.API, SwaggerPetstore
TestClientModelSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
testClientModelSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
TestEndpointParametersSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
testEndpointParametersSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
TestEnumParametersSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
testEnumParametersSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
TestInlineAdditionalPropertiesSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
testInlineAdditionalPropertiesSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
TestJsonFormDataSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API.AnotherFake, SwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API.AnotherFake, SwaggerPetstore.API, SwaggerPetstore
toE'ArrayEnumSwaggerPetstore.Model, SwaggerPetstore
toE'EnumFormStringSwaggerPetstore.Model, SwaggerPetstore
toE'EnumIntegerSwaggerPetstore.Model, SwaggerPetstore
toE'EnumNumberSwaggerPetstore.Model, SwaggerPetstore
toE'EnumQueryIntegerSwaggerPetstore.Model, SwaggerPetstore
toE'EnumStringSwaggerPetstore.Model, SwaggerPetstore
toE'InnerSwaggerPetstore.Model, SwaggerPetstore
toE'Inner2SwaggerPetstore.Model, SwaggerPetstore
toE'JustSymbolSwaggerPetstore.Model, SwaggerPetstore
toE'StatusSwaggerPetstore.Model, SwaggerPetstore
toE'Status2SwaggerPetstore.Model, SwaggerPetstore
toEnumClassSwaggerPetstore.Model, SwaggerPetstore
toFormSwaggerPetstore.Core, SwaggerPetstore
toFormCollSwaggerPetstore.Core, SwaggerPetstore
toHeaderSwaggerPetstore.Core, SwaggerPetstore
toHeaderCollSwaggerPetstore.Core, SwaggerPetstore
toOuterEnumSwaggerPetstore.Model, SwaggerPetstore
toPathSwaggerPetstore.Core, SwaggerPetstore
toQuerySwaggerPetstore.Core, SwaggerPetstore
toQueryCollSwaggerPetstore.Core, SwaggerPetstore
unAcceptSwaggerPetstore.MimeTypes, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.Model, SwaggerPetstore
unApiKeySwaggerPetstore.Model, SwaggerPetstore
unBinarySwaggerPetstore.Core, SwaggerPetstore
unBodySwaggerPetstore.Model, SwaggerPetstore
unByteSwaggerPetstore.Model, SwaggerPetstore
unByteArraySwaggerPetstore.Core, SwaggerPetstore
unCallbackSwaggerPetstore.Model, SwaggerPetstore
unContentTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
unDateSwaggerPetstore.Core, SwaggerPetstore
unDateTimeSwaggerPetstore.Core, SwaggerPetstore
unEnumFormStringSwaggerPetstore.Model, SwaggerPetstore
unEnumFormStringArraySwaggerPetstore.Model, SwaggerPetstore
unEnumHeaderStringSwaggerPetstore.Model, SwaggerPetstore
unEnumHeaderStringArraySwaggerPetstore.Model, SwaggerPetstore
unEnumQueryDoubleSwaggerPetstore.Model, SwaggerPetstore
unEnumQueryIntegerSwaggerPetstore.Model, SwaggerPetstore
unEnumQueryStringSwaggerPetstore.Model, SwaggerPetstore
unEnumQueryStringArraySwaggerPetstore.Model, SwaggerPetstore
unFileSwaggerPetstore.Model, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unInt32SwaggerPetstore.Model, SwaggerPetstore
unInt64SwaggerPetstore.Model, SwaggerPetstore
unName2SwaggerPetstore.Model, SwaggerPetstore
unNumberSwaggerPetstore.Model, SwaggerPetstore
unOrderIdSwaggerPetstore.Model, SwaggerPetstore
unOrderIdTextSwaggerPetstore.Model, SwaggerPetstore
unOuterBooleanSwaggerPetstore.Model, SwaggerPetstore
unOuterNumberSwaggerPetstore.Model, SwaggerPetstore
unOuterStringSwaggerPetstore.Model, SwaggerPetstore
unParamSwaggerPetstore.Model, SwaggerPetstore
unParam2SwaggerPetstore.Model, SwaggerPetstore
unParamBinarySwaggerPetstore.Model, SwaggerPetstore
unParamDateSwaggerPetstore.Model, SwaggerPetstore
unParamDateTimeSwaggerPetstore.Model, SwaggerPetstore
unParamDoubleSwaggerPetstore.Model, SwaggerPetstore
unParamFloatSwaggerPetstore.Model, SwaggerPetstore
unParamIntegerSwaggerPetstore.Model, SwaggerPetstore
unParamStringSwaggerPetstore.Model, SwaggerPetstore
unPasswordSwaggerPetstore.Model, SwaggerPetstore
unPatternWithoutDelimiterSwaggerPetstore.Model, SwaggerPetstore
unPetIdSwaggerPetstore.Model, SwaggerPetstore
unStatusSwaggerPetstore.Model, SwaggerPetstore
unStatusTextSwaggerPetstore.Model, SwaggerPetstore
unTagsSwaggerPetstore.Model, SwaggerPetstore
unUsernameSwaggerPetstore.Model, SwaggerPetstore
UpdatePetSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
updatePetSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
UpdatePetWithFormSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
updatePetWithFormSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
UpdateUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
updateUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
UploadFileSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
uploadFileSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
User 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userEmailSwaggerPetstore.Model, SwaggerPetstore
userEmailLSwaggerPetstore.ModelLens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.ModelLens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.ModelLens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.ModelLens, SwaggerPetstore
Username 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.ModelLens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.ModelLens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.ModelLens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.ModelLens, SwaggerPetstore
withNoLoggingSwaggerPetstore.Core, SwaggerPetstore
withStderrLoggingSwaggerPetstore.Core, SwaggerPetstore
withStdoutLoggingSwaggerPetstore.Core, SwaggerPetstore
_addMultiFormPartSwaggerPetstore.Core, SwaggerPetstore
_applyAuthMethodsSwaggerPetstore.Core, SwaggerPetstore
_emptyToNothingSwaggerPetstore.Core, SwaggerPetstore
_hasAuthTypeSwaggerPetstore.Core, SwaggerPetstore
_logSwaggerPetstore.Logging, SwaggerPetstore
_memptyToNothingSwaggerPetstore.Core, SwaggerPetstore
_mkParamsSwaggerPetstore.Core, SwaggerPetstore
_mkRequestSwaggerPetstore.Core, SwaggerPetstore
_omitNullsSwaggerPetstore.Core, SwaggerPetstore
_parseISO8601SwaggerPetstore.Core, SwaggerPetstore
_readBinaryBase64SwaggerPetstore.Core, SwaggerPetstore
_readByteArraySwaggerPetstore.Core, SwaggerPetstore
_readDateSwaggerPetstore.Core, SwaggerPetstore
_readDateTimeSwaggerPetstore.Core, SwaggerPetstore
_setAcceptHeaderSwaggerPetstore.Core, SwaggerPetstore
_setBodyBSSwaggerPetstore.Core, SwaggerPetstore
_setBodyLBSSwaggerPetstore.Core, SwaggerPetstore
_setContentTypeHeaderSwaggerPetstore.Core, SwaggerPetstore
_showBinaryBase64SwaggerPetstore.Core, SwaggerPetstore
_showByteArraySwaggerPetstore.Core, SwaggerPetstore
_showDateSwaggerPetstore.Core, SwaggerPetstore
_showDateTimeSwaggerPetstore.Core, SwaggerPetstore
_toCollSwaggerPetstore.Core, SwaggerPetstore
_toCollASwaggerPetstore.Core, SwaggerPetstore
_toCollA'SwaggerPetstore.Core, SwaggerPetstore
_toFormItemSwaggerPetstore.Core, SwaggerPetstore
_toInitRequestSwaggerPetstore.Client, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-B.html b/samples/client/petstore/haskell-http-client/docs/doc-index-B.html index 97a31accdb8..1a978e5b01b 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-B.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-B.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - B)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - B

Binary 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
Body 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Byte 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ByteArray 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - B

Binary 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
Body 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Byte 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
ByteArray 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-C.html b/samples/client/petstore/haskell-http-client/docs/doc-index-C.html index 113754b65a0..bc76365d20e 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-C.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-C.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - C)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - C

Callback 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Capitalization 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
capitalizationAttNameSwaggerPetstore.Model, SwaggerPetstore
capitalizationAttNameLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationCapitalCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalCamelLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationCapitalSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalSnakeLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationScaEthFlowPointsSwaggerPetstore.Model, SwaggerPetstore
capitalizationScaEthFlowPointsLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationSmallCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallCamelLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationSmallSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallSnakeLSwaggerPetstore.ModelLens, SwaggerPetstore
Cat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
catClassNameSwaggerPetstore.Model, SwaggerPetstore
catClassNameLSwaggerPetstore.ModelLens, SwaggerPetstore
catColorSwaggerPetstore.Model, SwaggerPetstore
catColorLSwaggerPetstore.ModelLens, SwaggerPetstore
catDeclawedSwaggerPetstore.Model, SwaggerPetstore
catDeclawedLSwaggerPetstore.ModelLens, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.ModelLens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.ModelLens, SwaggerPetstore
ClassModel 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
classModelClassSwaggerPetstore.Model, SwaggerPetstore
classModelClassLSwaggerPetstore.ModelLens, SwaggerPetstore
Client 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
clientClientSwaggerPetstore.Model, SwaggerPetstore
clientClientLSwaggerPetstore.ModelLens, SwaggerPetstore
CollectionFormatSwaggerPetstore.Core, SwaggerPetstore
CommaSeparatedSwaggerPetstore.Core, SwaggerPetstore
configAuthMethodsSwaggerPetstore.Core, SwaggerPetstore
configHostSwaggerPetstore.Core, SwaggerPetstore
configLogContextSwaggerPetstore.Core, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Core, SwaggerPetstore
configUserAgentSwaggerPetstore.Core, SwaggerPetstore
configValidateAuthMethodsSwaggerPetstore.Core, SwaggerPetstore
ConsumesSwaggerPetstore.MimeTypes, SwaggerPetstore
ContentType 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
CreateUserSwaggerPetstore.API, SwaggerPetstore
createUserSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithArrayInputSwaggerPetstore.API, SwaggerPetstore
CreateUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
createUsersWithListInputSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - C

Callback 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Capitalization 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
capitalizationAttNameSwaggerPetstore.Model, SwaggerPetstore
capitalizationAttNameLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationCapitalCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalCamelLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationCapitalSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationCapitalSnakeLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationScaEthFlowPointsSwaggerPetstore.Model, SwaggerPetstore
capitalizationScaEthFlowPointsLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationSmallCamelSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallCamelLSwaggerPetstore.ModelLens, SwaggerPetstore
capitalizationSmallSnakeSwaggerPetstore.Model, SwaggerPetstore
capitalizationSmallSnakeLSwaggerPetstore.ModelLens, SwaggerPetstore
Cat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
catClassNameSwaggerPetstore.Model, SwaggerPetstore
catClassNameLSwaggerPetstore.ModelLens, SwaggerPetstore
catColorSwaggerPetstore.Model, SwaggerPetstore
catColorLSwaggerPetstore.ModelLens, SwaggerPetstore
catDeclawedSwaggerPetstore.Model, SwaggerPetstore
catDeclawedLSwaggerPetstore.ModelLens, SwaggerPetstore
Category 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
categoryIdSwaggerPetstore.Model, SwaggerPetstore
categoryIdLSwaggerPetstore.ModelLens, SwaggerPetstore
categoryNameSwaggerPetstore.Model, SwaggerPetstore
categoryNameLSwaggerPetstore.ModelLens, SwaggerPetstore
ClassModel 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
classModelClassSwaggerPetstore.Model, SwaggerPetstore
classModelClassLSwaggerPetstore.ModelLens, SwaggerPetstore
Client 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
clientClientSwaggerPetstore.Model, SwaggerPetstore
clientClientLSwaggerPetstore.ModelLens, SwaggerPetstore
CollectionFormatSwaggerPetstore.Core, SwaggerPetstore
CommaSeparatedSwaggerPetstore.Core, SwaggerPetstore
configAuthMethodsSwaggerPetstore.Core, SwaggerPetstore
configHostSwaggerPetstore.Core, SwaggerPetstore
configLogContextSwaggerPetstore.Core, SwaggerPetstore
configLogExecWithContextSwaggerPetstore.Core, SwaggerPetstore
configUserAgentSwaggerPetstore.Core, SwaggerPetstore
configValidateAuthMethodsSwaggerPetstore.Core, SwaggerPetstore
ConsumesSwaggerPetstore.MimeTypes, SwaggerPetstore
ContentType 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
CreateUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
createUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
CreateUsersWithArrayInputSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
createUsersWithArrayInputSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
CreateUsersWithListInputSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
createUsersWithListInputSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-D.html b/samples/client/petstore/haskell-http-client/docs/doc-index-D.html index a4596012516..dff64c00917 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-D.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-D.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - D)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - D

Date 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
DateTime 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
DeleteOrderSwaggerPetstore.API, SwaggerPetstore
deleteOrderSwaggerPetstore.API, SwaggerPetstore
DeletePetSwaggerPetstore.API, SwaggerPetstore
deletePetSwaggerPetstore.API, SwaggerPetstore
DeleteUserSwaggerPetstore.API, SwaggerPetstore
deleteUserSwaggerPetstore.API, SwaggerPetstore
dispatchInitUnsafeSwaggerPetstore.Client, SwaggerPetstore
dispatchLbsSwaggerPetstore.Client, SwaggerPetstore
dispatchLbsUnsafeSwaggerPetstore.Client, SwaggerPetstore
dispatchMimeSwaggerPetstore.Client, SwaggerPetstore
dispatchMime'SwaggerPetstore.Client, SwaggerPetstore
Dog 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
dogBreedSwaggerPetstore.Model, SwaggerPetstore
dogBreedLSwaggerPetstore.ModelLens, SwaggerPetstore
dogClassNameSwaggerPetstore.Model, SwaggerPetstore
dogClassNameLSwaggerPetstore.ModelLens, SwaggerPetstore
dogColorSwaggerPetstore.Model, SwaggerPetstore
dogColorLSwaggerPetstore.ModelLens, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - D

Date 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
DateTime 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
DeleteOrderSwaggerPetstore.API.Store, SwaggerPetstore.API, SwaggerPetstore
deleteOrderSwaggerPetstore.API.Store, SwaggerPetstore.API, SwaggerPetstore
DeletePetSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
deletePetSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
DeleteUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
deleteUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
dispatchInitUnsafeSwaggerPetstore.Client, SwaggerPetstore
dispatchLbsSwaggerPetstore.Client, SwaggerPetstore
dispatchLbsUnsafeSwaggerPetstore.Client, SwaggerPetstore
dispatchMimeSwaggerPetstore.Client, SwaggerPetstore
dispatchMime'SwaggerPetstore.Client, SwaggerPetstore
Dog 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
dogBreedSwaggerPetstore.Model, SwaggerPetstore
dogBreedLSwaggerPetstore.ModelLens, SwaggerPetstore
dogClassNameSwaggerPetstore.Model, SwaggerPetstore
dogClassNameLSwaggerPetstore.ModelLens, SwaggerPetstore
dogColorSwaggerPetstore.Model, SwaggerPetstore
dogColorLSwaggerPetstore.ModelLens, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-E.html b/samples/client/petstore/haskell-http-client/docs/doc-index-E.html index b9c3a6ff375..e9f91f25bc6 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-E.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-E.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - E)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - E

E'ArrayEnumSwaggerPetstore.Model, SwaggerPetstore
E'ArrayEnum'CrabSwaggerPetstore.Model, SwaggerPetstore
E'ArrayEnum'FishSwaggerPetstore.Model, SwaggerPetstore
E'EnumFormStringSwaggerPetstore.Model, SwaggerPetstore
E'EnumFormString'_abcSwaggerPetstore.Model, SwaggerPetstore
E'EnumFormString'_efgSwaggerPetstore.Model, SwaggerPetstore
E'EnumFormString'_xyzSwaggerPetstore.Model, SwaggerPetstore
E'EnumIntegerSwaggerPetstore.Model, SwaggerPetstore
E'EnumInteger'Num1SwaggerPetstore.Model, SwaggerPetstore
E'EnumInteger'NumMinus_1SwaggerPetstore.Model, SwaggerPetstore
E'EnumNumberSwaggerPetstore.Model, SwaggerPetstore
E'EnumNumber'Num1_Dot_1SwaggerPetstore.Model, SwaggerPetstore
E'EnumNumber'NumMinus_1_Dot_2SwaggerPetstore.Model, SwaggerPetstore
E'EnumQueryIntegerSwaggerPetstore.Model, SwaggerPetstore
E'EnumQueryInteger'Num1SwaggerPetstore.Model, SwaggerPetstore
E'EnumQueryInteger'NumMinus_2SwaggerPetstore.Model, SwaggerPetstore
E'EnumStringSwaggerPetstore.Model, SwaggerPetstore
E'EnumString'EmptySwaggerPetstore.Model, SwaggerPetstore
E'EnumString'LowerSwaggerPetstore.Model, SwaggerPetstore
E'EnumString'UPPERSwaggerPetstore.Model, SwaggerPetstore
E'InnerSwaggerPetstore.Model, SwaggerPetstore
E'Inner'LowerSwaggerPetstore.Model, SwaggerPetstore
E'Inner'UPPERSwaggerPetstore.Model, SwaggerPetstore
E'Inner2SwaggerPetstore.Model, SwaggerPetstore
E'Inner2'DollarSwaggerPetstore.Model, SwaggerPetstore
E'Inner2'GreaterThanSwaggerPetstore.Model, SwaggerPetstore
E'JustSymbolSwaggerPetstore.Model, SwaggerPetstore
E'JustSymbol'DollarSwaggerPetstore.Model, SwaggerPetstore
E'JustSymbol'Greater_Than_Or_Equal_ToSwaggerPetstore.Model, SwaggerPetstore
E'StatusSwaggerPetstore.Model, SwaggerPetstore
E'Status'ApprovedSwaggerPetstore.Model, SwaggerPetstore
E'Status'DeliveredSwaggerPetstore.Model, SwaggerPetstore
E'Status'PlacedSwaggerPetstore.Model, SwaggerPetstore
E'Status2SwaggerPetstore.Model, SwaggerPetstore
E'Status2'AvailableSwaggerPetstore.Model, SwaggerPetstore
E'Status2'PendingSwaggerPetstore.Model, SwaggerPetstore
E'Status2'SoldSwaggerPetstore.Model, SwaggerPetstore
EnumArrays 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumSwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumLSwaggerPetstore.ModelLens, SwaggerPetstore
enumArraysJustSymbolSwaggerPetstore.Model, SwaggerPetstore
enumArraysJustSymbolLSwaggerPetstore.ModelLens, SwaggerPetstore
EnumClassSwaggerPetstore.Model, SwaggerPetstore
EnumClass'_abcSwaggerPetstore.Model, SwaggerPetstore
EnumClass'_efgSwaggerPetstore.Model, SwaggerPetstore
EnumClass'_xyzSwaggerPetstore.Model, SwaggerPetstore
EnumFormString 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
EnumFormStringArray 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
EnumHeaderString 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
EnumHeaderStringArray 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
EnumQueryDouble 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
EnumQueryInteger 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
EnumQueryString 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
EnumQueryStringArray 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
EnumTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumTestEnumIntegerSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumIntegerLSwaggerPetstore.ModelLens, SwaggerPetstore
enumTestEnumNumberSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
enumTestEnumStringSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumStringLSwaggerPetstore.ModelLens, SwaggerPetstore
enumTestOuterEnumSwaggerPetstore.Model, SwaggerPetstore
enumTestOuterEnumLSwaggerPetstore.ModelLens, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - E

E'ArrayEnumSwaggerPetstore.Model, SwaggerPetstore
E'ArrayEnum'CrabSwaggerPetstore.Model, SwaggerPetstore
E'ArrayEnum'FishSwaggerPetstore.Model, SwaggerPetstore
E'EnumFormStringSwaggerPetstore.Model, SwaggerPetstore
E'EnumFormString'_abcSwaggerPetstore.Model, SwaggerPetstore
E'EnumFormString'_efgSwaggerPetstore.Model, SwaggerPetstore
E'EnumFormString'_xyzSwaggerPetstore.Model, SwaggerPetstore
E'EnumIntegerSwaggerPetstore.Model, SwaggerPetstore
E'EnumInteger'Num1SwaggerPetstore.Model, SwaggerPetstore
E'EnumInteger'NumMinus_1SwaggerPetstore.Model, SwaggerPetstore
E'EnumNumberSwaggerPetstore.Model, SwaggerPetstore
E'EnumNumber'Num1_Dot_1SwaggerPetstore.Model, SwaggerPetstore
E'EnumNumber'NumMinus_1_Dot_2SwaggerPetstore.Model, SwaggerPetstore
E'EnumQueryIntegerSwaggerPetstore.Model, SwaggerPetstore
E'EnumQueryInteger'Num1SwaggerPetstore.Model, SwaggerPetstore
E'EnumQueryInteger'NumMinus_2SwaggerPetstore.Model, SwaggerPetstore
E'EnumStringSwaggerPetstore.Model, SwaggerPetstore
E'EnumString'EmptySwaggerPetstore.Model, SwaggerPetstore
E'EnumString'LowerSwaggerPetstore.Model, SwaggerPetstore
E'EnumString'UPPERSwaggerPetstore.Model, SwaggerPetstore
E'InnerSwaggerPetstore.Model, SwaggerPetstore
E'Inner'LowerSwaggerPetstore.Model, SwaggerPetstore
E'Inner'UPPERSwaggerPetstore.Model, SwaggerPetstore
E'Inner2SwaggerPetstore.Model, SwaggerPetstore
E'Inner2'DollarSwaggerPetstore.Model, SwaggerPetstore
E'Inner2'GreaterThanSwaggerPetstore.Model, SwaggerPetstore
E'JustSymbolSwaggerPetstore.Model, SwaggerPetstore
E'JustSymbol'DollarSwaggerPetstore.Model, SwaggerPetstore
E'JustSymbol'Greater_Than_Or_Equal_ToSwaggerPetstore.Model, SwaggerPetstore
E'StatusSwaggerPetstore.Model, SwaggerPetstore
E'Status'ApprovedSwaggerPetstore.Model, SwaggerPetstore
E'Status'DeliveredSwaggerPetstore.Model, SwaggerPetstore
E'Status'PlacedSwaggerPetstore.Model, SwaggerPetstore
E'Status2SwaggerPetstore.Model, SwaggerPetstore
E'Status2'AvailableSwaggerPetstore.Model, SwaggerPetstore
E'Status2'PendingSwaggerPetstore.Model, SwaggerPetstore
E'Status2'SoldSwaggerPetstore.Model, SwaggerPetstore
EnumArrays 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumSwaggerPetstore.Model, SwaggerPetstore
enumArraysArrayEnumLSwaggerPetstore.ModelLens, SwaggerPetstore
enumArraysJustSymbolSwaggerPetstore.Model, SwaggerPetstore
enumArraysJustSymbolLSwaggerPetstore.ModelLens, SwaggerPetstore
EnumClassSwaggerPetstore.Model, SwaggerPetstore
EnumClass'_abcSwaggerPetstore.Model, SwaggerPetstore
EnumClass'_efgSwaggerPetstore.Model, SwaggerPetstore
EnumClass'_xyzSwaggerPetstore.Model, SwaggerPetstore
EnumFormString 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
EnumFormStringArray 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
EnumHeaderString 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
EnumHeaderStringArray 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
EnumQueryDouble 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
EnumQueryInteger 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
EnumQueryString 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
EnumQueryStringArray 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
EnumTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
enumTestEnumIntegerSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumIntegerLSwaggerPetstore.ModelLens, SwaggerPetstore
enumTestEnumNumberSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
enumTestEnumStringSwaggerPetstore.Model, SwaggerPetstore
enumTestEnumStringLSwaggerPetstore.ModelLens, SwaggerPetstore
enumTestOuterEnumSwaggerPetstore.Model, SwaggerPetstore
enumTestOuterEnumLSwaggerPetstore.ModelLens, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-F.html b/samples/client/petstore/haskell-http-client/docs/doc-index-F.html index 46e7b74f907..f28da574f3b 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-F.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-F.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - F)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - F

FakeOuterBooleanSerializeSwaggerPetstore.API, SwaggerPetstore
fakeOuterBooleanSerializeSwaggerPetstore.API, SwaggerPetstore
FakeOuterCompositeSerializeSwaggerPetstore.API, SwaggerPetstore
fakeOuterCompositeSerializeSwaggerPetstore.API, SwaggerPetstore
FakeOuterNumberSerializeSwaggerPetstore.API, SwaggerPetstore
fakeOuterNumberSerializeSwaggerPetstore.API, SwaggerPetstore
FakeOuterStringSerializeSwaggerPetstore.API, SwaggerPetstore
fakeOuterStringSerializeSwaggerPetstore.API, SwaggerPetstore
File 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
FindPetsByStatusSwaggerPetstore.API, SwaggerPetstore
findPetsByStatusSwaggerPetstore.API, SwaggerPetstore
FindPetsByTagsSwaggerPetstore.API, SwaggerPetstore
findPetsByTagsSwaggerPetstore.API, SwaggerPetstore
FormatTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
formatTestBinarySwaggerPetstore.Model, SwaggerPetstore
formatTestBinaryLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestByteSwaggerPetstore.Model, SwaggerPetstore
formatTestByteLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestDateSwaggerPetstore.Model, SwaggerPetstore
formatTestDateLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestDateTimeSwaggerPetstore.Model, SwaggerPetstore
formatTestDateTimeLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestDoubleSwaggerPetstore.Model, SwaggerPetstore
formatTestDoubleLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestFloatSwaggerPetstore.Model, SwaggerPetstore
formatTestFloatLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestInt32SwaggerPetstore.Model, SwaggerPetstore
formatTestInt32LSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestInt64SwaggerPetstore.Model, SwaggerPetstore
formatTestInt64LSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestIntegerSwaggerPetstore.Model, SwaggerPetstore
formatTestIntegerLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestNumberSwaggerPetstore.Model, SwaggerPetstore
formatTestNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestPasswordSwaggerPetstore.Model, SwaggerPetstore
formatTestPasswordLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestStringSwaggerPetstore.Model, SwaggerPetstore
formatTestStringLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestUuidSwaggerPetstore.Model, SwaggerPetstore
formatTestUuidLSwaggerPetstore.ModelLens, SwaggerPetstore
fromE'ArrayEnumSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumFormStringSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumIntegerSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumNumberSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumQueryIntegerSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumStringSwaggerPetstore.Model, SwaggerPetstore
fromE'InnerSwaggerPetstore.Model, SwaggerPetstore
fromE'Inner2SwaggerPetstore.Model, SwaggerPetstore
fromE'JustSymbolSwaggerPetstore.Model, SwaggerPetstore
fromE'StatusSwaggerPetstore.Model, SwaggerPetstore
fromE'Status2SwaggerPetstore.Model, SwaggerPetstore
fromEnumClassSwaggerPetstore.Model, SwaggerPetstore
fromOuterEnumSwaggerPetstore.Model, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - F

FakeOuterBooleanSerializeSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
fakeOuterBooleanSerializeSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
FakeOuterCompositeSerializeSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
fakeOuterCompositeSerializeSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
FakeOuterNumberSerializeSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
fakeOuterNumberSerializeSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
FakeOuterStringSerializeSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
fakeOuterStringSerializeSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
File 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
FindPetsByStatusSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
findPetsByStatusSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
FindPetsByTagsSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
findPetsByTagsSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
FormatTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
formatTestBinarySwaggerPetstore.Model, SwaggerPetstore
formatTestBinaryLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestByteSwaggerPetstore.Model, SwaggerPetstore
formatTestByteLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestDateSwaggerPetstore.Model, SwaggerPetstore
formatTestDateLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestDateTimeSwaggerPetstore.Model, SwaggerPetstore
formatTestDateTimeLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestDoubleSwaggerPetstore.Model, SwaggerPetstore
formatTestDoubleLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestFloatSwaggerPetstore.Model, SwaggerPetstore
formatTestFloatLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestInt32SwaggerPetstore.Model, SwaggerPetstore
formatTestInt32LSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestInt64SwaggerPetstore.Model, SwaggerPetstore
formatTestInt64LSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestIntegerSwaggerPetstore.Model, SwaggerPetstore
formatTestIntegerLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestNumberSwaggerPetstore.Model, SwaggerPetstore
formatTestNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestPasswordSwaggerPetstore.Model, SwaggerPetstore
formatTestPasswordLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestStringSwaggerPetstore.Model, SwaggerPetstore
formatTestStringLSwaggerPetstore.ModelLens, SwaggerPetstore
formatTestUuidSwaggerPetstore.Model, SwaggerPetstore
formatTestUuidLSwaggerPetstore.ModelLens, SwaggerPetstore
fromE'ArrayEnumSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumFormStringSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumIntegerSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumNumberSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumQueryIntegerSwaggerPetstore.Model, SwaggerPetstore
fromE'EnumStringSwaggerPetstore.Model, SwaggerPetstore
fromE'InnerSwaggerPetstore.Model, SwaggerPetstore
fromE'Inner2SwaggerPetstore.Model, SwaggerPetstore
fromE'JustSymbolSwaggerPetstore.Model, SwaggerPetstore
fromE'StatusSwaggerPetstore.Model, SwaggerPetstore
fromE'Status2SwaggerPetstore.Model, SwaggerPetstore
fromEnumClassSwaggerPetstore.Model, SwaggerPetstore
fromOuterEnumSwaggerPetstore.Model, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-G.html b/samples/client/petstore/haskell-http-client/docs/doc-index-G.html index 72a0ff4d28b..f417ae07c0d 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-G.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-G.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - G)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - G

GetInventorySwaggerPetstore.API, SwaggerPetstore
getInventorySwaggerPetstore.API, SwaggerPetstore
GetOrderByIdSwaggerPetstore.API, SwaggerPetstore
getOrderByIdSwaggerPetstore.API, SwaggerPetstore
GetPetByIdSwaggerPetstore.API, SwaggerPetstore
getPetByIdSwaggerPetstore.API, SwaggerPetstore
GetUserByNameSwaggerPetstore.API, SwaggerPetstore
getUserByNameSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - G

GetInventorySwaggerPetstore.API.Store, SwaggerPetstore.API, SwaggerPetstore
getInventorySwaggerPetstore.API.Store, SwaggerPetstore.API, SwaggerPetstore
GetOrderByIdSwaggerPetstore.API.Store, SwaggerPetstore.API, SwaggerPetstore
getOrderByIdSwaggerPetstore.API.Store, SwaggerPetstore.API, SwaggerPetstore
GetPetByIdSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
getPetByIdSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
GetUserByNameSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
getUserByNameSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-I.html b/samples/client/petstore/haskell-http-client/docs/doc-index-I.html index 042ff6f57f8..0b5fd5e8d71 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-I.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-I.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - I)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - I

initLogContextSwaggerPetstore.Logging, SwaggerPetstore
InitRequest 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
Int32 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Int64 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - I

initLogContextSwaggerPetstore.Logging, SwaggerPetstore
InitRequest 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
Int32 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Int64 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-L.html b/samples/client/petstore/haskell-http-client/docs/doc-index-L.html index 72211edddd2..87553bee81e 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-L.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-L.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - L)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - L

Lens_SwaggerPetstore.Core, SwaggerPetstore
Lens_'SwaggerPetstore.Core, SwaggerPetstore
levelDebugSwaggerPetstore.Logging, SwaggerPetstore
levelErrorSwaggerPetstore.Logging, SwaggerPetstore
levelInfoSwaggerPetstore.Logging, SwaggerPetstore
LogContextSwaggerPetstore.Logging, SwaggerPetstore
logExceptionsSwaggerPetstore.Logging, SwaggerPetstore
LogExecSwaggerPetstore.Logging, SwaggerPetstore
LogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
LoginUserSwaggerPetstore.API, SwaggerPetstore
loginUserSwaggerPetstore.API, SwaggerPetstore
LogLevelSwaggerPetstore.Logging, SwaggerPetstore
LogoutUserSwaggerPetstore.API, SwaggerPetstore
logoutUserSwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - L

Lens_SwaggerPetstore.Core, SwaggerPetstore
Lens_'SwaggerPetstore.Core, SwaggerPetstore
levelDebugSwaggerPetstore.Logging, SwaggerPetstore
levelErrorSwaggerPetstore.Logging, SwaggerPetstore
levelInfoSwaggerPetstore.Logging, SwaggerPetstore
LogContextSwaggerPetstore.Logging, SwaggerPetstore
logExceptionsSwaggerPetstore.Logging, SwaggerPetstore
LogExecSwaggerPetstore.Logging, SwaggerPetstore
LogExecWithContextSwaggerPetstore.Logging, SwaggerPetstore
LoginUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
loginUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
LogLevelSwaggerPetstore.Logging, SwaggerPetstore
LogoutUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
logoutUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-M.html b/samples/client/petstore/haskell-http-client/docs/doc-index-M.html index 033c950bf8f..7d803af0493 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-M.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-M.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - M)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - M

MapTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
mapTestMapMapOfStringSwaggerPetstore.Model, SwaggerPetstore
mapTestMapMapOfStringLSwaggerPetstore.ModelLens, SwaggerPetstore
mapTestMapOfEnumStringSwaggerPetstore.Model, SwaggerPetstore
mapTestMapOfEnumStringLSwaggerPetstore.ModelLens, SwaggerPetstore
MimeAny 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeError 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
mimeErrorSwaggerPetstore.Client, SwaggerPetstore
mimeErrorResponseSwaggerPetstore.Client, SwaggerPetstore
MimeFormUrlEncoded 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeJSON 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeJsonCharsetutf8 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
MimeMultipartFormData 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeNoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeOctetStream 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimePlainText 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeRenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRender'SwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRenderDefaultMultipartFormDataSwaggerPetstore.MimeTypes, SwaggerPetstore
MimeResult 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
mimeResultSwaggerPetstore.Client, SwaggerPetstore
mimeResultResponseSwaggerPetstore.Client, SwaggerPetstore
MimeTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeType'SwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypesSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypes'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeUnrenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeUnrenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeUnrender'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeXML 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeXmlCharsetutf8 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
MixedPropertiesAndAdditionalPropertiesClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassDateTimeSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassDateTimeLSwaggerPetstore.ModelLens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapLSwaggerPetstore.ModelLens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidLSwaggerPetstore.ModelLens, SwaggerPetstore
mkAdditionalPropertiesClassSwaggerPetstore.Model, SwaggerPetstore
mkAnimalSwaggerPetstore.Model, SwaggerPetstore
mkAnimalFarmSwaggerPetstore.Model, SwaggerPetstore
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkArrayOfArrayOfNumberOnlySwaggerPetstore.Model, SwaggerPetstore
mkArrayOfNumberOnlySwaggerPetstore.Model, SwaggerPetstore
mkArrayTestSwaggerPetstore.Model, SwaggerPetstore
mkCapitalizationSwaggerPetstore.Model, SwaggerPetstore
mkCatSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkClassModelSwaggerPetstore.Model, SwaggerPetstore
mkClientSwaggerPetstore.Model, SwaggerPetstore
mkDogSwaggerPetstore.Model, SwaggerPetstore
mkEnumArraysSwaggerPetstore.Model, SwaggerPetstore
mkEnumTestSwaggerPetstore.Model, SwaggerPetstore
mkFormatTestSwaggerPetstore.Model, SwaggerPetstore
mkHasOnlyReadOnlySwaggerPetstore.Model, SwaggerPetstore
mkMapTestSwaggerPetstore.Model, SwaggerPetstore
mkMixedPropertiesAndAdditionalPropertiesClassSwaggerPetstore.Model, SwaggerPetstore
mkModel200ResponseSwaggerPetstore.Model, SwaggerPetstore
mkModelListSwaggerPetstore.Model, SwaggerPetstore
mkModelReturnSwaggerPetstore.Model, SwaggerPetstore
mkNameSwaggerPetstore.Model, SwaggerPetstore
mkNumberOnlySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkOuterCompositeSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkReadOnlyFirstSwaggerPetstore.Model, SwaggerPetstore
mkSpecialModelNameSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
Model200Response 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
model200ResponseClassSwaggerPetstore.Model, SwaggerPetstore
model200ResponseClassLSwaggerPetstore.ModelLens, SwaggerPetstore
model200ResponseNameSwaggerPetstore.Model, SwaggerPetstore
model200ResponseNameLSwaggerPetstore.ModelLens, SwaggerPetstore
ModelList 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelList123ListSwaggerPetstore.Model, SwaggerPetstore
modelList123ListLSwaggerPetstore.ModelLens, SwaggerPetstore
ModelReturn 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnSwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnLSwaggerPetstore.ModelLens, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.Core, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - M

MapTest 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
mapTestMapMapOfStringSwaggerPetstore.Model, SwaggerPetstore
mapTestMapMapOfStringLSwaggerPetstore.ModelLens, SwaggerPetstore
mapTestMapOfEnumStringSwaggerPetstore.Model, SwaggerPetstore
mapTestMapOfEnumStringLSwaggerPetstore.ModelLens, SwaggerPetstore
MimeAny 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeError 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
mimeErrorSwaggerPetstore.Client, SwaggerPetstore
mimeErrorResponseSwaggerPetstore.Client, SwaggerPetstore
MimeFormUrlEncoded 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeJSON 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeJsonCharsetutf8 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeMultipartFormData 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeNoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeOctetStream 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimePlainText 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeRenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRender'SwaggerPetstore.MimeTypes, SwaggerPetstore
mimeRenderDefaultMultipartFormDataSwaggerPetstore.MimeTypes, SwaggerPetstore
MimeResult 
1 (Type/Class)SwaggerPetstore.Client, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Client, SwaggerPetstore
mimeResultSwaggerPetstore.Client, SwaggerPetstore
mimeResultResponseSwaggerPetstore.Client, SwaggerPetstore
MimeTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeType'SwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypesSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeTypes'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeUnrenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeUnrenderSwaggerPetstore.MimeTypes, SwaggerPetstore
mimeUnrender'SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeXML 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MimeXmlCharsetutf8 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
MixedPropertiesAndAdditionalPropertiesClass 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassDateTimeSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassDateTimeLSwaggerPetstore.ModelLens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassMapLSwaggerPetstore.ModelLens, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidSwaggerPetstore.Model, SwaggerPetstore
mixedPropertiesAndAdditionalPropertiesClassUuidLSwaggerPetstore.ModelLens, SwaggerPetstore
mkAdditionalPropertiesClassSwaggerPetstore.Model, SwaggerPetstore
mkAnimalSwaggerPetstore.Model, SwaggerPetstore
mkAnimalFarmSwaggerPetstore.Model, SwaggerPetstore
mkApiResponseSwaggerPetstore.Model, SwaggerPetstore
mkArrayOfArrayOfNumberOnlySwaggerPetstore.Model, SwaggerPetstore
mkArrayOfNumberOnlySwaggerPetstore.Model, SwaggerPetstore
mkArrayTestSwaggerPetstore.Model, SwaggerPetstore
mkCapitalizationSwaggerPetstore.Model, SwaggerPetstore
mkCatSwaggerPetstore.Model, SwaggerPetstore
mkCategorySwaggerPetstore.Model, SwaggerPetstore
mkClassModelSwaggerPetstore.Model, SwaggerPetstore
mkClientSwaggerPetstore.Model, SwaggerPetstore
mkDogSwaggerPetstore.Model, SwaggerPetstore
mkEnumArraysSwaggerPetstore.Model, SwaggerPetstore
mkEnumTestSwaggerPetstore.Model, SwaggerPetstore
mkFormatTestSwaggerPetstore.Model, SwaggerPetstore
mkHasOnlyReadOnlySwaggerPetstore.Model, SwaggerPetstore
mkMapTestSwaggerPetstore.Model, SwaggerPetstore
mkMixedPropertiesAndAdditionalPropertiesClassSwaggerPetstore.Model, SwaggerPetstore
mkModel200ResponseSwaggerPetstore.Model, SwaggerPetstore
mkModelListSwaggerPetstore.Model, SwaggerPetstore
mkModelReturnSwaggerPetstore.Model, SwaggerPetstore
mkNameSwaggerPetstore.Model, SwaggerPetstore
mkNumberOnlySwaggerPetstore.Model, SwaggerPetstore
mkOrderSwaggerPetstore.Model, SwaggerPetstore
mkOuterCompositeSwaggerPetstore.Model, SwaggerPetstore
mkPetSwaggerPetstore.Model, SwaggerPetstore
mkReadOnlyFirstSwaggerPetstore.Model, SwaggerPetstore
mkSpecialModelNameSwaggerPetstore.Model, SwaggerPetstore
mkTagSwaggerPetstore.Model, SwaggerPetstore
mkUserSwaggerPetstore.Model, SwaggerPetstore
Model200Response 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
model200ResponseClassSwaggerPetstore.Model, SwaggerPetstore
model200ResponseClassLSwaggerPetstore.ModelLens, SwaggerPetstore
model200ResponseNameSwaggerPetstore.Model, SwaggerPetstore
model200ResponseNameLSwaggerPetstore.ModelLens, SwaggerPetstore
ModelList 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelList123ListSwaggerPetstore.Model, SwaggerPetstore
modelList123ListLSwaggerPetstore.ModelLens, SwaggerPetstore
ModelReturn 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnSwaggerPetstore.Model, SwaggerPetstore
modelReturnReturnLSwaggerPetstore.ModelLens, SwaggerPetstore
modifyInitRequestSwaggerPetstore.Client, SwaggerPetstore
modifyInitRequestMSwaggerPetstore.Client, SwaggerPetstore
MultiParamArraySwaggerPetstore.Core, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-N.html b/samples/client/petstore/haskell-http-client/docs/doc-index-N.html index c7032037bb7..78161dd02fb 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-N.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-N.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - N)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - N

Name 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
name123NumberSwaggerPetstore.Model, SwaggerPetstore
name123NumberLSwaggerPetstore.ModelLens, SwaggerPetstore
Name2 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
nameNameSwaggerPetstore.Model, SwaggerPetstore
nameNameLSwaggerPetstore.ModelLens, SwaggerPetstore
namePropertySwaggerPetstore.Model, SwaggerPetstore
namePropertyLSwaggerPetstore.ModelLens, SwaggerPetstore
nameSnakeCaseSwaggerPetstore.Model, SwaggerPetstore
nameSnakeCaseLSwaggerPetstore.ModelLens, SwaggerPetstore
newConfigSwaggerPetstore.Core, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
Number 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
NumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
numberOnlyJustNumberSwaggerPetstore.Model, SwaggerPetstore
numberOnlyJustNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - N

Name 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
name123NumberSwaggerPetstore.Model, SwaggerPetstore
name123NumberLSwaggerPetstore.ModelLens, SwaggerPetstore
Name2 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
nameNameSwaggerPetstore.Model, SwaggerPetstore
nameNameLSwaggerPetstore.ModelLens, SwaggerPetstore
namePropertySwaggerPetstore.Model, SwaggerPetstore
namePropertyLSwaggerPetstore.ModelLens, SwaggerPetstore
nameSnakeCaseSwaggerPetstore.Model, SwaggerPetstore
nameSnakeCaseLSwaggerPetstore.ModelLens, SwaggerPetstore
newConfigSwaggerPetstore.Core, SwaggerPetstore
NoContent 
1 (Type/Class)SwaggerPetstore.MimeTypes, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.MimeTypes, SwaggerPetstore
Number 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
NumberOnly 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
numberOnlyJustNumberSwaggerPetstore.Model, SwaggerPetstore
numberOnlyJustNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-O.html b/samples/client/petstore/haskell-http-client/docs/doc-index-O.html index eedfef838e5..43d39139396 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-O.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-O.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - O)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - O

Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.ModelLens, SwaggerPetstore
OrderId 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.ModelLens, SwaggerPetstore
OrderIdText 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.ModelLens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.ModelLens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.ModelLens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.ModelLens, SwaggerPetstore
OuterBoolean 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
OuterComposite 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyBooleanSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyBooleanLSwaggerPetstore.ModelLens, SwaggerPetstore
outerCompositeMyNumberSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
outerCompositeMyStringSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyStringLSwaggerPetstore.ModelLens, SwaggerPetstore
OuterEnumSwaggerPetstore.Model, SwaggerPetstore
OuterEnum'ApprovedSwaggerPetstore.Model, SwaggerPetstore
OuterEnum'DeliveredSwaggerPetstore.Model, SwaggerPetstore
OuterEnum'PlacedSwaggerPetstore.Model, SwaggerPetstore
OuterNumber 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
OuterString 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - O

Order 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderCompleteSwaggerPetstore.Model, SwaggerPetstore
orderCompleteLSwaggerPetstore.ModelLens, SwaggerPetstore
OrderId 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderIdSwaggerPetstore.Model, SwaggerPetstore
orderIdLSwaggerPetstore.ModelLens, SwaggerPetstore
OrderIdText 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
orderPetIdSwaggerPetstore.Model, SwaggerPetstore
orderPetIdLSwaggerPetstore.ModelLens, SwaggerPetstore
orderQuantitySwaggerPetstore.Model, SwaggerPetstore
orderQuantityLSwaggerPetstore.ModelLens, SwaggerPetstore
orderShipDateSwaggerPetstore.Model, SwaggerPetstore
orderShipDateLSwaggerPetstore.ModelLens, SwaggerPetstore
orderStatusSwaggerPetstore.Model, SwaggerPetstore
orderStatusLSwaggerPetstore.ModelLens, SwaggerPetstore
OuterBoolean 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
OuterComposite 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyBooleanSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyBooleanLSwaggerPetstore.ModelLens, SwaggerPetstore
outerCompositeMyNumberSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyNumberLSwaggerPetstore.ModelLens, SwaggerPetstore
outerCompositeMyStringSwaggerPetstore.Model, SwaggerPetstore
outerCompositeMyStringLSwaggerPetstore.ModelLens, SwaggerPetstore
OuterEnumSwaggerPetstore.Model, SwaggerPetstore
OuterEnum'ApprovedSwaggerPetstore.Model, SwaggerPetstore
OuterEnum'DeliveredSwaggerPetstore.Model, SwaggerPetstore
OuterEnum'PlacedSwaggerPetstore.Model, SwaggerPetstore
OuterNumber 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
OuterString 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-P.html b/samples/client/petstore/haskell-http-client/docs/doc-index-P.html index ac821fd32bb..c2ad33a1370 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-P.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-P.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - P)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - P

Param 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Param2 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ParamBinary 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ParamBodySwaggerPetstore.Core, SwaggerPetstore
ParamBodyBSwaggerPetstore.Core, SwaggerPetstore
ParamBodyBLSwaggerPetstore.Core, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.Core, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.Core, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.Core, SwaggerPetstore
ParamDate 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ParamDateTime 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ParamDouble 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ParamFloat 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
ParamInteger 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
paramsBodySwaggerPetstore.Core, SwaggerPetstore
paramsBodyLSwaggerPetstore.Core, SwaggerPetstore
paramsHeadersSwaggerPetstore.Core, SwaggerPetstore
paramsHeadersLSwaggerPetstore.Core, SwaggerPetstore
paramsQuerySwaggerPetstore.Core, SwaggerPetstore
paramsQueryLSwaggerPetstore.Core, SwaggerPetstore
ParamString 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Password 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
PatternWithoutDelimiter 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.ModelLens, SwaggerPetstore
PetId 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.ModelLens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.ModelLens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.ModelLens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.ModelLens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.ModelLens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.Core, SwaggerPetstore
PlaceOrderSwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - P

Param 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Param2 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
ParamBinary 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
ParamBodySwaggerPetstore.Core, SwaggerPetstore
ParamBodyBSwaggerPetstore.Core, SwaggerPetstore
ParamBodyBLSwaggerPetstore.Core, SwaggerPetstore
ParamBodyFormUrlEncodedSwaggerPetstore.Core, SwaggerPetstore
ParamBodyMultipartFormDataSwaggerPetstore.Core, SwaggerPetstore
ParamBodyNoneSwaggerPetstore.Core, SwaggerPetstore
ParamDate 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
ParamDateTime 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
ParamDouble 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
ParamFloat 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
ParamInteger 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Params 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
paramsBodySwaggerPetstore.Core, SwaggerPetstore
paramsBodyLSwaggerPetstore.Core, SwaggerPetstore
paramsHeadersSwaggerPetstore.Core, SwaggerPetstore
paramsHeadersLSwaggerPetstore.Core, SwaggerPetstore
paramsQuerySwaggerPetstore.Core, SwaggerPetstore
paramsQueryLSwaggerPetstore.Core, SwaggerPetstore
ParamString 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Password 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
PatternWithoutDelimiter 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
Pet 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petCategorySwaggerPetstore.Model, SwaggerPetstore
petCategoryLSwaggerPetstore.ModelLens, SwaggerPetstore
PetId 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
petIdSwaggerPetstore.Model, SwaggerPetstore
petIdLSwaggerPetstore.ModelLens, SwaggerPetstore
petNameSwaggerPetstore.Model, SwaggerPetstore
petNameLSwaggerPetstore.ModelLens, SwaggerPetstore
petPhotoUrlsSwaggerPetstore.Model, SwaggerPetstore
petPhotoUrlsLSwaggerPetstore.ModelLens, SwaggerPetstore
petStatusSwaggerPetstore.Model, SwaggerPetstore
petStatusLSwaggerPetstore.ModelLens, SwaggerPetstore
petTagsSwaggerPetstore.Model, SwaggerPetstore
petTagsLSwaggerPetstore.ModelLens, SwaggerPetstore
PipeSeparatedSwaggerPetstore.Core, SwaggerPetstore
PlaceOrderSwaggerPetstore.API.Store, SwaggerPetstore.API, SwaggerPetstore
placeOrderSwaggerPetstore.API.Store, SwaggerPetstore.API, SwaggerPetstore
ProducesSwaggerPetstore.MimeTypes, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-S.html b/samples/client/petstore/haskell-http-client/docs/doc-index-S.html index 84afc7fddad..041b217d154 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-S.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-S.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - S)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - S

setBodyParamSwaggerPetstore.Core, SwaggerPetstore
setHeaderSwaggerPetstore.Core, SwaggerPetstore
setQuerySwaggerPetstore.Core, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.Core, SwaggerPetstore
SpecialModelName 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameSwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameLSwaggerPetstore.ModelLens, SwaggerPetstore
Status 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
StatusText 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
stderrLoggingContextSwaggerPetstore.Logging, SwaggerPetstore
stderrLoggingExecSwaggerPetstore.Logging, SwaggerPetstore
stdoutLoggingContextSwaggerPetstore.Logging, SwaggerPetstore
stdoutLoggingExecSwaggerPetstore.Logging, SwaggerPetstore
SwaggerPetstoreConfig 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - S

setBodyParamSwaggerPetstore.Core, SwaggerPetstore
setHeaderSwaggerPetstore.Core, SwaggerPetstore
setQuerySwaggerPetstore.Core, SwaggerPetstore
SpaceSeparatedSwaggerPetstore.Core, SwaggerPetstore
SpecialModelName 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameSwaggerPetstore.Model, SwaggerPetstore
specialModelNameSpecialPropertyNameLSwaggerPetstore.ModelLens, SwaggerPetstore
Status 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
StatusText 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
stderrLoggingContextSwaggerPetstore.Logging, SwaggerPetstore
stderrLoggingExecSwaggerPetstore.Logging, SwaggerPetstore
stdoutLoggingContextSwaggerPetstore.Logging, SwaggerPetstore
stdoutLoggingExecSwaggerPetstore.Logging, SwaggerPetstore
SwaggerPetstoreConfig 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
SwaggerPetstoreRequest 
1 (Type/Class)SwaggerPetstore.Core, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Core, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-T.html b/samples/client/petstore/haskell-http-client/docs/doc-index-T.html index 123fb0e2f6d..a7f8bfecd69 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-T.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-T.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - T)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - T

TabSeparatedSwaggerPetstore.Core, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.ModelLens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.ModelLens, SwaggerPetstore
Tags 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
TestClassnameSwaggerPetstore.API, SwaggerPetstore
testClassnameSwaggerPetstore.API, SwaggerPetstore
TestClientModelSwaggerPetstore.API, SwaggerPetstore
testClientModelSwaggerPetstore.API, SwaggerPetstore
TestEndpointParametersSwaggerPetstore.API, SwaggerPetstore
testEndpointParametersSwaggerPetstore.API, SwaggerPetstore
TestEnumParametersSwaggerPetstore.API, SwaggerPetstore
testEnumParametersSwaggerPetstore.API, SwaggerPetstore
TestInlineAdditionalPropertiesSwaggerPetstore.API, SwaggerPetstore
testInlineAdditionalPropertiesSwaggerPetstore.API, SwaggerPetstore
TestJsonFormDataSwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API, SwaggerPetstore
toE'ArrayEnumSwaggerPetstore.Model, SwaggerPetstore
toE'EnumFormStringSwaggerPetstore.Model, SwaggerPetstore
toE'EnumIntegerSwaggerPetstore.Model, SwaggerPetstore
toE'EnumNumberSwaggerPetstore.Model, SwaggerPetstore
toE'EnumQueryIntegerSwaggerPetstore.Model, SwaggerPetstore
toE'EnumStringSwaggerPetstore.Model, SwaggerPetstore
toE'InnerSwaggerPetstore.Model, SwaggerPetstore
toE'Inner2SwaggerPetstore.Model, SwaggerPetstore
toE'JustSymbolSwaggerPetstore.Model, SwaggerPetstore
toE'StatusSwaggerPetstore.Model, SwaggerPetstore
toE'Status2SwaggerPetstore.Model, SwaggerPetstore
toEnumClassSwaggerPetstore.Model, SwaggerPetstore
toFormSwaggerPetstore.Core, SwaggerPetstore
toFormCollSwaggerPetstore.Core, SwaggerPetstore
toHeaderSwaggerPetstore.Core, SwaggerPetstore
toHeaderCollSwaggerPetstore.Core, SwaggerPetstore
toOuterEnumSwaggerPetstore.Model, SwaggerPetstore
toPathSwaggerPetstore.Core, SwaggerPetstore
toQuerySwaggerPetstore.Core, SwaggerPetstore
toQueryCollSwaggerPetstore.Core, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - T

TabSeparatedSwaggerPetstore.Core, SwaggerPetstore
Tag 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
tagIdSwaggerPetstore.Model, SwaggerPetstore
tagIdLSwaggerPetstore.ModelLens, SwaggerPetstore
tagNameSwaggerPetstore.Model, SwaggerPetstore
tagNameLSwaggerPetstore.ModelLens, SwaggerPetstore
Tags 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
TestClassnameSwaggerPetstore.API.FakeClassnameTags123, SwaggerPetstore.API, SwaggerPetstore
testClassnameSwaggerPetstore.API.FakeClassnameTags123, SwaggerPetstore.API, SwaggerPetstore
TestClientModelSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
testClientModelSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
TestEndpointParametersSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
testEndpointParametersSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
TestEnumParametersSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
testEnumParametersSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
TestInlineAdditionalPropertiesSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
testInlineAdditionalPropertiesSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
TestJsonFormDataSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
testJsonFormDataSwaggerPetstore.API.Fake, SwaggerPetstore.API, SwaggerPetstore
TestSpecialTagsSwaggerPetstore.API.AnotherFake, SwaggerPetstore.API, SwaggerPetstore
testSpecialTagsSwaggerPetstore.API.AnotherFake, SwaggerPetstore.API, SwaggerPetstore
toE'ArrayEnumSwaggerPetstore.Model, SwaggerPetstore
toE'EnumFormStringSwaggerPetstore.Model, SwaggerPetstore
toE'EnumIntegerSwaggerPetstore.Model, SwaggerPetstore
toE'EnumNumberSwaggerPetstore.Model, SwaggerPetstore
toE'EnumQueryIntegerSwaggerPetstore.Model, SwaggerPetstore
toE'EnumStringSwaggerPetstore.Model, SwaggerPetstore
toE'InnerSwaggerPetstore.Model, SwaggerPetstore
toE'Inner2SwaggerPetstore.Model, SwaggerPetstore
toE'JustSymbolSwaggerPetstore.Model, SwaggerPetstore
toE'StatusSwaggerPetstore.Model, SwaggerPetstore
toE'Status2SwaggerPetstore.Model, SwaggerPetstore
toEnumClassSwaggerPetstore.Model, SwaggerPetstore
toFormSwaggerPetstore.Core, SwaggerPetstore
toFormCollSwaggerPetstore.Core, SwaggerPetstore
toHeaderSwaggerPetstore.Core, SwaggerPetstore
toHeaderCollSwaggerPetstore.Core, SwaggerPetstore
toOuterEnumSwaggerPetstore.Model, SwaggerPetstore
toPathSwaggerPetstore.Core, SwaggerPetstore
toQuerySwaggerPetstore.Core, SwaggerPetstore
toQueryCollSwaggerPetstore.Core, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/doc-index-U.html b/samples/client/petstore/haskell-http-client/docs/doc-index-U.html index 22e8f16ecd2..902dd9bc9f0 100644 --- a/samples/client/petstore/haskell-http-client/docs/doc-index-U.html +++ b/samples/client/petstore/haskell-http-client/docs/doc-index-U.html @@ -1,4 +1,4 @@ swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - U)

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - U

unAcceptSwaggerPetstore.MimeTypes, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.API, SwaggerPetstore
unApiKeySwaggerPetstore.API, SwaggerPetstore
unBinarySwaggerPetstore.Core, SwaggerPetstore
unBodySwaggerPetstore.API, SwaggerPetstore
unByteSwaggerPetstore.API, SwaggerPetstore
unByteArraySwaggerPetstore.Core, SwaggerPetstore
unCallbackSwaggerPetstore.API, SwaggerPetstore
unContentTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
unDateSwaggerPetstore.Core, SwaggerPetstore
unDateTimeSwaggerPetstore.Core, SwaggerPetstore
unEnumFormStringSwaggerPetstore.API, SwaggerPetstore
unEnumFormStringArraySwaggerPetstore.API, SwaggerPetstore
unEnumHeaderStringSwaggerPetstore.API, SwaggerPetstore
unEnumHeaderStringArraySwaggerPetstore.API, SwaggerPetstore
unEnumQueryDoubleSwaggerPetstore.API, SwaggerPetstore
unEnumQueryIntegerSwaggerPetstore.API, SwaggerPetstore
unEnumQueryStringSwaggerPetstore.API, SwaggerPetstore
unEnumQueryStringArraySwaggerPetstore.API, SwaggerPetstore
unFileSwaggerPetstore.API, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unInt32SwaggerPetstore.API, SwaggerPetstore
unInt64SwaggerPetstore.API, SwaggerPetstore
unName2SwaggerPetstore.API, SwaggerPetstore
unNumberSwaggerPetstore.API, SwaggerPetstore
unOrderIdSwaggerPetstore.API, SwaggerPetstore
unOrderIdTextSwaggerPetstore.API, SwaggerPetstore
unOuterBooleanSwaggerPetstore.Model, SwaggerPetstore
unOuterNumberSwaggerPetstore.Model, SwaggerPetstore
unOuterStringSwaggerPetstore.Model, SwaggerPetstore
unParamSwaggerPetstore.API, SwaggerPetstore
unParam2SwaggerPetstore.API, SwaggerPetstore
unParamBinarySwaggerPetstore.API, SwaggerPetstore
unParamDateSwaggerPetstore.API, SwaggerPetstore
unParamDateTimeSwaggerPetstore.API, SwaggerPetstore
unParamDoubleSwaggerPetstore.API, SwaggerPetstore
unParamFloatSwaggerPetstore.API, SwaggerPetstore
unParamIntegerSwaggerPetstore.API, SwaggerPetstore
unParamStringSwaggerPetstore.API, SwaggerPetstore
unPasswordSwaggerPetstore.API, SwaggerPetstore
unPatternWithoutDelimiterSwaggerPetstore.API, SwaggerPetstore
unPetIdSwaggerPetstore.API, SwaggerPetstore
unStatusSwaggerPetstore.API, SwaggerPetstore
unStatusTextSwaggerPetstore.API, SwaggerPetstore
unTagsSwaggerPetstore.API, SwaggerPetstore
unUsernameSwaggerPetstore.API, SwaggerPetstore
UpdatePetSwaggerPetstore.API, SwaggerPetstore
updatePetSwaggerPetstore.API, SwaggerPetstore
UpdatePetWithFormSwaggerPetstore.API, SwaggerPetstore
updatePetWithFormSwaggerPetstore.API, SwaggerPetstore
UpdateUserSwaggerPetstore.API, SwaggerPetstore
updateUserSwaggerPetstore.API, SwaggerPetstore
UploadFileSwaggerPetstore.API, SwaggerPetstore
uploadFileSwaggerPetstore.API, SwaggerPetstore
User 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userEmailSwaggerPetstore.Model, SwaggerPetstore
userEmailLSwaggerPetstore.ModelLens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.ModelLens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.ModelLens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.ModelLens, SwaggerPetstore
Username 
1 (Type/Class)SwaggerPetstore.API, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.API, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.ModelLens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.ModelLens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.ModelLens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.ModelLens, SwaggerPetstore
\ No newline at end of file +

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

Index - U

unAcceptSwaggerPetstore.MimeTypes, SwaggerPetstore
unAdditionalMetadataSwaggerPetstore.Model, SwaggerPetstore
unApiKeySwaggerPetstore.Model, SwaggerPetstore
unBinarySwaggerPetstore.Core, SwaggerPetstore
unBodySwaggerPetstore.Model, SwaggerPetstore
unByteSwaggerPetstore.Model, SwaggerPetstore
unByteArraySwaggerPetstore.Core, SwaggerPetstore
unCallbackSwaggerPetstore.Model, SwaggerPetstore
unContentTypeSwaggerPetstore.MimeTypes, SwaggerPetstore
unDateSwaggerPetstore.Core, SwaggerPetstore
unDateTimeSwaggerPetstore.Core, SwaggerPetstore
unEnumFormStringSwaggerPetstore.Model, SwaggerPetstore
unEnumFormStringArraySwaggerPetstore.Model, SwaggerPetstore
unEnumHeaderStringSwaggerPetstore.Model, SwaggerPetstore
unEnumHeaderStringArraySwaggerPetstore.Model, SwaggerPetstore
unEnumQueryDoubleSwaggerPetstore.Model, SwaggerPetstore
unEnumQueryIntegerSwaggerPetstore.Model, SwaggerPetstore
unEnumQueryStringSwaggerPetstore.Model, SwaggerPetstore
unEnumQueryStringArraySwaggerPetstore.Model, SwaggerPetstore
unFileSwaggerPetstore.Model, SwaggerPetstore
unInitRequestSwaggerPetstore.Client, SwaggerPetstore
unInt32SwaggerPetstore.Model, SwaggerPetstore
unInt64SwaggerPetstore.Model, SwaggerPetstore
unName2SwaggerPetstore.Model, SwaggerPetstore
unNumberSwaggerPetstore.Model, SwaggerPetstore
unOrderIdSwaggerPetstore.Model, SwaggerPetstore
unOrderIdTextSwaggerPetstore.Model, SwaggerPetstore
unOuterBooleanSwaggerPetstore.Model, SwaggerPetstore
unOuterNumberSwaggerPetstore.Model, SwaggerPetstore
unOuterStringSwaggerPetstore.Model, SwaggerPetstore
unParamSwaggerPetstore.Model, SwaggerPetstore
unParam2SwaggerPetstore.Model, SwaggerPetstore
unParamBinarySwaggerPetstore.Model, SwaggerPetstore
unParamDateSwaggerPetstore.Model, SwaggerPetstore
unParamDateTimeSwaggerPetstore.Model, SwaggerPetstore
unParamDoubleSwaggerPetstore.Model, SwaggerPetstore
unParamFloatSwaggerPetstore.Model, SwaggerPetstore
unParamIntegerSwaggerPetstore.Model, SwaggerPetstore
unParamStringSwaggerPetstore.Model, SwaggerPetstore
unPasswordSwaggerPetstore.Model, SwaggerPetstore
unPatternWithoutDelimiterSwaggerPetstore.Model, SwaggerPetstore
unPetIdSwaggerPetstore.Model, SwaggerPetstore
unStatusSwaggerPetstore.Model, SwaggerPetstore
unStatusTextSwaggerPetstore.Model, SwaggerPetstore
unTagsSwaggerPetstore.Model, SwaggerPetstore
unUsernameSwaggerPetstore.Model, SwaggerPetstore
UpdatePetSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
updatePetSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
UpdatePetWithFormSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
updatePetWithFormSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
UpdateUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
updateUserSwaggerPetstore.API.User, SwaggerPetstore.API, SwaggerPetstore
UploadFileSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
uploadFileSwaggerPetstore.API.Pet, SwaggerPetstore.API, SwaggerPetstore
User 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userEmailSwaggerPetstore.Model, SwaggerPetstore
userEmailLSwaggerPetstore.ModelLens, SwaggerPetstore
userFirstNameSwaggerPetstore.Model, SwaggerPetstore
userFirstNameLSwaggerPetstore.ModelLens, SwaggerPetstore
userIdSwaggerPetstore.Model, SwaggerPetstore
userIdLSwaggerPetstore.ModelLens, SwaggerPetstore
userLastNameSwaggerPetstore.Model, SwaggerPetstore
userLastNameLSwaggerPetstore.ModelLens, SwaggerPetstore
Username 
1 (Type/Class)SwaggerPetstore.Model, SwaggerPetstore
2 (Data Constructor)SwaggerPetstore.Model, SwaggerPetstore
userPasswordSwaggerPetstore.Model, SwaggerPetstore
userPasswordLSwaggerPetstore.ModelLens, SwaggerPetstore
userPhoneSwaggerPetstore.Model, SwaggerPetstore
userPhoneLSwaggerPetstore.ModelLens, SwaggerPetstore
userUsernameSwaggerPetstore.Model, SwaggerPetstore
userUsernameLSwaggerPetstore.ModelLens, SwaggerPetstore
userUserStatusSwaggerPetstore.Model, SwaggerPetstore
userUserStatusLSwaggerPetstore.ModelLens, SwaggerPetstore
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/index.html b/samples/client/petstore/haskell-http-client/docs/index.html index ef00ad7642d..ab5f09e32df 100644 --- a/samples/client/petstore/haskell-http-client/docs/index.html +++ b/samples/client/petstore/haskell-http-client/docs/index.html @@ -2,4 +2,4 @@ window.onload = function () {pageLoad();}; //]]>

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client

. -Client library for calling the swagger-petstore API based on http-client.

host: petstore.swagger.io:80

base path: http://petstore.swagger.io:80/v2

Swagger Petstore API version: 1.0.0

OpenAPI spec version: 2.0

OpenAPI-Specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md

Signatures

\ No newline at end of file +Client library for calling the swagger-petstore API based on http-client.

host: petstore.swagger.io:80

base path: http://petstore.swagger.io:80/v2

Swagger Petstore API version: 1.0.0

OpenAPI spec version: 2.0

OpenAPI-Specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md

Signatures

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-API.html b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-API.html deleted file mode 100644 index 9e01b1aa39b..00000000000 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-API.html +++ /dev/null @@ -1,4 +0,0 @@ -SwaggerPetstore.API

SwaggerPetstore.API

Operations

AnotherFake

testSpecialTags

Fake

fakeOuterBooleanSerialize

fakeOuterCompositeSerialize

fakeOuterNumberSerialize

fakeOuterStringSerialize

testClientModel

testEndpointParameters

testEnumParameters

testInlineAdditionalProperties

testJsonFormData

FakeClassnameTags123

testClassname

Pet

addPet

data AddPet

deletePet

findPetsByStatus

findPetsByTags

getPetById

updatePet

updatePetWithForm

uploadFile

Store

deleteOrder

getInventory

getOrderById

placeOrder

User

createUser

createUsersWithArrayInput

createUsersWithListInput

deleteUser

getUserByName

loginUser

logoutUser

updateUser

Parameter newtypes

data ApiKey

data Body

data Byte

data File

data Int32

data Int64

data Name2

data Number

data OrderId

data Param

data Param2

data PetId

data Status

data Tags

Auth Methods

AuthApiKeyApiKey

AuthApiKeyApiKeyQuery

AuthBasicHttpBasicTest

AuthOAuthPetstoreAuth

Custom Mime Types

MimeJsonCharsetutf8

MimeXmlCharsetutf8

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Client.html b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Client.html deleted file mode 100644 index 05b8e27c414..00000000000 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Client.html +++ /dev/null @@ -1,4 +0,0 @@ -SwaggerPetstore.Client

SwaggerPetstore.Client

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Core.html b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Core.html deleted file mode 100644 index 4f487e572e9..00000000000 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Core.html +++ /dev/null @@ -1,4 +0,0 @@ -SwaggerPetstore.Core

SwaggerPetstore.Core

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Logging.html b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Logging.html deleted file mode 100644 index 3e0e32d8dd4..00000000000 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Logging.html +++ /dev/null @@ -1,4 +0,0 @@ -SwaggerPetstore.Logging

SwaggerPetstore.Logging

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-MimeTypes.html b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-MimeTypes.html deleted file mode 100644 index 45f1a47f1b0..00000000000 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-MimeTypes.html +++ /dev/null @@ -1,4 +0,0 @@ -SwaggerPetstore.MimeTypes

SwaggerPetstore.MimeTypes

ContentType MimeType

Accept MimeType

data Accept a

Consumes Class

class Consumes req mtype

Produces Class

class Produces req mtype

Default Mime Types

data MimeXML

data MimeAny

MimeType Class

class MimeType mtype

MimeRender Class

class MimeRender mtype x

MimeUnrender Class

class MimeUnrender mtype o

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Model.html b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Model.html deleted file mode 100644 index 529a1d4113a..00000000000 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-Model.html +++ /dev/null @@ -1,4 +0,0 @@ -SwaggerPetstore.Model

SwaggerPetstore.Model

Models

AdditionalPropertiesClass

Animal

data Animal

AnimalFarm

ApiResponse

ArrayOfArrayOfNumberOnly

ArrayOfNumberOnly

ArrayTest

Capitalization

Category

ClassModel

Client

data Client

EnumArrays

EnumTest

FormatTest

HasOnlyReadOnly

MapTest

data MapTest

MixedPropertiesAndAdditionalPropertiesClass

Model200Response

ModelList

ModelReturn

Name

data Name

NumberOnly

Order

data Order

OuterBoolean

OuterComposite

OuterNumber

OuterString

Pet

data Pet

ReadOnlyFirst

SpecialModelName

Tag

data Tag

User

data User

Cat

data Cat

Dog

data Dog

Enums

E'ArrayEnum

E'EnumFormString

E'EnumInteger

E'EnumNumber

E'EnumQueryInteger

E'EnumString

E'Inner

data E'Inner

E'Inner2

E'JustSymbol

E'Status

E'Status2

EnumClass

OuterEnum

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-ModelLens.html b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-ModelLens.html deleted file mode 100644 index 8eac8e6c4ae..00000000000 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore-ModelLens.html +++ /dev/null @@ -1,4 +0,0 @@ -SwaggerPetstore.ModelLens

SwaggerPetstore.ModelLens

AdditionalPropertiesClass

Animal

AnimalFarm

ApiResponse

ArrayOfArrayOfNumberOnly

ArrayOfNumberOnly

ArrayTest

Capitalization

Category

ClassModel

Client

EnumArrays

EnumClass

EnumTest

FormatTest

HasOnlyReadOnly

MapTest

MixedPropertiesAndAdditionalPropertiesClass

Model200Response

ModelList

ModelReturn

Name

NumberOnly

Order

OuterBoolean

OuterComposite

OuterEnum

OuterNumber

OuterString

Pet

ReadOnlyFirst

SpecialModelName

Tag

User

Cat

Dog

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore.html b/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore.html deleted file mode 100644 index 6e7be995860..00000000000 --- a/samples/client/petstore/haskell-http-client/docs/mini_SwaggerPetstore.html +++ /dev/null @@ -1,4 +0,0 @@ -SwaggerPetstore

SwaggerPetstore

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.AnotherFake.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.AnotherFake.html new file mode 100644 index 00000000000..fab69c90c20 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.AnotherFake.html @@ -0,0 +1,90 @@ +
{-
+   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: \" \\
+
+   OpenAPI spec version: 2.0
+   Swagger Petstore API version: 1.0.0
+   Contact: apiteam@swagger.io
+   Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+-}
+
+{-|
+Module : SwaggerPetstore.API.AnotherFake
+-}
+
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE MonoLocalBinds #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-}
+
+module SwaggerPetstore.API.AnotherFake where
+
+import SwaggerPetstore.Core
+import SwaggerPetstore.MimeTypes
+import SwaggerPetstore.Model as M
+
+import qualified Data.Aeson as A
+import qualified Data.ByteString as B
+import qualified Data.ByteString.Lazy as BL
+import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep)
+import qualified Data.Foldable as P
+import qualified Data.Map as Map
+import qualified Data.Maybe as P
+import qualified Data.Proxy as P (Proxy(..))
+import qualified Data.Set as Set
+import qualified Data.String as P
+import qualified Data.Text as T
+import qualified Data.Text.Encoding as T
+import qualified Data.Text.Lazy as TL
+import qualified Data.Text.Lazy.Encoding as TL
+import qualified Data.Time as TI
+import qualified Network.HTTP.Client.MultipartFormData as NH
+import qualified Network.HTTP.Media as ME
+import qualified Network.HTTP.Types as NH
+import qualified Web.FormUrlEncoded as WH
+import qualified Web.HttpApiData as WH
+
+import Data.Text (Text)
+import GHC.Base ((<|>))
+
+import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor)
+import qualified Prelude as P
+
+-- * Operations
+
+
+-- ** AnotherFake
+
+-- *** testSpecialTags
+
+-- | @PATCH \/another-fake\/dummy@
+-- 
+-- To test special tags
+-- 
+-- To test special tags
+-- 
+testSpecialTags 
+  :: (Consumes TestSpecialTags contentType, MimeRender contentType Client)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> Client -- ^ "body" -  client model
+  -> SwaggerPetstoreRequest TestSpecialTags contentType Client accept
+testSpecialTags _  _ body =
+  _mkRequest "PATCH" ["/another-fake/dummy"]
+    `setBodyParam` body
+
+data TestSpecialTags 
+
+-- | /Body Param/ "body" - client model
+instance HasBodyParam TestSpecialTags Client 
+
+-- | @application/json@
+instance Consumes TestSpecialTags MimeJSON
+
+-- | @application/json@
+instance Produces TestSpecialTags MimeJSON
+
+
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.Fake.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.Fake.html new file mode 100644 index 00000000000..0259f0d5f10 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.Fake.html @@ -0,0 +1,376 @@ +
{-
+   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: \" \\
+
+   OpenAPI spec version: 2.0
+   Swagger Petstore API version: 1.0.0
+   Contact: apiteam@swagger.io
+   Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+-}
+
+{-|
+Module : SwaggerPetstore.API.Fake
+-}
+
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE MonoLocalBinds #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-}
+
+module SwaggerPetstore.API.Fake where
+
+import SwaggerPetstore.Core
+import SwaggerPetstore.MimeTypes
+import SwaggerPetstore.Model as M
+
+import qualified Data.Aeson as A
+import qualified Data.ByteString as B
+import qualified Data.ByteString.Lazy as BL
+import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep)
+import qualified Data.Foldable as P
+import qualified Data.Map as Map
+import qualified Data.Maybe as P
+import qualified Data.Proxy as P (Proxy(..))
+import qualified Data.Set as Set
+import qualified Data.String as P
+import qualified Data.Text as T
+import qualified Data.Text.Encoding as T
+import qualified Data.Text.Lazy as TL
+import qualified Data.Text.Lazy.Encoding as TL
+import qualified Data.Time as TI
+import qualified Network.HTTP.Client.MultipartFormData as NH
+import qualified Network.HTTP.Media as ME
+import qualified Network.HTTP.Types as NH
+import qualified Web.FormUrlEncoded as WH
+import qualified Web.HttpApiData as WH
+
+import Data.Text (Text)
+import GHC.Base ((<|>))
+
+import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor)
+import qualified Prelude as P
+
+-- * Operations
+
+
+-- ** Fake
+
+-- *** fakeOuterBooleanSerialize
+
+-- | @POST \/fake\/outer\/boolean@
+-- 
+-- Test serialization of outer boolean types
+-- 
+fakeOuterBooleanSerialize 
+  :: (Consumes FakeOuterBooleanSerialize contentType)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> SwaggerPetstoreRequest FakeOuterBooleanSerialize contentType OuterBoolean accept
+fakeOuterBooleanSerialize _  _ =
+  _mkRequest "POST" ["/fake/outer/boolean"]
+
+data FakeOuterBooleanSerialize 
+
+-- | /Body Param/ "body" - Input boolean as post body
+instance HasBodyParam FakeOuterBooleanSerialize OuterBoolean 
+
+-- *** fakeOuterCompositeSerialize
+
+-- | @POST \/fake\/outer\/composite@
+-- 
+-- Test serialization of object with outer number type
+-- 
+fakeOuterCompositeSerialize 
+  :: (Consumes FakeOuterCompositeSerialize contentType)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> SwaggerPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite accept
+fakeOuterCompositeSerialize _  _ =
+  _mkRequest "POST" ["/fake/outer/composite"]
+
+data FakeOuterCompositeSerialize 
+
+-- | /Body Param/ "body" - Input composite as post body
+instance HasBodyParam FakeOuterCompositeSerialize OuterComposite 
+
+-- *** fakeOuterNumberSerialize
+
+-- | @POST \/fake\/outer\/number@
+-- 
+-- Test serialization of outer number types
+-- 
+fakeOuterNumberSerialize 
+  :: (Consumes FakeOuterNumberSerialize contentType)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> SwaggerPetstoreRequest FakeOuterNumberSerialize contentType OuterNumber accept
+fakeOuterNumberSerialize _  _ =
+  _mkRequest "POST" ["/fake/outer/number"]
+
+data FakeOuterNumberSerialize 
+
+-- | /Body Param/ "body" - Input number as post body
+instance HasBodyParam FakeOuterNumberSerialize OuterNumber 
+
+-- *** fakeOuterStringSerialize
+
+-- | @POST \/fake\/outer\/string@
+-- 
+-- Test serialization of outer string types
+-- 
+fakeOuterStringSerialize 
+  :: (Consumes FakeOuterStringSerialize contentType)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> SwaggerPetstoreRequest FakeOuterStringSerialize contentType OuterString accept
+fakeOuterStringSerialize _  _ =
+  _mkRequest "POST" ["/fake/outer/string"]
+
+data FakeOuterStringSerialize 
+
+-- | /Body Param/ "body" - Input string as post body
+instance HasBodyParam FakeOuterStringSerialize OuterString 
+
+-- *** testClientModel
+
+-- | @PATCH \/fake@
+-- 
+-- To test \"client\" model
+-- 
+-- To test \"client\" model
+-- 
+testClientModel 
+  :: (Consumes TestClientModel contentType, MimeRender contentType Client)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> Client -- ^ "body" -  client model
+  -> SwaggerPetstoreRequest TestClientModel contentType Client accept
+testClientModel _  _ body =
+  _mkRequest "PATCH" ["/fake"]
+    `setBodyParam` body
+
+data TestClientModel 
+
+-- | /Body Param/ "body" - client model
+instance HasBodyParam TestClientModel Client 
+
+-- | @application/json@
+instance Consumes TestClientModel MimeJSON
+
+-- | @application/json@
+instance Produces TestClientModel MimeJSON
+
+
+-- *** testEndpointParameters
+
+-- | @POST \/fake@
+-- 
+-- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 
+-- 
+-- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 
+-- 
+-- AuthMethod: 'AuthBasicHttpBasicTest'
+-- 
+-- Note: Has 'Produces' instances, but no response schema
+-- 
+testEndpointParameters 
+  :: (Consumes TestEndpointParameters contentType)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> Number -- ^ "number" -  None
+  -> ParamDouble -- ^ "double" -  None
+  -> PatternWithoutDelimiter -- ^ "patternWithoutDelimiter" -  None
+  -> Byte -- ^ "byte" -  None
+  -> SwaggerPetstoreRequest TestEndpointParameters contentType res accept
+testEndpointParameters _  _ (Number number) (ParamDouble double) (PatternWithoutDelimiter patternWithoutDelimiter) (Byte byte) =
+  _mkRequest "POST" ["/fake"]
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicHttpBasicTest)
+    `addForm` toForm ("number", number)
+    `addForm` toForm ("double", double)
+    `addForm` toForm ("pattern_without_delimiter", patternWithoutDelimiter)
+    `addForm` toForm ("byte", byte)
+
+data TestEndpointParameters  
+
+-- | /Optional Param/ "integer" - None
+instance HasOptionalParam TestEndpointParameters ParamInteger where
+  applyOptionalParam req (ParamInteger xs) =
+    req `addForm` toForm ("integer", xs)
+
+-- | /Optional Param/ "int32" - None
+instance HasOptionalParam TestEndpointParameters Int32 where
+  applyOptionalParam req (Int32 xs) =
+    req `addForm` toForm ("int32", xs)
+
+-- | /Optional Param/ "int64" - None
+instance HasOptionalParam TestEndpointParameters Int64 where
+  applyOptionalParam req (Int64 xs) =
+    req `addForm` toForm ("int64", xs)
+
+-- | /Optional Param/ "float" - None
+instance HasOptionalParam TestEndpointParameters ParamFloat where
+  applyOptionalParam req (ParamFloat xs) =
+    req `addForm` toForm ("float", xs)
+
+-- | /Optional Param/ "string" - None
+instance HasOptionalParam TestEndpointParameters ParamString where
+  applyOptionalParam req (ParamString xs) =
+    req `addForm` toForm ("string", xs)
+
+-- | /Optional Param/ "binary" - None
+instance HasOptionalParam TestEndpointParameters ParamBinary where
+  applyOptionalParam req (ParamBinary xs) =
+    req `addForm` toForm ("binary", xs)
+
+-- | /Optional Param/ "date" - None
+instance HasOptionalParam TestEndpointParameters ParamDate where
+  applyOptionalParam req (ParamDate xs) =
+    req `addForm` toForm ("date", xs)
+
+-- | /Optional Param/ "dateTime" - None
+instance HasOptionalParam TestEndpointParameters ParamDateTime where
+  applyOptionalParam req (ParamDateTime xs) =
+    req `addForm` toForm ("dateTime", xs)
+
+-- | /Optional Param/ "password" - None
+instance HasOptionalParam TestEndpointParameters Password where
+  applyOptionalParam req (Password xs) =
+    req `addForm` toForm ("password", xs)
+
+-- | /Optional Param/ "callback" - None
+instance HasOptionalParam TestEndpointParameters Callback where
+  applyOptionalParam req (Callback xs) =
+    req `addForm` toForm ("callback", xs)
+
+-- | @application/xml; charset=utf-8@
+instance Consumes TestEndpointParameters MimeXmlCharsetutf8
+-- | @application/json; charset=utf-8@
+instance Consumes TestEndpointParameters MimeJsonCharsetutf8
+
+-- | @application/xml; charset=utf-8@
+instance Produces TestEndpointParameters MimeXmlCharsetutf8
+-- | @application/json; charset=utf-8@
+instance Produces TestEndpointParameters MimeJsonCharsetutf8
+
+
+-- *** testEnumParameters
+
+-- | @GET \/fake@
+-- 
+-- To test enum parameters
+-- 
+-- To test enum parameters
+-- 
+-- Note: Has 'Produces' instances, but no response schema
+-- 
+testEnumParameters 
+  :: (Consumes TestEnumParameters contentType)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> SwaggerPetstoreRequest TestEnumParameters contentType res accept
+testEnumParameters _  _ =
+  _mkRequest "GET" ["/fake"]
+
+data TestEnumParameters  
+
+-- | /Optional Param/ "enum_form_string_array" - Form parameter enum test (string array)
+instance HasOptionalParam TestEnumParameters EnumFormStringArray where
+  applyOptionalParam req (EnumFormStringArray xs) =
+    req `addForm` toFormColl CommaSeparated ("enum_form_string_array", xs)
+
+-- | /Optional Param/ "enum_form_string" - Form parameter enum test (string)
+instance HasOptionalParam TestEnumParameters EnumFormString where
+  applyOptionalParam req (EnumFormString xs) =
+    req `addForm` toForm ("enum_form_string", xs)
+
+-- | /Optional Param/ "enum_header_string_array" - Header parameter enum test (string array)
+instance HasOptionalParam TestEnumParameters EnumHeaderStringArray where
+  applyOptionalParam req (EnumHeaderStringArray xs) =
+    req `setHeader` toHeaderColl CommaSeparated ("enum_header_string_array", xs)
+
+-- | /Optional Param/ "enum_header_string" - Header parameter enum test (string)
+instance HasOptionalParam TestEnumParameters EnumHeaderString where
+  applyOptionalParam req (EnumHeaderString xs) =
+    req `setHeader` toHeader ("enum_header_string", xs)
+
+-- | /Optional Param/ "enum_query_string_array" - Query parameter enum test (string array)
+instance HasOptionalParam TestEnumParameters EnumQueryStringArray where
+  applyOptionalParam req (EnumQueryStringArray xs) =
+    req `setQuery` toQueryColl CommaSeparated ("enum_query_string_array", Just xs)
+
+-- | /Optional Param/ "enum_query_string" - Query parameter enum test (string)
+instance HasOptionalParam TestEnumParameters EnumQueryString where
+  applyOptionalParam req (EnumQueryString xs) =
+    req `setQuery` toQuery ("enum_query_string", Just xs)
+
+-- | /Optional Param/ "enum_query_integer" - Query parameter enum test (double)
+instance HasOptionalParam TestEnumParameters EnumQueryInteger where
+  applyOptionalParam req (EnumQueryInteger xs) =
+    req `setQuery` toQuery ("enum_query_integer", Just xs)
+
+-- | /Optional Param/ "enum_query_double" - Query parameter enum test (double)
+instance HasOptionalParam TestEnumParameters EnumQueryDouble where
+  applyOptionalParam req (EnumQueryDouble xs) =
+    req `addForm` toForm ("enum_query_double", xs)
+
+-- | @*/*@
+instance MimeType mtype => Consumes TestEnumParameters mtype
+
+-- | @*/*@
+instance MimeType mtype => Produces TestEnumParameters mtype
+
+
+-- *** testInlineAdditionalProperties
+
+-- | @POST \/fake\/inline-additionalProperties@
+-- 
+-- test inline additionalProperties
+-- 
+-- 
+-- 
+testInlineAdditionalProperties 
+  :: (Consumes TestInlineAdditionalProperties contentType, MimeRender contentType A.Value)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> A.Value -- ^ "param" -  request body
+  -> SwaggerPetstoreRequest TestInlineAdditionalProperties contentType NoContent MimeNoContent
+testInlineAdditionalProperties _ param =
+  _mkRequest "POST" ["/fake/inline-additionalProperties"]
+    `setBodyParam` param
+
+data TestInlineAdditionalProperties 
+
+-- | /Body Param/ "param" - request body
+instance HasBodyParam TestInlineAdditionalProperties A.Value 
+
+-- | @application/json@
+instance Consumes TestInlineAdditionalProperties MimeJSON
+
+
+-- *** testJsonFormData
+
+-- | @GET \/fake\/jsonFormData@
+-- 
+-- test json serialization of form data
+-- 
+-- 
+-- 
+testJsonFormData 
+  :: (Consumes TestJsonFormData contentType)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Param -- ^ "param" -  field1
+  -> Param2 -- ^ "param2" -  field2
+  -> SwaggerPetstoreRequest TestJsonFormData contentType NoContent MimeNoContent
+testJsonFormData _ (Param param) (Param2 param2) =
+  _mkRequest "GET" ["/fake/jsonFormData"]
+    `addForm` toForm ("param", param)
+    `addForm` toForm ("param2", param2)
+
+data TestJsonFormData  
+
+-- | @application/json@
+instance Consumes TestJsonFormData MimeJSON
+
+
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.FakeClassnameTags123.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.FakeClassnameTags123.html new file mode 100644 index 00000000000..ef9df655c24 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.FakeClassnameTags123.html @@ -0,0 +1,91 @@ +
{-
+   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: \" \\
+
+   OpenAPI spec version: 2.0
+   Swagger Petstore API version: 1.0.0
+   Contact: apiteam@swagger.io
+   Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+-}
+
+{-|
+Module : SwaggerPetstore.API.FakeClassnameTags123
+-}
+
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE MonoLocalBinds #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-}
+
+module SwaggerPetstore.API.FakeClassnameTags123 where
+
+import SwaggerPetstore.Core
+import SwaggerPetstore.MimeTypes
+import SwaggerPetstore.Model as M
+
+import qualified Data.Aeson as A
+import qualified Data.ByteString as B
+import qualified Data.ByteString.Lazy as BL
+import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep)
+import qualified Data.Foldable as P
+import qualified Data.Map as Map
+import qualified Data.Maybe as P
+import qualified Data.Proxy as P (Proxy(..))
+import qualified Data.Set as Set
+import qualified Data.String as P
+import qualified Data.Text as T
+import qualified Data.Text.Encoding as T
+import qualified Data.Text.Lazy as TL
+import qualified Data.Text.Lazy.Encoding as TL
+import qualified Data.Time as TI
+import qualified Network.HTTP.Client.MultipartFormData as NH
+import qualified Network.HTTP.Media as ME
+import qualified Network.HTTP.Types as NH
+import qualified Web.FormUrlEncoded as WH
+import qualified Web.HttpApiData as WH
+
+import Data.Text (Text)
+import GHC.Base ((<|>))
+
+import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor)
+import qualified Prelude as P
+
+-- * Operations
+
+
+-- ** FakeClassnameTags123
+
+-- *** testClassname
+
+-- | @PATCH \/fake_classname_test@
+-- 
+-- To test class name in snake case
+-- 
+-- AuthMethod: 'AuthApiKeyApiKeyQuery'
+-- 
+testClassname 
+  :: (Consumes TestClassname contentType, MimeRender contentType Client)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> Client -- ^ "body" -  client model
+  -> SwaggerPetstoreRequest TestClassname contentType Client accept
+testClassname _  _ body =
+  _mkRequest "PATCH" ["/fake_classname_test"]
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKeyQuery)
+    `setBodyParam` body
+
+data TestClassname 
+
+-- | /Body Param/ "body" - client model
+instance HasBodyParam TestClassname Client 
+
+-- | @application/json@
+instance Consumes TestClassname MimeJSON
+
+-- | @application/json@
+instance Produces TestClassname MimeJSON
+
+
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.Pet.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.Pet.html new file mode 100644 index 00000000000..0e2c60913ed --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.Pet.html @@ -0,0 +1,329 @@ +
{-
+   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: \" \\
+
+   OpenAPI spec version: 2.0
+   Swagger Petstore API version: 1.0.0
+   Contact: apiteam@swagger.io
+   Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+-}
+
+{-|
+Module : SwaggerPetstore.API.Pet
+-}
+
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE MonoLocalBinds #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-}
+
+module SwaggerPetstore.API.Pet where
+
+import SwaggerPetstore.Core
+import SwaggerPetstore.MimeTypes
+import SwaggerPetstore.Model as M
+
+import qualified Data.Aeson as A
+import qualified Data.ByteString as B
+import qualified Data.ByteString.Lazy as BL
+import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep)
+import qualified Data.Foldable as P
+import qualified Data.Map as Map
+import qualified Data.Maybe as P
+import qualified Data.Proxy as P (Proxy(..))
+import qualified Data.Set as Set
+import qualified Data.String as P
+import qualified Data.Text as T
+import qualified Data.Text.Encoding as T
+import qualified Data.Text.Lazy as TL
+import qualified Data.Text.Lazy.Encoding as TL
+import qualified Data.Time as TI
+import qualified Network.HTTP.Client.MultipartFormData as NH
+import qualified Network.HTTP.Media as ME
+import qualified Network.HTTP.Types as NH
+import qualified Web.FormUrlEncoded as WH
+import qualified Web.HttpApiData as WH
+
+import Data.Text (Text)
+import GHC.Base ((<|>))
+
+import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor)
+import qualified Prelude as P
+
+-- * Operations
+
+
+-- ** Pet
+
+-- *** addPet
+
+-- | @POST \/pet@
+-- 
+-- Add a new pet to the store
+-- 
+-- 
+-- 
+-- AuthMethod: 'AuthOAuthPetstoreAuth'
+-- 
+-- Note: Has 'Produces' instances, but no response schema
+-- 
+addPet 
+  :: (Consumes AddPet contentType, MimeRender contentType Pet)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> Pet -- ^ "body" -  Pet object that needs to be added to the store
+  -> SwaggerPetstoreRequest AddPet contentType res accept
+addPet _  _ body =
+  _mkRequest "POST" ["/pet"]
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
+    `setBodyParam` body
+
+data AddPet 
+
+-- | /Body Param/ "body" - Pet object that needs to be added to the store
+instance HasBodyParam AddPet Pet 
+
+-- | @application/json@
+instance Consumes AddPet MimeJSON
+-- | @application/xml@
+instance Consumes AddPet MimeXML
+
+-- | @application/xml@
+instance Produces AddPet MimeXML
+-- | @application/json@
+instance Produces AddPet MimeJSON
+
+
+-- *** deletePet
+
+-- | @DELETE \/pet\/{petId}@
+-- 
+-- Deletes a pet
+-- 
+-- 
+-- 
+-- AuthMethod: 'AuthOAuthPetstoreAuth'
+-- 
+-- Note: Has 'Produces' instances, but no response schema
+-- 
+deletePet 
+  :: Accept accept -- ^ request accept ('MimeType')
+  -> PetId -- ^ "petId" -  Pet id to delete
+  -> SwaggerPetstoreRequest DeletePet MimeNoContent res accept
+deletePet  _ (PetId petId) =
+  _mkRequest "DELETE" ["/pet/",toPath petId]
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
+
+data DeletePet  
+instance HasOptionalParam DeletePet ApiKey where
+  applyOptionalParam req (ApiKey xs) =
+    req `setHeader` toHeader ("api_key", xs)
+-- | @application/xml@
+instance Produces DeletePet MimeXML
+-- | @application/json@
+instance Produces DeletePet MimeJSON
+
+
+-- *** findPetsByStatus
+
+-- | @GET \/pet\/findByStatus@
+-- 
+-- Finds Pets by status
+-- 
+-- Multiple status values can be provided with comma separated strings
+-- 
+-- AuthMethod: 'AuthOAuthPetstoreAuth'
+-- 
+findPetsByStatus 
+  :: Accept accept -- ^ request accept ('MimeType')
+  -> Status -- ^ "status" -  Status values that need to be considered for filter
+  -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] accept
+findPetsByStatus  _ (Status status) =
+  _mkRequest "GET" ["/pet/findByStatus"]
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
+    `setQuery` toQueryColl CommaSeparated ("status", Just status)
+
+data FindPetsByStatus  
+-- | @application/xml@
+instance Produces FindPetsByStatus MimeXML
+-- | @application/json@
+instance Produces FindPetsByStatus MimeJSON
+
+
+-- *** findPetsByTags
+
+-- | @GET \/pet\/findByTags@
+-- 
+-- Finds Pets by tags
+-- 
+-- Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+-- 
+-- AuthMethod: 'AuthOAuthPetstoreAuth'
+-- 
+findPetsByTags 
+  :: Accept accept -- ^ request accept ('MimeType')
+  -> Tags -- ^ "tags" -  Tags to filter by
+  -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept
+findPetsByTags  _ (Tags tags) =
+  _mkRequest "GET" ["/pet/findByTags"]
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
+    `setQuery` toQueryColl CommaSeparated ("tags", Just tags)
+
+{-# DEPRECATED findPetsByTags "" #-}
+
+data FindPetsByTags  
+-- | @application/xml@
+instance Produces FindPetsByTags MimeXML
+-- | @application/json@
+instance Produces FindPetsByTags MimeJSON
+
+
+-- *** getPetById
+
+-- | @GET \/pet\/{petId}@
+-- 
+-- Find pet by ID
+-- 
+-- Returns a single pet
+-- 
+-- AuthMethod: 'AuthApiKeyApiKey'
+-- 
+getPetById 
+  :: Accept accept -- ^ request accept ('MimeType')
+  -> PetId -- ^ "petId" -  ID of pet to return
+  -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet accept
+getPetById  _ (PetId petId) =
+  _mkRequest "GET" ["/pet/",toPath petId]
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey)
+
+data GetPetById  
+-- | @application/xml@
+instance Produces GetPetById MimeXML
+-- | @application/json@
+instance Produces GetPetById MimeJSON
+
+
+-- *** updatePet
+
+-- | @PUT \/pet@
+-- 
+-- Update an existing pet
+-- 
+-- 
+-- 
+-- AuthMethod: 'AuthOAuthPetstoreAuth'
+-- 
+-- Note: Has 'Produces' instances, but no response schema
+-- 
+updatePet 
+  :: (Consumes UpdatePet contentType, MimeRender contentType Pet)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> Pet -- ^ "body" -  Pet object that needs to be added to the store
+  -> SwaggerPetstoreRequest UpdatePet contentType res accept
+updatePet _  _ body =
+  _mkRequest "PUT" ["/pet"]
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
+    `setBodyParam` body
+
+data UpdatePet 
+
+-- | /Body Param/ "body" - Pet object that needs to be added to the store
+instance HasBodyParam UpdatePet Pet 
+
+-- | @application/json@
+instance Consumes UpdatePet MimeJSON
+-- | @application/xml@
+instance Consumes UpdatePet MimeXML
+
+-- | @application/xml@
+instance Produces UpdatePet MimeXML
+-- | @application/json@
+instance Produces UpdatePet MimeJSON
+
+
+-- *** updatePetWithForm
+
+-- | @POST \/pet\/{petId}@
+-- 
+-- Updates a pet in the store with form data
+-- 
+-- 
+-- 
+-- AuthMethod: 'AuthOAuthPetstoreAuth'
+-- 
+-- Note: Has 'Produces' instances, but no response schema
+-- 
+updatePetWithForm 
+  :: (Consumes UpdatePetWithForm contentType)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> PetId -- ^ "petId" -  ID of pet that needs to be updated
+  -> SwaggerPetstoreRequest UpdatePetWithForm contentType res accept
+updatePetWithForm _  _ (PetId petId) =
+  _mkRequest "POST" ["/pet/",toPath petId]
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
+
+data UpdatePetWithForm  
+
+-- | /Optional Param/ "name" - Updated name of the pet
+instance HasOptionalParam UpdatePetWithForm Name2 where
+  applyOptionalParam req (Name2 xs) =
+    req `addForm` toForm ("name", xs)
+
+-- | /Optional Param/ "status" - Updated status of the pet
+instance HasOptionalParam UpdatePetWithForm StatusText where
+  applyOptionalParam req (StatusText xs) =
+    req `addForm` toForm ("status", xs)
+
+-- | @application/x-www-form-urlencoded@
+instance Consumes UpdatePetWithForm MimeFormUrlEncoded
+
+-- | @application/xml@
+instance Produces UpdatePetWithForm MimeXML
+-- | @application/json@
+instance Produces UpdatePetWithForm MimeJSON
+
+
+-- *** uploadFile
+
+-- | @POST \/pet\/{petId}\/uploadImage@
+-- 
+-- uploads an image
+-- 
+-- 
+-- 
+-- AuthMethod: 'AuthOAuthPetstoreAuth'
+-- 
+uploadFile 
+  :: (Consumes UploadFile contentType)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> PetId -- ^ "petId" -  ID of pet to update
+  -> SwaggerPetstoreRequest UploadFile contentType ApiResponse accept
+uploadFile _  _ (PetId petId) =
+  _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"]
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
+
+data UploadFile  
+
+-- | /Optional Param/ "additionalMetadata" - Additional data to pass to server
+instance HasOptionalParam UploadFile AdditionalMetadata where
+  applyOptionalParam req (AdditionalMetadata xs) =
+    req `_addMultiFormPart` NH.partLBS "additionalMetadata" (mimeRender' MimeMultipartFormData xs)
+
+-- | /Optional Param/ "file" - file to upload
+instance HasOptionalParam UploadFile File where
+  applyOptionalParam req (File xs) =
+    req `_addMultiFormPart` NH.partFileSource "file" xs
+
+-- | @multipart/form-data@
+instance Consumes UploadFile MimeMultipartFormData
+
+-- | @application/json@
+instance Produces UploadFile MimeJSON
+
+
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.Store.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.Store.html new file mode 100644 index 00000000000..7853a0ffbad --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.Store.html @@ -0,0 +1,156 @@ +
{-
+   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: \" \\
+
+   OpenAPI spec version: 2.0
+   Swagger Petstore API version: 1.0.0
+   Contact: apiteam@swagger.io
+   Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+-}
+
+{-|
+Module : SwaggerPetstore.API.Store
+-}
+
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE MonoLocalBinds #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-}
+
+module SwaggerPetstore.API.Store where
+
+import SwaggerPetstore.Core
+import SwaggerPetstore.MimeTypes
+import SwaggerPetstore.Model as M
+
+import qualified Data.Aeson as A
+import qualified Data.ByteString as B
+import qualified Data.ByteString.Lazy as BL
+import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep)
+import qualified Data.Foldable as P
+import qualified Data.Map as Map
+import qualified Data.Maybe as P
+import qualified Data.Proxy as P (Proxy(..))
+import qualified Data.Set as Set
+import qualified Data.String as P
+import qualified Data.Text as T
+import qualified Data.Text.Encoding as T
+import qualified Data.Text.Lazy as TL
+import qualified Data.Text.Lazy.Encoding as TL
+import qualified Data.Time as TI
+import qualified Network.HTTP.Client.MultipartFormData as NH
+import qualified Network.HTTP.Media as ME
+import qualified Network.HTTP.Types as NH
+import qualified Web.FormUrlEncoded as WH
+import qualified Web.HttpApiData as WH
+
+import Data.Text (Text)
+import GHC.Base ((<|>))
+
+import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor)
+import qualified Prelude as P
+
+-- * Operations
+
+
+-- ** Store
+
+-- *** deleteOrder
+
+-- | @DELETE \/store\/order\/{order_id}@
+-- 
+-- Delete purchase order by ID
+-- 
+-- For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+-- 
+-- Note: Has 'Produces' instances, but no response schema
+-- 
+deleteOrder 
+  :: Accept accept -- ^ request accept ('MimeType')
+  -> OrderIdText -- ^ "orderId" -  ID of the order that needs to be deleted
+  -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res accept
+deleteOrder  _ (OrderIdText orderId) =
+  _mkRequest "DELETE" ["/store/order/",toPath orderId]
+
+data DeleteOrder  
+-- | @application/xml@
+instance Produces DeleteOrder MimeXML
+-- | @application/json@
+instance Produces DeleteOrder MimeJSON
+
+
+-- *** getInventory
+
+-- | @GET \/store\/inventory@
+-- 
+-- Returns pet inventories by status
+-- 
+-- Returns a map of status codes to quantities
+-- 
+-- AuthMethod: 'AuthApiKeyApiKey'
+-- 
+getInventory 
+  :: Accept accept -- ^ request accept ('MimeType')
+  -> SwaggerPetstoreRequest GetInventory MimeNoContent ((Map.Map String Int)) accept
+getInventory  _ =
+  _mkRequest "GET" ["/store/inventory"]
+    `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey)
+
+data GetInventory  
+-- | @application/json@
+instance Produces GetInventory MimeJSON
+
+
+-- *** getOrderById
+
+-- | @GET \/store\/order\/{order_id}@
+-- 
+-- Find purchase order by ID
+-- 
+-- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+-- 
+getOrderById 
+  :: Accept accept -- ^ request accept ('MimeType')
+  -> OrderId -- ^ "orderId" -  ID of pet that needs to be fetched
+  -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order accept
+getOrderById  _ (OrderId orderId) =
+  _mkRequest "GET" ["/store/order/",toPath orderId]
+
+data GetOrderById  
+-- | @application/xml@
+instance Produces GetOrderById MimeXML
+-- | @application/json@
+instance Produces GetOrderById MimeJSON
+
+
+-- *** placeOrder
+
+-- | @POST \/store\/order@
+-- 
+-- Place an order for a pet
+-- 
+-- 
+-- 
+placeOrder 
+  :: (Consumes PlaceOrder contentType, MimeRender contentType Order)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> Order -- ^ "body" -  order placed for purchasing the pet
+  -> SwaggerPetstoreRequest PlaceOrder contentType Order accept
+placeOrder _  _ body =
+  _mkRequest "POST" ["/store/order"]
+    `setBodyParam` body
+
+data PlaceOrder 
+
+-- | /Body Param/ "body" - order placed for purchasing the pet
+instance HasBodyParam PlaceOrder Order 
+-- | @application/xml@
+instance Produces PlaceOrder MimeXML
+-- | @application/json@
+instance Produces PlaceOrder MimeJSON
+
+
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.User.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.User.html new file mode 100644 index 00000000000..434add12fed --- /dev/null +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.User.html @@ -0,0 +1,275 @@ +
{-
+   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: \" \\
+
+   OpenAPI spec version: 2.0
+   Swagger Petstore API version: 1.0.0
+   Contact: apiteam@swagger.io
+   Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+-}
+
+{-|
+Module : SwaggerPetstore.API.User
+-}
+
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE MonoLocalBinds #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-}
+
+module SwaggerPetstore.API.User where
+
+import SwaggerPetstore.Core
+import SwaggerPetstore.MimeTypes
+import SwaggerPetstore.Model as M
+
+import qualified Data.Aeson as A
+import qualified Data.ByteString as B
+import qualified Data.ByteString.Lazy as BL
+import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep)
+import qualified Data.Foldable as P
+import qualified Data.Map as Map
+import qualified Data.Maybe as P
+import qualified Data.Proxy as P (Proxy(..))
+import qualified Data.Set as Set
+import qualified Data.String as P
+import qualified Data.Text as T
+import qualified Data.Text.Encoding as T
+import qualified Data.Text.Lazy as TL
+import qualified Data.Text.Lazy.Encoding as TL
+import qualified Data.Time as TI
+import qualified Network.HTTP.Client.MultipartFormData as NH
+import qualified Network.HTTP.Media as ME
+import qualified Network.HTTP.Types as NH
+import qualified Web.FormUrlEncoded as WH
+import qualified Web.HttpApiData as WH
+
+import Data.Text (Text)
+import GHC.Base ((<|>))
+
+import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor)
+import qualified Prelude as P
+
+-- * Operations
+
+
+-- ** User
+
+-- *** createUser
+
+-- | @POST \/user@
+-- 
+-- Create user
+-- 
+-- This can only be done by the logged in user.
+-- 
+-- Note: Has 'Produces' instances, but no response schema
+-- 
+createUser 
+  :: (Consumes CreateUser contentType, MimeRender contentType User)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> User -- ^ "body" -  Created user object
+  -> SwaggerPetstoreRequest CreateUser contentType res accept
+createUser _  _ body =
+  _mkRequest "POST" ["/user"]
+    `setBodyParam` body
+
+data CreateUser 
+
+-- | /Body Param/ "body" - Created user object
+instance HasBodyParam CreateUser User 
+-- | @application/xml@
+instance Produces CreateUser MimeXML
+-- | @application/json@
+instance Produces CreateUser MimeJSON
+
+
+-- *** createUsersWithArrayInput
+
+-- | @POST \/user\/createWithArray@
+-- 
+-- Creates list of users with given input array
+-- 
+-- 
+-- 
+-- Note: Has 'Produces' instances, but no response schema
+-- 
+createUsersWithArrayInput 
+  :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> Body -- ^ "body" -  List of user object
+  -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res accept
+createUsersWithArrayInput _  _ body =
+  _mkRequest "POST" ["/user/createWithArray"]
+    `setBodyParam` body
+
+data CreateUsersWithArrayInput 
+
+-- | /Body Param/ "body" - List of user object
+instance HasBodyParam CreateUsersWithArrayInput Body 
+-- | @application/xml@
+instance Produces CreateUsersWithArrayInput MimeXML
+-- | @application/json@
+instance Produces CreateUsersWithArrayInput MimeJSON
+
+
+-- *** createUsersWithListInput
+
+-- | @POST \/user\/createWithList@
+-- 
+-- Creates list of users with given input array
+-- 
+-- 
+-- 
+-- Note: Has 'Produces' instances, but no response schema
+-- 
+createUsersWithListInput 
+  :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> Body -- ^ "body" -  List of user object
+  -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res accept
+createUsersWithListInput _  _ body =
+  _mkRequest "POST" ["/user/createWithList"]
+    `setBodyParam` body
+
+data CreateUsersWithListInput 
+
+-- | /Body Param/ "body" - List of user object
+instance HasBodyParam CreateUsersWithListInput Body 
+-- | @application/xml@
+instance Produces CreateUsersWithListInput MimeXML
+-- | @application/json@
+instance Produces CreateUsersWithListInput MimeJSON
+
+
+-- *** deleteUser
+
+-- | @DELETE \/user\/{username}@
+-- 
+-- Delete user
+-- 
+-- This can only be done by the logged in user.
+-- 
+-- Note: Has 'Produces' instances, but no response schema
+-- 
+deleteUser 
+  :: Accept accept -- ^ request accept ('MimeType')
+  -> Username -- ^ "username" -  The name that needs to be deleted
+  -> SwaggerPetstoreRequest DeleteUser MimeNoContent res accept
+deleteUser  _ (Username username) =
+  _mkRequest "DELETE" ["/user/",toPath username]
+
+data DeleteUser  
+-- | @application/xml@
+instance Produces DeleteUser MimeXML
+-- | @application/json@
+instance Produces DeleteUser MimeJSON
+
+
+-- *** getUserByName
+
+-- | @GET \/user\/{username}@
+-- 
+-- Get user by user name
+-- 
+-- 
+-- 
+getUserByName 
+  :: Accept accept -- ^ request accept ('MimeType')
+  -> Username -- ^ "username" -  The name that needs to be fetched. Use user1 for testing. 
+  -> SwaggerPetstoreRequest GetUserByName MimeNoContent User accept
+getUserByName  _ (Username username) =
+  _mkRequest "GET" ["/user/",toPath username]
+
+data GetUserByName  
+-- | @application/xml@
+instance Produces GetUserByName MimeXML
+-- | @application/json@
+instance Produces GetUserByName MimeJSON
+
+
+-- *** loginUser
+
+-- | @GET \/user\/login@
+-- 
+-- Logs user into the system
+-- 
+-- 
+-- 
+loginUser 
+  :: Accept accept -- ^ request accept ('MimeType')
+  -> Username -- ^ "username" -  The user name for login
+  -> Password -- ^ "password" -  The password for login in clear text
+  -> SwaggerPetstoreRequest LoginUser MimeNoContent Text accept
+loginUser  _ (Username username) (Password password) =
+  _mkRequest "GET" ["/user/login"]
+    `setQuery` toQuery ("username", Just username)
+    `setQuery` toQuery ("password", Just password)
+
+data LoginUser  
+-- | @application/xml@
+instance Produces LoginUser MimeXML
+-- | @application/json@
+instance Produces LoginUser MimeJSON
+
+
+-- *** logoutUser
+
+-- | @GET \/user\/logout@
+-- 
+-- Logs out current logged in user session
+-- 
+-- 
+-- 
+-- Note: Has 'Produces' instances, but no response schema
+-- 
+logoutUser 
+  :: Accept accept -- ^ request accept ('MimeType')
+  -> SwaggerPetstoreRequest LogoutUser MimeNoContent res accept
+logoutUser  _ =
+  _mkRequest "GET" ["/user/logout"]
+
+data LogoutUser  
+-- | @application/xml@
+instance Produces LogoutUser MimeXML
+-- | @application/json@
+instance Produces LogoutUser MimeJSON
+
+
+-- *** updateUser
+
+-- | @PUT \/user\/{username}@
+-- 
+-- Updated user
+-- 
+-- This can only be done by the logged in user.
+-- 
+-- Note: Has 'Produces' instances, but no response schema
+-- 
+updateUser 
+  :: (Consumes UpdateUser contentType, MimeRender contentType User)
+  => ContentType contentType -- ^ request content-type ('MimeType')
+  -> Accept accept -- ^ request accept ('MimeType')
+  -> Username -- ^ "username" -  name that need to be deleted
+  -> User -- ^ "body" -  Updated user object
+  -> SwaggerPetstoreRequest UpdateUser contentType res accept
+updateUser _  _ (Username username) body =
+  _mkRequest "PUT" ["/user/",toPath username]
+    `setBodyParam` body
+
+data UpdateUser 
+
+-- | /Body Param/ "body" - Updated user object
+instance HasBodyParam UpdateUser User 
+-- | @application/xml@
+instance Produces UpdateUser MimeXML
+-- | @application/json@
+instance Produces UpdateUser MimeJSON
+
+
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.html index d4e92747317..aa322eca837 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.API.html @@ -13,1150 +13,18 @@ Module : SwaggerPetstore.API -} -{-# LANGUAGE ConstraintKinds #-} -{-# LANGUAGE ExistentialQuantification #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE InstanceSigs #-} -{-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} - -module SwaggerPetstore.API where - -import SwaggerPetstore.Core -import SwaggerPetstore.MimeTypes -import SwaggerPetstore.Model as M - -import qualified Data.Aeson as A -import qualified Data.ByteString as B -import qualified Data.ByteString.Base64 as B64 -import qualified Data.ByteString.Char8 as BC -import qualified Data.ByteString.Lazy as BL -import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) -import qualified Data.Foldable as P -import qualified Data.Map as Map -import qualified Data.Maybe as P -import qualified Data.Proxy as P (Proxy(..)) -import qualified Data.Set as Set -import qualified Data.String as P -import qualified Data.Text as T -import qualified Data.Text.Encoding as T -import qualified Data.Text.Lazy as TL -import qualified Data.Text.Lazy.Encoding as TL -import qualified Data.Time as TI -import qualified GHC.Base as P (Alternative) -import qualified Lens.Micro as L -import qualified Network.HTTP.Client.MultipartFormData as NH -import qualified Network.HTTP.Media as ME -import qualified Network.HTTP.Types as NH -import qualified Web.FormUrlEncoded as WH -import qualified Web.HttpApiData as WH - -import Data.Monoid ((<>)) -import Data.Function ((&)) -import Data.Text (Text) -import GHC.Base ((<|>)) - -import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) -import qualified Prelude as P - --- * Operations - - --- ** AnotherFake - --- *** testSpecialTags - --- | @PATCH \/another-fake\/dummy@ --- --- To test special tags --- --- To test special tags --- -testSpecialTags - :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Client -- ^ "body" - client model - -> SwaggerPetstoreRequest TestSpecialTags contentType Client accept -testSpecialTags _ _ body = - _mkRequest "PATCH" ["/another-fake/dummy"] - `setBodyParam` body - -data TestSpecialTags - --- | /Body Param/ "body" - client model -instance HasBodyParam TestSpecialTags Client - --- | @application/json@ -instance Consumes TestSpecialTags MimeJSON - --- | @application/json@ -instance Produces TestSpecialTags MimeJSON - - --- ** Fake - --- *** fakeOuterBooleanSerialize - --- | @POST \/fake\/outer\/boolean@ --- --- Test serialization of outer boolean types --- -fakeOuterBooleanSerialize - :: (Consumes FakeOuterBooleanSerialize contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> SwaggerPetstoreRequest FakeOuterBooleanSerialize contentType OuterBoolean accept -fakeOuterBooleanSerialize _ _ = - _mkRequest "POST" ["/fake/outer/boolean"] - -data FakeOuterBooleanSerialize - --- | /Body Param/ "body" - Input boolean as post body -instance HasBodyParam FakeOuterBooleanSerialize OuterBoolean - --- *** fakeOuterCompositeSerialize - --- | @POST \/fake\/outer\/composite@ --- --- Test serialization of object with outer number type --- -fakeOuterCompositeSerialize - :: (Consumes FakeOuterCompositeSerialize contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> SwaggerPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite accept -fakeOuterCompositeSerialize _ _ = - _mkRequest "POST" ["/fake/outer/composite"] - -data FakeOuterCompositeSerialize - --- | /Body Param/ "body" - Input composite as post body -instance HasBodyParam FakeOuterCompositeSerialize OuterComposite - --- *** fakeOuterNumberSerialize - --- | @POST \/fake\/outer\/number@ --- --- Test serialization of outer number types --- -fakeOuterNumberSerialize - :: (Consumes FakeOuterNumberSerialize contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> SwaggerPetstoreRequest FakeOuterNumberSerialize contentType OuterNumber accept -fakeOuterNumberSerialize _ _ = - _mkRequest "POST" ["/fake/outer/number"] - -data FakeOuterNumberSerialize - --- | /Body Param/ "body" - Input number as post body -instance HasBodyParam FakeOuterNumberSerialize OuterNumber - --- *** fakeOuterStringSerialize - --- | @POST \/fake\/outer\/string@ --- --- Test serialization of outer string types --- -fakeOuterStringSerialize - :: (Consumes FakeOuterStringSerialize contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> SwaggerPetstoreRequest FakeOuterStringSerialize contentType OuterString accept -fakeOuterStringSerialize _ _ = - _mkRequest "POST" ["/fake/outer/string"] - -data FakeOuterStringSerialize - --- | /Body Param/ "body" - Input string as post body -instance HasBodyParam FakeOuterStringSerialize OuterString - --- *** testClientModel - --- | @PATCH \/fake@ --- --- To test \"client\" model --- --- To test \"client\" model --- -testClientModel - :: (Consumes TestClientModel contentType, MimeRender contentType Client) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Client -- ^ "body" - client model - -> SwaggerPetstoreRequest TestClientModel contentType Client accept -testClientModel _ _ body = - _mkRequest "PATCH" ["/fake"] - `setBodyParam` body - -data TestClientModel - --- | /Body Param/ "body" - client model -instance HasBodyParam TestClientModel Client - --- | @application/json@ -instance Consumes TestClientModel MimeJSON - --- | @application/json@ -instance Produces TestClientModel MimeJSON - - --- *** testEndpointParameters - --- | @POST \/fake@ --- --- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 --- --- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 --- --- AuthMethod: 'AuthBasicHttpBasicTest' --- --- Note: Has 'Produces' instances, but no response schema --- -testEndpointParameters - :: (Consumes TestEndpointParameters contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Number -- ^ "number" - None - -> ParamDouble -- ^ "double" - None - -> PatternWithoutDelimiter -- ^ "patternWithoutDelimiter" - None - -> Byte -- ^ "byte" - None - -> SwaggerPetstoreRequest TestEndpointParameters contentType res accept -testEndpointParameters _ _ (Number number) (ParamDouble double) (PatternWithoutDelimiter patternWithoutDelimiter) (Byte byte) = - _mkRequest "POST" ["/fake"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicHttpBasicTest) - `addForm` toForm ("number", number) - `addForm` toForm ("double", double) - `addForm` toForm ("pattern_without_delimiter", patternWithoutDelimiter) - `addForm` toForm ("byte", byte) - -data TestEndpointParameters - --- | /Optional Param/ "integer" - None -instance HasOptionalParam TestEndpointParameters ParamInteger where - applyOptionalParam req (ParamInteger xs) = - req `addForm` toForm ("integer", xs) - --- | /Optional Param/ "int32" - None -instance HasOptionalParam TestEndpointParameters Int32 where - applyOptionalParam req (Int32 xs) = - req `addForm` toForm ("int32", xs) - --- | /Optional Param/ "int64" - None -instance HasOptionalParam TestEndpointParameters Int64 where - applyOptionalParam req (Int64 xs) = - req `addForm` toForm ("int64", xs) - --- | /Optional Param/ "float" - None -instance HasOptionalParam TestEndpointParameters ParamFloat where - applyOptionalParam req (ParamFloat xs) = - req `addForm` toForm ("float", xs) - --- | /Optional Param/ "string" - None -instance HasOptionalParam TestEndpointParameters ParamString where - applyOptionalParam req (ParamString xs) = - req `addForm` toForm ("string", xs) - --- | /Optional Param/ "binary" - None -instance HasOptionalParam TestEndpointParameters ParamBinary where - applyOptionalParam req (ParamBinary xs) = - req `addForm` toForm ("binary", xs) - --- | /Optional Param/ "date" - None -instance HasOptionalParam TestEndpointParameters ParamDate where - applyOptionalParam req (ParamDate xs) = - req `addForm` toForm ("date", xs) - --- | /Optional Param/ "dateTime" - None -instance HasOptionalParam TestEndpointParameters ParamDateTime where - applyOptionalParam req (ParamDateTime xs) = - req `addForm` toForm ("dateTime", xs) - --- | /Optional Param/ "password" - None -instance HasOptionalParam TestEndpointParameters Password where - applyOptionalParam req (Password xs) = - req `addForm` toForm ("password", xs) - --- | /Optional Param/ "callback" - None -instance HasOptionalParam TestEndpointParameters Callback where - applyOptionalParam req (Callback xs) = - req `addForm` toForm ("callback", xs) - --- | @application/xml; charset=utf-8@ -instance Consumes TestEndpointParameters MimeXmlCharsetutf8 --- | @application/json; charset=utf-8@ -instance Consumes TestEndpointParameters MimeJsonCharsetutf8 - --- | @application/xml; charset=utf-8@ -instance Produces TestEndpointParameters MimeXmlCharsetutf8 --- | @application/json; charset=utf-8@ -instance Produces TestEndpointParameters MimeJsonCharsetutf8 - - --- *** testEnumParameters - --- | @GET \/fake@ --- --- To test enum parameters --- --- To test enum parameters --- --- Note: Has 'Produces' instances, but no response schema --- -testEnumParameters - :: (Consumes TestEnumParameters contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> SwaggerPetstoreRequest TestEnumParameters contentType res accept -testEnumParameters _ _ = - _mkRequest "GET" ["/fake"] - -data TestEnumParameters - --- | /Optional Param/ "enum_form_string_array" - Form parameter enum test (string array) -instance HasOptionalParam TestEnumParameters EnumFormStringArray where - applyOptionalParam req (EnumFormStringArray xs) = - req `addForm` toFormColl CommaSeparated ("enum_form_string_array", xs) - --- | /Optional Param/ "enum_form_string" - Form parameter enum test (string) -instance HasOptionalParam TestEnumParameters EnumFormString where - applyOptionalParam req (EnumFormString xs) = - req `addForm` toForm ("enum_form_string", xs) - --- | /Optional Param/ "enum_header_string_array" - Header parameter enum test (string array) -instance HasOptionalParam TestEnumParameters EnumHeaderStringArray where - applyOptionalParam req (EnumHeaderStringArray xs) = - req `setHeader` toHeaderColl CommaSeparated ("enum_header_string_array", xs) - --- | /Optional Param/ "enum_header_string" - Header parameter enum test (string) -instance HasOptionalParam TestEnumParameters EnumHeaderString where - applyOptionalParam req (EnumHeaderString xs) = - req `setHeader` toHeader ("enum_header_string", xs) - --- | /Optional Param/ "enum_query_string_array" - Query parameter enum test (string array) -instance HasOptionalParam TestEnumParameters EnumQueryStringArray where - applyOptionalParam req (EnumQueryStringArray xs) = - req `setQuery` toQueryColl CommaSeparated ("enum_query_string_array", Just xs) - --- | /Optional Param/ "enum_query_string" - Query parameter enum test (string) -instance HasOptionalParam TestEnumParameters EnumQueryString where - applyOptionalParam req (EnumQueryString xs) = - req `setQuery` toQuery ("enum_query_string", Just xs) - --- | /Optional Param/ "enum_query_integer" - Query parameter enum test (double) -instance HasOptionalParam TestEnumParameters EnumQueryInteger where - applyOptionalParam req (EnumQueryInteger xs) = - req `setQuery` toQuery ("enum_query_integer", Just xs) - --- | /Optional Param/ "enum_query_double" - Query parameter enum test (double) -instance HasOptionalParam TestEnumParameters EnumQueryDouble where - applyOptionalParam req (EnumQueryDouble xs) = - req `addForm` toForm ("enum_query_double", xs) - --- | @*/*@ -instance Consumes TestEnumParameters MimeAny - --- | @*/*@ -instance Produces TestEnumParameters MimeAny - - --- *** testInlineAdditionalProperties - --- | @POST \/fake\/inline-additionalProperties@ --- --- test inline additionalProperties --- --- --- -testInlineAdditionalProperties - :: (Consumes TestInlineAdditionalProperties contentType, MimeRender contentType A.Value) - => ContentType contentType -- ^ request content-type ('MimeType') - -> A.Value -- ^ "param" - request body - -> SwaggerPetstoreRequest TestInlineAdditionalProperties contentType NoContent MimeNoContent -testInlineAdditionalProperties _ param = - _mkRequest "POST" ["/fake/inline-additionalProperties"] - `setBodyParam` param - -data TestInlineAdditionalProperties - --- | /Body Param/ "param" - request body -instance HasBodyParam TestInlineAdditionalProperties A.Value - --- | @application/json@ -instance Consumes TestInlineAdditionalProperties MimeJSON - - --- *** testJsonFormData - --- | @GET \/fake\/jsonFormData@ --- --- test json serialization of form data --- --- --- -testJsonFormData - :: (Consumes TestJsonFormData contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Param -- ^ "param" - field1 - -> Param2 -- ^ "param2" - field2 - -> SwaggerPetstoreRequest TestJsonFormData contentType NoContent MimeNoContent -testJsonFormData _ (Param param) (Param2 param2) = - _mkRequest "GET" ["/fake/jsonFormData"] - `addForm` toForm ("param", param) - `addForm` toForm ("param2", param2) - -data TestJsonFormData - --- | @application/json@ -instance Consumes TestJsonFormData MimeJSON - - --- ** FakeClassnameTags123 - --- *** testClassname - --- | @PATCH \/fake_classname_test@ --- --- To test class name in snake case --- --- AuthMethod: 'AuthApiKeyApiKeyQuery' --- -testClassname - :: (Consumes TestClassname contentType, MimeRender contentType Client) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Client -- ^ "body" - client model - -> SwaggerPetstoreRequest TestClassname contentType Client accept -testClassname _ _ body = - _mkRequest "PATCH" ["/fake_classname_test"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKeyQuery) - `setBodyParam` body - -data TestClassname - --- | /Body Param/ "body" - client model -instance HasBodyParam TestClassname Client - --- | @application/json@ -instance Consumes TestClassname MimeJSON - --- | @application/json@ -instance Produces TestClassname MimeJSON - - --- ** Pet - --- *** addPet - --- | @POST \/pet@ --- --- Add a new pet to the store --- --- --- --- AuthMethod: 'AuthOAuthPetstoreAuth' --- --- Note: Has 'Produces' instances, but no response schema --- -addPet - :: (Consumes AddPet contentType, MimeRender contentType Pet) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest AddPet contentType res accept -addPet _ _ body = - _mkRequest "POST" ["/pet"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setBodyParam` body - -data AddPet - --- | /Body Param/ "body" - Pet object that needs to be added to the store -instance HasBodyParam AddPet Pet - --- | @application/json@ -instance Consumes AddPet MimeJSON --- | @application/xml@ -instance Consumes AddPet MimeXML - --- | @application/xml@ -instance Produces AddPet MimeXML --- | @application/json@ -instance Produces AddPet MimeJSON - - --- *** deletePet - --- | @DELETE \/pet\/{petId}@ --- --- Deletes a pet --- --- --- --- AuthMethod: 'AuthOAuthPetstoreAuth' --- --- Note: Has 'Produces' instances, but no response schema --- -deletePet - :: Accept accept -- ^ request accept ('MimeType') - -> PetId -- ^ "petId" - Pet id to delete - -> SwaggerPetstoreRequest DeletePet MimeNoContent res accept -deletePet _ (PetId petId) = - _mkRequest "DELETE" ["/pet/",toPath petId] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - -data DeletePet -instance HasOptionalParam DeletePet ApiKey where - applyOptionalParam req (ApiKey xs) = - req `setHeader` toHeader ("api_key", xs) --- | @application/xml@ -instance Produces DeletePet MimeXML --- | @application/json@ -instance Produces DeletePet MimeJSON - - --- *** findPetsByStatus - --- | @GET \/pet\/findByStatus@ --- --- Finds Pets by status --- --- Multiple status values can be provided with comma separated strings --- --- AuthMethod: 'AuthOAuthPetstoreAuth' --- -findPetsByStatus - :: Accept accept -- ^ request accept ('MimeType') - -> Status -- ^ "status" - Status values that need to be considered for filter - -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] accept -findPetsByStatus _ (Status status) = - _mkRequest "GET" ["/pet/findByStatus"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setQuery` toQueryColl CommaSeparated ("status", Just status) - -data FindPetsByStatus --- | @application/xml@ -instance Produces FindPetsByStatus MimeXML --- | @application/json@ -instance Produces FindPetsByStatus MimeJSON - - --- *** findPetsByTags - --- | @GET \/pet\/findByTags@ --- --- Finds Pets by tags --- --- Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. --- --- AuthMethod: 'AuthOAuthPetstoreAuth' --- -findPetsByTags - :: Accept accept -- ^ request accept ('MimeType') - -> Tags -- ^ "tags" - Tags to filter by - -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept -findPetsByTags _ (Tags tags) = - _mkRequest "GET" ["/pet/findByTags"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setQuery` toQueryColl CommaSeparated ("tags", Just tags) - -{-# DEPRECATED findPetsByTags "" #-} - -data FindPetsByTags --- | @application/xml@ -instance Produces FindPetsByTags MimeXML --- | @application/json@ -instance Produces FindPetsByTags MimeJSON - - --- *** getPetById - --- | @GET \/pet\/{petId}@ --- --- Find pet by ID --- --- Returns a single pet --- --- AuthMethod: 'AuthApiKeyApiKey' --- -getPetById - :: Accept accept -- ^ request accept ('MimeType') - -> PetId -- ^ "petId" - ID of pet to return - -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet accept -getPetById _ (PetId petId) = - _mkRequest "GET" ["/pet/",toPath petId] - `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey) - -data GetPetById --- | @application/xml@ -instance Produces GetPetById MimeXML --- | @application/json@ -instance Produces GetPetById MimeJSON - - --- *** updatePet - --- | @PUT \/pet@ --- --- Update an existing pet --- --- --- --- AuthMethod: 'AuthOAuthPetstoreAuth' --- --- Note: Has 'Produces' instances, but no response schema --- -updatePet - :: (Consumes UpdatePet contentType, MimeRender contentType Pet) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest UpdatePet contentType res accept -updatePet _ _ body = - _mkRequest "PUT" ["/pet"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setBodyParam` body - -data UpdatePet - --- | /Body Param/ "body" - Pet object that needs to be added to the store -instance HasBodyParam UpdatePet Pet - --- | @application/json@ -instance Consumes UpdatePet MimeJSON --- | @application/xml@ -instance Consumes UpdatePet MimeXML - --- | @application/xml@ -instance Produces UpdatePet MimeXML --- | @application/json@ -instance Produces UpdatePet MimeJSON - - --- *** updatePetWithForm - --- | @POST \/pet\/{petId}@ --- --- Updates a pet in the store with form data --- --- --- --- AuthMethod: 'AuthOAuthPetstoreAuth' --- --- Note: Has 'Produces' instances, but no response schema --- -updatePetWithForm - :: (Consumes UpdatePetWithForm contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> PetId -- ^ "petId" - ID of pet that needs to be updated - -> SwaggerPetstoreRequest UpdatePetWithForm contentType res accept -updatePetWithForm _ _ (PetId petId) = - _mkRequest "POST" ["/pet/",toPath petId] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - -data UpdatePetWithForm - --- | /Optional Param/ "name" - Updated name of the pet -instance HasOptionalParam UpdatePetWithForm Name2 where - applyOptionalParam req (Name2 xs) = - req `addForm` toForm ("name", xs) - --- | /Optional Param/ "status" - Updated status of the pet -instance HasOptionalParam UpdatePetWithForm StatusText where - applyOptionalParam req (StatusText xs) = - req `addForm` toForm ("status", xs) - --- | @application/x-www-form-urlencoded@ -instance Consumes UpdatePetWithForm MimeFormUrlEncoded - --- | @application/xml@ -instance Produces UpdatePetWithForm MimeXML --- | @application/json@ -instance Produces UpdatePetWithForm MimeJSON - - --- *** uploadFile - --- | @POST \/pet\/{petId}\/uploadImage@ --- --- uploads an image --- --- --- --- AuthMethod: 'AuthOAuthPetstoreAuth' --- -uploadFile - :: (Consumes UploadFile contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> PetId -- ^ "petId" - ID of pet to update - -> SwaggerPetstoreRequest UploadFile contentType ApiResponse accept -uploadFile _ _ (PetId petId) = - _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - -data UploadFile - --- | /Optional Param/ "additionalMetadata" - Additional data to pass to server -instance HasOptionalParam UploadFile AdditionalMetadata where - applyOptionalParam req (AdditionalMetadata xs) = - req `_addMultiFormPart` NH.partLBS "additionalMetadata" (mimeRender' MimeMultipartFormData xs) - --- | /Optional Param/ "file" - file to upload -instance HasOptionalParam UploadFile File where - applyOptionalParam req (File xs) = - req `_addMultiFormPart` NH.partFileSource "file" xs - --- | @multipart/form-data@ -instance Consumes UploadFile MimeMultipartFormData - --- | @application/json@ -instance Produces UploadFile MimeJSON - - --- ** Store - --- *** deleteOrder - --- | @DELETE \/store\/order\/{order_id}@ --- --- Delete purchase order by ID --- --- For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors --- --- Note: Has 'Produces' instances, but no response schema --- -deleteOrder - :: Accept accept -- ^ request accept ('MimeType') - -> OrderIdText -- ^ "orderId" - ID of the order that needs to be deleted - -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res accept -deleteOrder _ (OrderIdText orderId) = - _mkRequest "DELETE" ["/store/order/",toPath orderId] - -data DeleteOrder --- | @application/xml@ -instance Produces DeleteOrder MimeXML --- | @application/json@ -instance Produces DeleteOrder MimeJSON - - --- *** getInventory - --- | @GET \/store\/inventory@ --- --- Returns pet inventories by status --- --- Returns a map of status codes to quantities --- --- AuthMethod: 'AuthApiKeyApiKey' --- -getInventory - :: Accept accept -- ^ request accept ('MimeType') - -> SwaggerPetstoreRequest GetInventory MimeNoContent ((Map.Map String Int)) accept -getInventory _ = - _mkRequest "GET" ["/store/inventory"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey) - -data GetInventory --- | @application/json@ -instance Produces GetInventory MimeJSON - - --- *** getOrderById - --- | @GET \/store\/order\/{order_id}@ --- --- Find purchase order by ID --- --- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions --- -getOrderById - :: Accept accept -- ^ request accept ('MimeType') - -> OrderId -- ^ "orderId" - ID of pet that needs to be fetched - -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order accept -getOrderById _ (OrderId orderId) = - _mkRequest "GET" ["/store/order/",toPath orderId] - -data GetOrderById --- | @application/xml@ -instance Produces GetOrderById MimeXML --- | @application/json@ -instance Produces GetOrderById MimeJSON - - --- *** placeOrder - --- | @POST \/store\/order@ --- --- Place an order for a pet --- --- --- -placeOrder - :: (Consumes PlaceOrder contentType, MimeRender contentType Order) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Order -- ^ "body" - order placed for purchasing the pet - -> SwaggerPetstoreRequest PlaceOrder contentType Order accept -placeOrder _ _ body = - _mkRequest "POST" ["/store/order"] - `setBodyParam` body - -data PlaceOrder - --- | /Body Param/ "body" - order placed for purchasing the pet -instance HasBodyParam PlaceOrder Order --- | @application/xml@ -instance Produces PlaceOrder MimeXML --- | @application/json@ -instance Produces PlaceOrder MimeJSON - - --- ** User - --- *** createUser - --- | @POST \/user@ --- --- Create user --- --- This can only be done by the logged in user. --- --- Note: Has 'Produces' instances, but no response schema --- -createUser - :: (Consumes CreateUser contentType, MimeRender contentType User) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> User -- ^ "body" - Created user object - -> SwaggerPetstoreRequest CreateUser contentType res accept -createUser _ _ body = - _mkRequest "POST" ["/user"] - `setBodyParam` body - -data CreateUser - --- | /Body Param/ "body" - Created user object -instance HasBodyParam CreateUser User --- | @application/xml@ -instance Produces CreateUser MimeXML --- | @application/json@ -instance Produces CreateUser MimeJSON - - --- *** createUsersWithArrayInput - --- | @POST \/user\/createWithArray@ --- --- Creates list of users with given input array --- --- --- --- Note: Has 'Produces' instances, but no response schema --- -createUsersWithArrayInput - :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Body -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res accept -createUsersWithArrayInput _ _ body = - _mkRequest "POST" ["/user/createWithArray"] - `setBodyParam` body - -data CreateUsersWithArrayInput - --- | /Body Param/ "body" - List of user object -instance HasBodyParam CreateUsersWithArrayInput Body --- | @application/xml@ -instance Produces CreateUsersWithArrayInput MimeXML --- | @application/json@ -instance Produces CreateUsersWithArrayInput MimeJSON - - --- *** createUsersWithListInput - --- | @POST \/user\/createWithList@ --- --- Creates list of users with given input array --- --- --- --- Note: Has 'Produces' instances, but no response schema --- -createUsersWithListInput - :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Body -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res accept -createUsersWithListInput _ _ body = - _mkRequest "POST" ["/user/createWithList"] - `setBodyParam` body - -data CreateUsersWithListInput - --- | /Body Param/ "body" - List of user object -instance HasBodyParam CreateUsersWithListInput Body --- | @application/xml@ -instance Produces CreateUsersWithListInput MimeXML --- | @application/json@ -instance Produces CreateUsersWithListInput MimeJSON - - --- *** deleteUser - --- | @DELETE \/user\/{username}@ --- --- Delete user --- --- This can only be done by the logged in user. --- --- Note: Has 'Produces' instances, but no response schema --- -deleteUser - :: Accept accept -- ^ request accept ('MimeType') - -> Username -- ^ "username" - The name that needs to be deleted - -> SwaggerPetstoreRequest DeleteUser MimeNoContent res accept -deleteUser _ (Username username) = - _mkRequest "DELETE" ["/user/",toPath username] - -data DeleteUser --- | @application/xml@ -instance Produces DeleteUser MimeXML --- | @application/json@ -instance Produces DeleteUser MimeJSON - - --- *** getUserByName - --- | @GET \/user\/{username}@ --- --- Get user by user name --- --- --- -getUserByName - :: Accept accept -- ^ request accept ('MimeType') - -> Username -- ^ "username" - The name that needs to be fetched. Use user1 for testing. - -> SwaggerPetstoreRequest GetUserByName MimeNoContent User accept -getUserByName _ (Username username) = - _mkRequest "GET" ["/user/",toPath username] - -data GetUserByName --- | @application/xml@ -instance Produces GetUserByName MimeXML --- | @application/json@ -instance Produces GetUserByName MimeJSON - - --- *** loginUser - --- | @GET \/user\/login@ --- --- Logs user into the system --- --- --- -loginUser - :: Accept accept -- ^ request accept ('MimeType') - -> Username -- ^ "username" - The user name for login - -> Password -- ^ "password" - The password for login in clear text - -> SwaggerPetstoreRequest LoginUser MimeNoContent Text accept -loginUser _ (Username username) (Password password) = - _mkRequest "GET" ["/user/login"] - `setQuery` toQuery ("username", Just username) - `setQuery` toQuery ("password", Just password) - -data LoginUser --- | @application/xml@ -instance Produces LoginUser MimeXML --- | @application/json@ -instance Produces LoginUser MimeJSON - - --- *** logoutUser - --- | @GET \/user\/logout@ --- --- Logs out current logged in user session --- --- --- --- Note: Has 'Produces' instances, but no response schema --- -logoutUser - :: Accept accept -- ^ request accept ('MimeType') - -> SwaggerPetstoreRequest LogoutUser MimeNoContent res accept -logoutUser _ = - _mkRequest "GET" ["/user/logout"] - -data LogoutUser --- | @application/xml@ -instance Produces LogoutUser MimeXML --- | @application/json@ -instance Produces LogoutUser MimeJSON - - --- *** updateUser - --- | @PUT \/user\/{username}@ --- --- Updated user --- --- This can only be done by the logged in user. --- --- Note: Has 'Produces' instances, but no response schema --- -updateUser - :: (Consumes UpdateUser contentType, MimeRender contentType User) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Username -- ^ "username" - name that need to be deleted - -> User -- ^ "body" - Updated user object - -> SwaggerPetstoreRequest UpdateUser contentType res accept -updateUser _ _ (Username username) body = - _mkRequest "PUT" ["/user/",toPath username] - `setBodyParam` body - -data UpdateUser - --- | /Body Param/ "body" - Updated user object -instance HasBodyParam UpdateUser User --- | @application/xml@ -instance Produces UpdateUser MimeXML --- | @application/json@ -instance Produces UpdateUser MimeJSON - - - --- * Parameter newtypes - -newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } deriving (P.Eq, P.Show) -newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show) -newtype Body = Body { unBody :: [User] } deriving (P.Eq, P.Show, A.ToJSON) -newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show) -newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show) -newtype EnumFormString = EnumFormString { unEnumFormString :: E'EnumFormString } deriving (P.Eq, P.Show) -newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [E'Inner2] } deriving (P.Eq, P.Show) -newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: E'EnumFormString } deriving (P.Eq, P.Show) -newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [E'Inner2] } deriving (P.Eq, P.Show) -newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: E'EnumNumber } deriving (P.Eq, P.Show) -newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: E'EnumQueryInteger } deriving (P.Eq, P.Show) -newtype EnumQueryString = EnumQueryString { unEnumQueryString :: E'EnumFormString } deriving (P.Eq, P.Show) -newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [E'Inner2] } deriving (P.Eq, P.Show) -newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show) -newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show) -newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show) -newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show) -newtype Number = Number { unNumber :: Double } deriving (P.Eq, P.Show) -newtype OrderId = OrderId { unOrderId :: Integer } deriving (P.Eq, P.Show) -newtype OrderIdText = OrderIdText { unOrderIdText :: Text } deriving (P.Eq, P.Show) -newtype Param = Param { unParam :: Text } deriving (P.Eq, P.Show) -newtype Param2 = Param2 { unParam2 :: Text } deriving (P.Eq, P.Show) -newtype ParamBinary = ParamBinary { unParamBinary :: Binary } deriving (P.Eq, P.Show) -newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show) -newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show) -newtype ParamDouble = ParamDouble { unParamDouble :: Double } deriving (P.Eq, P.Show) -newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show) -newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show) -newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show) -newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show) -newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDelimiter :: Text } deriving (P.Eq, P.Show) -newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show) -newtype Status = Status { unStatus :: [E'Status2] } deriving (P.Eq, P.Show) -newtype StatusText = StatusText { unStatusText :: Text } deriving (P.Eq, P.Show) -newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show) -newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show) - --- * Auth Methods - --- ** AuthApiKeyApiKey -data AuthApiKeyApiKey = - AuthApiKeyApiKey Text -- ^ secret - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthApiKeyApiKey where - applyAuthMethod _ a@(AuthApiKeyApiKey secret) req = - P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("api_key", secret) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - --- ** AuthApiKeyApiKeyQuery -data AuthApiKeyApiKeyQuery = - AuthApiKeyApiKeyQuery Text -- ^ secret - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthApiKeyApiKeyQuery where - applyAuthMethod _ a@(AuthApiKeyApiKeyQuery secret) req = - P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setQuery` toQuery ("api_key_query", Just secret) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - --- ** AuthBasicHttpBasicTest -data AuthBasicHttpBasicTest = - AuthBasicHttpBasicTest B.ByteString B.ByteString -- ^ username password - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthBasicHttpBasicTest where - applyAuthMethod _ a@(AuthBasicHttpBasicTest user pw) req = - P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ]) - --- ** AuthOAuthPetstoreAuth -data AuthOAuthPetstoreAuth = - AuthOAuthPetstoreAuth Text -- ^ secret - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthOAuthPetstoreAuth where - applyAuthMethod _ a@(AuthOAuthPetstoreAuth secret) req = - P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - - - --- * Custom Mime Types - --- ** MimeJsonCharsetutf8 - -data MimeJsonCharsetutf8 = MimeJsonCharsetutf8 deriving (P.Typeable) - --- | @application/json; charset=utf-8@ -instance MimeType MimeJsonCharsetutf8 where - mimeType _ = Just $ P.fromString "application/json; charset=utf-8" -instance A.ToJSON a => MimeRender MimeJsonCharsetutf8 a where mimeRender _ = A.encode -instance A.FromJSON a => MimeUnrender MimeJsonCharsetutf8 a where mimeUnrender _ = A.eitherDecode --- instance MimeRender MimeJsonCharsetutf8 T.Text where mimeRender _ = undefined --- instance MimeUnrender MimeJsonCharsetutf8 T.Text where mimeUnrender _ = undefined - --- ** MimeXmlCharsetutf8 - -data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable) - --- | @application/xml; charset=utf-8@ -instance MimeType MimeXmlCharsetutf8 where - mimeType _ = Just $ P.fromString "application/xml; charset=utf-8" --- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined --- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined - - - \ No newline at end of file +module SwaggerPetstore.API + ( module SwaggerPetstore.API.AnotherFake + , module SwaggerPetstore.API.Fake + , module SwaggerPetstore.API.FakeClassnameTags123 + , module SwaggerPetstore.API.Pet + , module SwaggerPetstore.API.Store + , module SwaggerPetstore.API.User + ) where + +import SwaggerPetstore.API.AnotherFake +import SwaggerPetstore.API.Fake +import SwaggerPetstore.API.FakeClassnameTags123 +import SwaggerPetstore.API.Pet +import SwaggerPetstore.API.Store +import SwaggerPetstore.API.User \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Client.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Client.html index 9b8729a6c45..b990f8ac1e5 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Client.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Client.html @@ -56,20 +56,20 @@ -- | send a request returning the raw http response dispatchLbs - :: (Produces req accept, MimeType contentType) + :: (Produces req accept, MimeType contentType) => NH.Manager -- ^ http-client Connection manager -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res accept -- ^ request + -> SwaggerPetstoreRequest req contentType res accept -- ^ request -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbs manager config request = do - initReq <- _toInitRequest config request - dispatchInitUnsafe manager config initReq +dispatchLbs manager config request = do + initReq <- _toInitRequest config request + dispatchInitUnsafe manager config initReq -- ** Mime -- | pair of decoded http body and http response -data MimeResult res = - MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body +data MimeResult res = + MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response } deriving (Show, Functor, Foldable, Traversable) @@ -83,137 +83,137 @@ -- | send a request returning the 'MimeResult' dispatchMime - :: forall req contentType res accept. (Produces req accept, MimeUnrender accept res, MimeType contentType) + :: forall req contentType res accept. (Produces req accept, MimeUnrender accept res, MimeType contentType) => NH.Manager -- ^ http-client Connection manager -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res accept -- ^ request - -> IO (MimeResult res) -- ^ response -dispatchMime manager config request = do - httpResponse <- dispatchLbs manager config request - let statusCode = NH.statusCode . NH.responseStatus $ httpResponse - parsedResult <- - runConfigLogWithExceptions "Client" config $ - do if (statusCode >= 400 && statusCode < 600) + -> SwaggerPetstoreRequest req contentType res accept -- ^ request + -> IO (MimeResult res) -- ^ response +dispatchMime manager config request = do + httpResponse <- dispatchLbs manager config request + let statusCode = NH.statusCode . NH.responseStatus $ httpResponse + parsedResult <- + runConfigLogWithExceptions "Client" config $ + do if (statusCode >= 400 && statusCode < 600) then do - let s = "error statusCode: " ++ show statusCode - _log "Client" levelError (T.pack s) - pure (Left (MimeError s httpResponse)) - else case mimeUnrender (P.Proxy :: P.Proxy accept) (NH.responseBody httpResponse) of - Left s -> do - _log "Client" levelError (T.pack s) - pure (Left (MimeError s httpResponse)) - Right r -> pure (Right r) - return (MimeResult parsedResult httpResponse) + let s = "error statusCode: " ++ show statusCode + _log "Client" levelError (T.pack s) + pure (Left (MimeError s httpResponse)) + else case mimeUnrender (P.Proxy :: P.Proxy accept) (NH.responseBody httpResponse) of + Left s -> do + _log "Client" levelError (T.pack s) + pure (Left (MimeError s httpResponse)) + Right r -> pure (Right r) + return (MimeResult parsedResult httpResponse) -- | like 'dispatchMime', but only returns the decoded http body dispatchMime' - :: (Produces req accept, MimeUnrender accept res, MimeType contentType) + :: (Produces req accept, MimeUnrender accept res, MimeType contentType) => NH.Manager -- ^ http-client Connection manager -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res accept -- ^ request - -> IO (Either MimeError res) -- ^ response -dispatchMime' manager config request = do - MimeResult parsedResult _ <- dispatchMime manager config request - return parsedResult + -> SwaggerPetstoreRequest req contentType res accept -- ^ request + -> IO (Either MimeError res) -- ^ response +dispatchMime' manager config request = do + MimeResult parsedResult _ <- dispatchMime manager config request + return parsedResult -- ** Unsafe -- | like 'dispatchReqLbs', but does not validate the operation is a 'Producer' of the "accept" 'MimeType'. (Useful if the server's response is undocumented) dispatchLbsUnsafe - :: (MimeType accept, MimeType contentType) + :: (MimeType accept, MimeType contentType) => NH.Manager -- ^ http-client Connection manager -> SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res accept -- ^ request + -> SwaggerPetstoreRequest req contentType res accept -- ^ request -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbsUnsafe manager config request = do - initReq <- _toInitRequest config request - dispatchInitUnsafe manager config initReq +dispatchLbsUnsafe manager config request = do + initReq <- _toInitRequest config request + dispatchInitUnsafe manager config initReq -- | dispatch an InitRequest dispatchInitUnsafe :: NH.Manager -- ^ http-client Connection manager -> SwaggerPetstoreConfig -- ^ config - -> InitRequest req contentType res accept -- ^ init request + -> InitRequest req contentType res accept -- ^ init request -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchInitUnsafe manager config (InitRequest req) = do - runConfigLogWithExceptions src config $ - do _log src levelInfo requestLogMsg - _log src levelDebug requestDbgLogMsg - res <- P.liftIO $ NH.httpLbs req manager - _log src levelInfo (responseLogMsg res) - _log src levelDebug ((T.pack . show) res) - return res +dispatchInitUnsafe manager config (InitRequest req) = do + runConfigLogWithExceptions src config $ + do _log src levelInfo requestLogMsg + _log src levelDebug requestDbgLogMsg + res <- P.liftIO $ NH.httpLbs req manager + _log src levelInfo (responseLogMsg res) + _log src levelDebug ((T.pack . show) res) + return res where - src = "Client" - endpoint = + src = "Client" + endpoint = T.pack $ BC.unpack $ - NH.method req <> " " <> NH.host req <> NH.path req <> NH.queryString req - requestLogMsg = "REQ:" <> endpoint - requestDbgLogMsg = - "Headers=" <> (T.pack . show) (NH.requestHeaders req) <> " Body=" <> - (case NH.requestBody req of - NH.RequestBodyLBS xs -> T.decodeUtf8 (BL.toStrict xs) + NH.method req <> " " <> NH.host req <> NH.path req <> NH.queryString req + requestLogMsg = "REQ:" <> endpoint + requestDbgLogMsg = + "Headers=" <> (T.pack . show) (NH.requestHeaders req) <> " Body=" <> + (case NH.requestBody req of + NH.RequestBodyLBS xs -> T.decodeUtf8 (BL.toStrict xs) _ -> "<RequestBody>") - responseStatusCode = (T.pack . show) . NH.statusCode . NH.responseStatus - responseLogMsg res = - "RES:statusCode=" <> responseStatusCode res <> " (" <> endpoint <> ")" + responseStatusCode = (T.pack . show) . NH.statusCode . NH.responseStatus + responseLogMsg res = + "RES:statusCode=" <> responseStatusCode res <> " (" <> endpoint <> ")" -- * InitRequest -- | wraps an http-client 'Request' with request/response type parameters -newtype InitRequest req contentType res accept = InitRequest +newtype InitRequest req contentType res accept = InitRequest { unInitRequest :: NH.Request } deriving (Show) -- | Build an http-client 'Request' record from the supplied config and request _toInitRequest - :: (MimeType accept, MimeType contentType) + :: (MimeType accept, MimeType contentType) => SwaggerPetstoreConfig -- ^ config - -> SwaggerPetstoreRequest req contentType res accept -- ^ request - -> IO (InitRequest req contentType res accept) -- ^ initialized request -_toInitRequest config req0 = - runConfigLogWithExceptions "Client" config $ do - parsedReq <- P.liftIO $ NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) - req1 <- P.liftIO $ _applyAuthMethods req0 config + -> SwaggerPetstoreRequest req contentType res accept -- ^ request + -> IO (InitRequest req contentType res accept) -- ^ initialized request +_toInitRequest config req0 = + runConfigLogWithExceptions "Client" config $ do + parsedReq <- P.liftIO $ NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) + req1 <- P.liftIO $ _applyAuthMethods req0 config P.when - (configValidateAuthMethods config && (not . null . rAuthTypes) req1) - (E.throw $ AuthMethodException $ "AuthMethod not configured: " <> (show . head . rAuthTypes) req1) - let req2 = req1 & _setContentTypeHeader & _setAcceptHeader - reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req2) - reqQuery = NH.renderQuery True (paramsQuery (rParams req2)) - pReq = parsedReq { NH.method = (rMethod req2) - , NH.requestHeaders = reqHeaders - , NH.queryString = reqQuery + (configValidateAuthMethods config && (not . null . rAuthTypes) req1) + (E.throw $ AuthMethodException $ "AuthMethod not configured: " <> (show . head . rAuthTypes) req1) + let req2 = req1 & _setContentTypeHeader & _setAcceptHeader + reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req2) + reqQuery = NH.renderQuery True (paramsQuery (rParams req2)) + pReq = parsedReq { NH.method = (rMethod req2) + , NH.requestHeaders = reqHeaders + , NH.queryString = reqQuery } - outReq <- case paramsBody (rParams req2) of - ParamBodyNone -> pure (pReq { NH.requestBody = mempty }) - ParamBodyB bs -> pure (pReq { NH.requestBody = NH.RequestBodyBS bs }) - ParamBodyBL bl -> pure (pReq { NH.requestBody = NH.RequestBodyLBS bl }) - ParamBodyFormUrlEncoded form -> pure (pReq { NH.requestBody = NH.RequestBodyLBS (WH.urlEncodeForm form) }) - ParamBodyMultipartFormData parts -> NH.formDataBody parts pReq + outReq <- case paramsBody (rParams req2) of + ParamBodyNone -> pure (pReq { NH.requestBody = mempty }) + ParamBodyB bs -> pure (pReq { NH.requestBody = NH.RequestBodyBS bs }) + ParamBodyBL bl -> pure (pReq { NH.requestBody = NH.RequestBodyLBS bl }) + ParamBodyFormUrlEncoded form -> pure (pReq { NH.requestBody = NH.RequestBodyLBS (WH.urlEncodeForm form) }) + ParamBodyMultipartFormData parts -> NH.formDataBody parts pReq - pure (InitRequest outReq) + pure (InitRequest outReq) -- | modify the underlying Request -modifyInitRequest :: InitRequest req contentType res accept -> (NH.Request -> NH.Request) -> InitRequest req contentType res accept -modifyInitRequest (InitRequest req) f = InitRequest (f req) +modifyInitRequest :: InitRequest req contentType res accept -> (NH.Request -> NH.Request) -> InitRequest req contentType res accept +modifyInitRequest (InitRequest req) f = InitRequest (f req) -- | modify the underlying Request (monadic) -modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (NH.Request -> m NH.Request) -> m (InitRequest req contentType res accept) -modifyInitRequestM (InitRequest req) f = fmap InitRequest (f req) +modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (NH.Request -> m NH.Request) -> m (InitRequest req contentType res accept) +modifyInitRequestM (InitRequest req) f = fmap InitRequest (f req) -- ** Logging -- | Run a block using the configured logger instance runConfigLog - :: P.MonadIO m - => SwaggerPetstoreConfig -> LogExec m -runConfigLog config = configLogExecWithContext config (configLogContext config) + :: P.MonadIO m + => SwaggerPetstoreConfig -> LogExec m +runConfigLog config = configLogExecWithContext config (configLogContext config) -- | Run a block using the configured logger instance (logs exceptions) runConfigLogWithExceptions - :: (E.MonadCatch m, P.MonadIO m) - => T.Text -> SwaggerPetstoreConfig -> LogExec m -runConfigLogWithExceptions src config = runConfigLog config . logExceptions src + :: (E.MonadCatch m, P.MonadIO m) + => T.Text -> SwaggerPetstoreConfig -> LogExec m +runConfigLogWithExceptions src config = runConfigLog config . logExceptions src \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Core.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Core.html index b1f30691c60..1e17ed4cbfc 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Core.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Core.html @@ -82,11 +82,11 @@ -- | display the config instance P.Show SwaggerPetstoreConfig where - show c = + show c = T.printf "{ configHost = %v, configUserAgent = %v, ..}" - (show (configHost c)) - (show (configUserAgent c)) + (show (configHost c)) + (show (configUserAgent c)) -- | constructs a default SwaggerPetstoreConfig -- @@ -100,36 +100,36 @@ -- newConfig :: IO SwaggerPetstoreConfig newConfig = do - logCxt <- initLogContext + logCxt <- initLogContext return $ SwaggerPetstoreConfig { configHost = "http://petstore.swagger.io:80/v2" , configUserAgent = "swagger-haskell-http-client/1.0.0" , configLogExecWithContext = runDefaultLogExecWithContext - , configLogContext = logCxt + , configLogContext = logCxt , configAuthMethods = [] , configValidateAuthMethods = True } -- | updates config use AuthMethod on matching requests -addAuthMethod :: AuthMethod auth => SwaggerPetstoreConfig -> auth -> SwaggerPetstoreConfig -addAuthMethod config@SwaggerPetstoreConfig {configAuthMethods = as} a = - config { configAuthMethods = AnyAuthMethod a : as} +addAuthMethod :: AuthMethod auth => SwaggerPetstoreConfig -> auth -> SwaggerPetstoreConfig +addAuthMethod config@SwaggerPetstoreConfig {configAuthMethods = as} a = + config { configAuthMethods = AnyAuthMethod a : as} -- | updates the config to use stdout logging withStdoutLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig -withStdoutLogging p = do - logCxt <- stdoutLoggingContext (configLogContext p) - return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt } +withStdoutLogging p = do + logCxt <- stdoutLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt } -- | updates the config to use stderr logging withStderrLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig -withStderrLogging p = do - logCxt <- stderrLoggingContext (configLogContext p) - return $ p { configLogExecWithContext = stderrLoggingExec, configLogContext = logCxt } +withStderrLogging p = do + logCxt <- stderrLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stderrLoggingExec, configLogContext = logCxt } -- | updates the config to disable logging withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig -withNoLogging p = p { configLogExecWithContext = runNullLogExec} +withNoLogging p = p { configLogExecWithContext = runNullLogExec} -- * SwaggerPetstoreRequest @@ -141,7 +141,7 @@ -- * contentType - 'MimeType' associated with request body -- * res - response model -- * accept - 'MimeType' associated with response body -data SwaggerPetstoreRequest req contentType res accept = SwaggerPetstoreRequest +data SwaggerPetstoreRequest req contentType res accept = SwaggerPetstoreRequest { rMethod :: NH.Method -- ^ Method of SwaggerPetstoreRequest , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest , rParams :: Params -- ^ params of SwaggerPetstoreRequest @@ -150,47 +150,47 @@ deriving (P.Show) -- | 'rMethod' Lens -rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res accept) NH.Method -rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod +rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res accept) NH.Method +rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod {-# INLINE rMethodL #-} -- | 'rUrlPath' Lens -rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res accept) [BCL.ByteString] -rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath +rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res accept) [BCL.ByteString] +rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath {-# INLINE rUrlPathL #-} -- | 'rParams' Lens -rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res accept) Params -rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams +rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res accept) Params +rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams {-# INLINE rParamsL #-} -- | 'rParams' Lens -rAuthTypesL :: Lens_' (SwaggerPetstoreRequest req contentType res accept) [P.TypeRep] -rAuthTypesL f SwaggerPetstoreRequest{..} = (\rAuthTypes -> SwaggerPetstoreRequest { rAuthTypes, ..} ) <$> f rAuthTypes +rAuthTypesL :: Lens_' (SwaggerPetstoreRequest req contentType res accept) [P.TypeRep] +rAuthTypesL f SwaggerPetstoreRequest{..} = (\rAuthTypes -> SwaggerPetstoreRequest { rAuthTypes, ..} ) <$> f rAuthTypes {-# INLINE rAuthTypesL #-} -- * HasBodyParam -- | Designates the body parameter of a request -class HasBodyParam req param where - setBodyParam :: forall contentType res accept. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res accept -> param -> SwaggerPetstoreRequest req contentType res accept - setBodyParam req xs = - req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader +class HasBodyParam req param where + setBodyParam :: forall contentType res accept. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res accept -> param -> SwaggerPetstoreRequest req contentType res accept + setBodyParam req xs = + req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader -- * HasOptionalParam -- | Designates the optional parameters of a request -class HasOptionalParam req param where +class HasOptionalParam req param where {-# MINIMAL applyOptionalParam | (-&-) #-} -- | Apply an optional parameter to a request - applyOptionalParam :: SwaggerPetstoreRequest req contentType res accept -> param -> SwaggerPetstoreRequest req contentType res accept - applyOptionalParam = (-&-) + applyOptionalParam :: SwaggerPetstoreRequest req contentType res accept -> param -> SwaggerPetstoreRequest req contentType res accept + applyOptionalParam = (-&-) {-# INLINE applyOptionalParam #-} -- | infix operator \/ alias for 'addOptionalParam' - (-&-) :: SwaggerPetstoreRequest req contentType res accept -> param -> SwaggerPetstoreRequest req contentType res accept - (-&-) = applyOptionalParam + (-&-) :: SwaggerPetstoreRequest req contentType res accept -> param -> SwaggerPetstoreRequest req contentType res accept + (-&-) = applyOptionalParam {-# INLINE (-&-) #-} infixl 2 -&- @@ -205,17 +205,17 @@ -- | 'paramsQuery' Lens paramsQueryL :: Lens_' Params NH.Query -paramsQueryL f Params{..} = (\paramsQuery -> Params { paramsQuery, ..} ) <$> f paramsQuery +paramsQueryL f Params{..} = (\paramsQuery -> Params { paramsQuery, ..} ) <$> f paramsQuery {-# INLINE paramsQueryL #-} -- | 'paramsHeaders' Lens paramsHeadersL :: Lens_' Params NH.RequestHeaders -paramsHeadersL f Params{..} = (\paramsHeaders -> Params { paramsHeaders, ..} ) <$> f paramsHeaders +paramsHeadersL f Params{..} = (\paramsHeaders -> Params { paramsHeaders, ..} ) <$> f paramsHeaders {-# INLINE paramsHeadersL #-} -- | 'paramsBody' Lens paramsBodyL :: Lens_' Params ParamBody -paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody +paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody {-# INLINE paramsBodyL #-} -- | Request Body @@ -231,90 +231,90 @@ _mkRequest :: NH.Method -- ^ Method -> [BCL.ByteString] -- ^ Endpoint - -> SwaggerPetstoreRequest req contentType res accept -- ^ req: Request Type, res: Response Type -_mkRequest m u = SwaggerPetstoreRequest m u _mkParams [] + -> SwaggerPetstoreRequest req contentType res accept -- ^ req: Request Type, res: Response Type +_mkRequest m u = SwaggerPetstoreRequest m u _mkParams [] _mkParams :: Params _mkParams = Params [] [] ParamBodyNone -setHeader :: SwaggerPetstoreRequest req contentType res accept -> [NH.Header] -> SwaggerPetstoreRequest req contentType res accept -setHeader req header = - req `removeHeader` P.fmap P.fst header & - L.over (rParamsL . paramsHeadersL) (header P.++) +setHeader :: SwaggerPetstoreRequest req contentType res accept -> [NH.Header] -> SwaggerPetstoreRequest req contentType res accept +setHeader req header = + req `removeHeader` P.fmap P.fst header & + L.over (rParamsL . paramsHeadersL) (header P.++) -removeHeader :: SwaggerPetstoreRequest req contentType res accept -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res accept -removeHeader req header = - req & +removeHeader :: SwaggerPetstoreRequest req contentType res accept -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res accept +removeHeader req header = + req & L.over (rParamsL . paramsHeadersL) - (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) + (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) where - cifst = CI.mk . P.fst + cifst = CI.mk . P.fst -_setContentTypeHeader :: forall req contentType res accept. MimeType contentType => SwaggerPetstoreRequest req contentType res accept -> SwaggerPetstoreRequest req contentType res accept -_setContentTypeHeader req = - case mimeType (P.Proxy :: P.Proxy contentType) of - Just m -> req `setHeader` [("content-type", BC.pack $ P.show m)] - Nothing -> req `removeHeader` ["content-type"] +_setContentTypeHeader :: forall req contentType res accept. MimeType contentType => SwaggerPetstoreRequest req contentType res accept -> SwaggerPetstoreRequest req contentType res accept +_setContentTypeHeader req = + case mimeType (P.Proxy :: P.Proxy contentType) of + Just m -> req `setHeader` [("content-type", BC.pack $ P.show m)] + Nothing -> req `removeHeader` ["content-type"] -_setAcceptHeader :: forall req contentType res accept. MimeType accept => SwaggerPetstoreRequest req contentType res accept -> SwaggerPetstoreRequest req contentType res accept -_setAcceptHeader req = - case mimeType (P.Proxy :: P.Proxy accept) of - Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] - Nothing -> req `removeHeader` ["accept"] +_setAcceptHeader :: forall req contentType res accept. MimeType accept => SwaggerPetstoreRequest req contentType res accept -> SwaggerPetstoreRequest req contentType res accept +_setAcceptHeader req = + case mimeType (P.Proxy :: P.Proxy accept) of + Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] + Nothing -> req `removeHeader` ["accept"] -setQuery :: SwaggerPetstoreRequest req contentType res accept -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res accept -setQuery req query = - req & +setQuery :: SwaggerPetstoreRequest req contentType res accept -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res accept +setQuery req query = + req & L.over (rParamsL . paramsQueryL) - ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) + ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) where - cifst = CI.mk . P.fst + cifst = CI.mk . P.fst -addForm :: SwaggerPetstoreRequest req contentType res accept -> WH.Form -> SwaggerPetstoreRequest req contentType res accept -addForm req newform = - let form = case paramsBody (rParams req) of - ParamBodyFormUrlEncoded _form -> _form +addForm :: SwaggerPetstoreRequest req contentType res accept -> WH.Form -> SwaggerPetstoreRequest req contentType res accept +addForm req newform = + let form = case paramsBody (rParams req) of + ParamBodyFormUrlEncoded _form -> _form _ -> mempty - in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) + in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) -_addMultiFormPart :: SwaggerPetstoreRequest req contentType res accept -> NH.Part -> SwaggerPetstoreRequest req contentType res accept -_addMultiFormPart req newpart = - let parts = case paramsBody (rParams req) of - ParamBodyMultipartFormData _parts -> _parts +_addMultiFormPart :: SwaggerPetstoreRequest req contentType res accept -> NH.Part -> SwaggerPetstoreRequest req contentType res accept +_addMultiFormPart req newpart = + let parts = case paramsBody (rParams req) of + ParamBodyMultipartFormData _parts -> _parts _ -> [] - in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) + in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) -_setBodyBS :: SwaggerPetstoreRequest req contentType res accept -> B.ByteString -> SwaggerPetstoreRequest req contentType res accept -_setBodyBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) +_setBodyBS :: SwaggerPetstoreRequest req contentType res accept -> B.ByteString -> SwaggerPetstoreRequest req contentType res accept +_setBodyBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) -_setBodyLBS :: SwaggerPetstoreRequest req contentType res accept -> BL.ByteString -> SwaggerPetstoreRequest req contentType res accept -_setBodyLBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) +_setBodyLBS :: SwaggerPetstoreRequest req contentType res accept -> BL.ByteString -> SwaggerPetstoreRequest req contentType res accept +_setBodyLBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) -_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res accept -> P.Proxy authMethod -> SwaggerPetstoreRequest req contentType res accept -_hasAuthType req proxy = - req & L.over rAuthTypesL (P.typeRep proxy :) +_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res accept -> P.Proxy authMethod -> SwaggerPetstoreRequest req contentType res accept +_hasAuthType req proxy = + req & L.over rAuthTypesL (P.typeRep proxy :) -- ** Params Utils toPath - :: WH.ToHttpApiData a - => a -> BCL.ByteString + :: WH.ToHttpApiData a + => a -> BCL.ByteString toPath = BB.toLazyByteString . WH.toEncodedUrlPiece -toHeader :: WH.ToHttpApiData a => (NH.HeaderName, a) -> [NH.Header] -toHeader x = [fmap WH.toHeader x] +toHeader :: WH.ToHttpApiData a => (NH.HeaderName, a) -> [NH.Header] +toHeader x = [fmap WH.toHeader x] -toForm :: WH.ToHttpApiData v => (BC.ByteString, v) -> WH.Form -toForm (k,v) = WH.toForm [(BC.unpack k,v)] +toForm :: WH.ToHttpApiData v => (BC.ByteString, v) -> WH.Form +toForm (k,v) = WH.toForm [(BC.unpack k,v)] -toQuery :: WH.ToHttpApiData a => (BC.ByteString, Maybe a) -> [NH.QueryItem] -toQuery x = [(fmap . fmap) toQueryParam x] - where toQueryParam = T.encodeUtf8 . WH.toQueryParam +toQuery :: WH.ToHttpApiData a => (BC.ByteString, Maybe a) -> [NH.QueryItem] +toQuery x = [(fmap . fmap) toQueryParam x] + where toQueryParam = T.encodeUtf8 . WH.toQueryParam -- *** Swagger `CollectionFormat` Utils @@ -326,38 +326,38 @@ | PipeSeparated -- ^ `value1|value2|value2` | MultiParamArray -- ^ Using multiple GET parameters, e.g. `foo=bar&foo=baz`. This is valid only for parameters in "query" ('NH.Query') or "formData" ('WH.Form') -toHeaderColl :: WH.ToHttpApiData a => CollectionFormat -> (NH.HeaderName, [a]) -> [NH.Header] -toHeaderColl c xs = _toColl c toHeader xs +toHeaderColl :: WH.ToHttpApiData a => CollectionFormat -> (NH.HeaderName, [a]) -> [NH.Header] +toHeaderColl c xs = _toColl c toHeader xs -toFormColl :: WH.ToHttpApiData v => CollectionFormat -> (BC.ByteString, [v]) -> WH.Form -toFormColl c xs = WH.toForm $ fmap unpack $ _toColl c toHeader $ pack xs +toFormColl :: WH.ToHttpApiData v => CollectionFormat -> (BC.ByteString, [v]) -> WH.Form +toFormColl c xs = WH.toForm $ fmap unpack $ _toColl c toHeader $ pack xs where - pack (k,v) = (CI.mk k, v) - unpack (k,v) = (BC.unpack (CI.original k), BC.unpack v) + pack (k,v) = (CI.mk k, v) + unpack (k,v) = (BC.unpack (CI.original k), BC.unpack v) -toQueryColl :: WH.ToHttpApiData a => CollectionFormat -> (BC.ByteString, Maybe [a]) -> NH.Query -toQueryColl c xs = _toCollA c toQuery xs +toQueryColl :: WH.ToHttpApiData a => CollectionFormat -> (BC.ByteString, Maybe [a]) -> NH.Query +toQueryColl c xs = _toCollA c toQuery xs -_toColl :: P.Traversable f => CollectionFormat -> (f a -> [(b, BC.ByteString)]) -> f [a] -> [(b, BC.ByteString)] -_toColl c encode xs = fmap (fmap P.fromJust) (_toCollA' c fencode BC.singleton (fmap Just xs)) - where fencode = fmap (fmap Just) . encode . fmap P.fromJust +_toColl :: P.Traversable f => CollectionFormat -> (f a -> [(b, BC.ByteString)]) -> f [a] -> [(b, BC.ByteString)] +_toColl c encode xs = fmap (fmap P.fromJust) (_toCollA' c fencode BC.singleton (fmap Just xs)) + where fencode = fmap (fmap Just) . encode . fmap P.fromJust {-# INLINE fencode #-} -_toCollA :: (P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t BC.ByteString)]) -> f (t [a]) -> [(b, t BC.ByteString)] -_toCollA c encode xs = _toCollA' c encode BC.singleton xs +_toCollA :: (P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t BC.ByteString)]) -> f (t [a]) -> [(b, t BC.ByteString)] +_toCollA c encode xs = _toCollA' c encode BC.singleton xs -_toCollA' :: (P.Monoid c, P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)] -_toCollA' c encode one xs = case c of - CommaSeparated -> go (one ',') - SpaceSeparated -> go (one ' ') - TabSeparated -> go (one '\t') - PipeSeparated -> go (one '|') - MultiParamArray -> expandList +_toCollA' :: (P.Monoid c, P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)] +_toCollA' c encode one xs = case c of + CommaSeparated -> go (one ',') + SpaceSeparated -> go (one ' ') + TabSeparated -> go (one '\t') + PipeSeparated -> go (one '|') + MultiParamArray -> expandList where - go sep = - [P.foldl1 (\(sk, sv) (_, v) -> (sk, (combine sep <$> sv <*> v) <|> sv <|> v)) expandList] - combine sep x y = x <> sep <> y - expandList = (P.concatMap encode . (P.traverse . P.traverse) P.toList) xs + go sep = + [P.foldl1 (\(sk, sv) (_, v) -> (sk, (combine sep <$> sv <*> v) <|> sv <|> v)) expandList] + combine sep x y = x <> sep <> y + expandList = (P.concatMap encode . (P.traverse . P.traverse) P.toList) xs {-# INLINE go #-} {-# INLINE expandList #-} {-# INLINE combine #-} @@ -365,18 +365,18 @@ -- * AuthMethods -- | Provides a method to apply auth methods to requests -class P.Typeable a => - AuthMethod a where +class P.Typeable a => + AuthMethod a where applyAuthMethod :: SwaggerPetstoreConfig - -> a - -> SwaggerPetstoreRequest req contentType res accept - -> IO (SwaggerPetstoreRequest req contentType res accept) + -> a + -> SwaggerPetstoreRequest req contentType res accept + -> IO (SwaggerPetstoreRequest req contentType res accept) -- | An existential wrapper for any AuthMethod -data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable) +data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable) -instance AuthMethod AnyAuthMethod where applyAuthMethod config (AnyAuthMethod a) req = applyAuthMethod config a req +instance AuthMethod AnyAuthMethod where applyAuthMethod config (AnyAuthMethod a) req = applyAuthMethod config a req -- | indicates exceptions related to AuthMethods data AuthMethodException = AuthMethodException String deriving (P.Show, P.Typeable) @@ -385,37 +385,37 @@ -- | apply all matching AuthMethods in config to request _applyAuthMethods - :: SwaggerPetstoreRequest req contentType res accept + :: SwaggerPetstoreRequest req contentType res accept -> SwaggerPetstoreConfig - -> IO (SwaggerPetstoreRequest req contentType res accept) -_applyAuthMethods req config@(SwaggerPetstoreConfig {configAuthMethods = as}) = - foldlM go req as + -> IO (SwaggerPetstoreRequest req contentType res accept) +_applyAuthMethods req config@(SwaggerPetstoreConfig {configAuthMethods = as}) = + foldlM go req as where - go r (AnyAuthMethod a) = applyAuthMethod config a r + go r (AnyAuthMethod a) = applyAuthMethod config a r -- * Utils -- | Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON) _omitNulls :: [(Text, A.Value)] -> A.Value -_omitNulls = A.object . P.filter notNull +_omitNulls = A.object . P.filter notNull where - notNull (_, A.Null) = False + notNull (_, A.Null) = False notNull _ = True -- | Encodes fields using WH.toQueryParam -_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) -_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x +_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) +_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x -- | Collapse (Just "") to Nothing _emptyToNothing :: Maybe String -> Maybe String _emptyToNothing (Just "") = Nothing -_emptyToNothing x = x +_emptyToNothing x = x {-# INLINE _emptyToNothing #-} -- | Collapse (Just mempty) to Nothing -_memptyToNothing :: (P.Monoid a, P.Eq a) => Maybe a -> Maybe a -_memptyToNothing (Just x) | x P.== P.mempty = Nothing -_memptyToNothing x = x +_memptyToNothing :: (P.Monoid a, P.Eq a) => Maybe a -> Maybe a +_memptyToNothing (Just x) | x P.== P.mempty = Nothing +_memptyToNothing x = x {-# INLINE _memptyToNothing #-} -- * DateTime Formatting @@ -425,33 +425,33 @@ instance A.FromJSON DateTime where parseJSON = A.withText "DateTime" (_readDateTime . T.unpack) instance A.ToJSON DateTime where - toJSON (DateTime t) = A.toJSON (_showDateTime t) + toJSON (DateTime t) = A.toJSON (_showDateTime t) instance WH.FromHttpApiData DateTime where parseUrlPiece = P.left T.pack . _readDateTime . T.unpack instance WH.ToHttpApiData DateTime where - toUrlPiece (DateTime t) = T.pack (_showDateTime t) + toUrlPiece (DateTime t) = T.pack (_showDateTime t) instance P.Show DateTime where - show (DateTime t) = _showDateTime t + show (DateTime t) = _showDateTime t instance MimeRender MimeMultipartFormData DateTime where - mimeRender _ = mimeRenderDefaultMultipartFormData + mimeRender _ = mimeRenderDefaultMultipartFormData -- | @_parseISO8601@ -_readDateTime :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t +_readDateTime :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t _readDateTime = _parseISO8601 {-# INLINE _readDateTime #-} -- | @TI.formatISO8601Millis@ -_showDateTime :: (t ~ TI.UTCTime, TI.FormatTime t) => t -> String +_showDateTime :: (t ~ TI.UTCTime, TI.FormatTime t) => t -> String _showDateTime = TI.formatISO8601Millis {-# INLINE _showDateTime #-} -- | parse an ISO8601 date-time string -_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t -_parseISO8601 t = +_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t +_parseISO8601 t = P.asum $ - P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> + P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"] {-# INLINE _parseISO8601 #-} @@ -462,24 +462,24 @@ instance A.FromJSON Date where parseJSON = A.withText "Date" (_readDate . T.unpack) instance A.ToJSON Date where - toJSON (Date t) = A.toJSON (_showDate t) + toJSON (Date t) = A.toJSON (_showDate t) instance WH.FromHttpApiData Date where parseUrlPiece = P.left T.pack . _readDate . T.unpack instance WH.ToHttpApiData Date where - toUrlPiece (Date t) = T.pack (_showDate t) + toUrlPiece (Date t) = T.pack (_showDate t) instance P.Show Date where - show (Date t) = _showDate t + show (Date t) = _showDate t instance MimeRender MimeMultipartFormData Date where - mimeRender _ = mimeRenderDefaultMultipartFormData + mimeRender _ = mimeRenderDefaultMultipartFormData -- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ -_readDate :: (TI.ParseTime t, Monad m) => String -> m t +_readDate :: (TI.ParseTime t, Monad m) => String -> m t _readDate = TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d" {-# INLINE _readDate #-} -- | @TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"@ -_showDate :: TI.FormatTime t => t -> String +_showDate :: TI.FormatTime t => t -> String _showDate = TI.formatTime TI.defaultTimeLocale "%Y-%m-%d" {-# INLINE _showDate #-} @@ -502,10 +502,10 @@ instance P.Show ByteArray where show = T.unpack . _showByteArray instance MimeRender MimeMultipartFormData ByteArray where - mimeRender _ = mimeRenderDefaultMultipartFormData + mimeRender _ = mimeRenderDefaultMultipartFormData -- | read base64 encoded characters -_readByteArray :: Monad m => Text -> m ByteArray +_readByteArray :: Monad m => Text -> m ByteArray _readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8 {-# INLINE _readByteArray #-} @@ -529,9 +529,9 @@ instance P.Show Binary where show = T.unpack . _showBinaryBase64 instance MimeRender MimeMultipartFormData Binary where - mimeRender _ = unBinary + mimeRender _ = unBinary -_readBinaryBase64 :: Monad m => Text -> m Binary +_readBinaryBase64 :: Monad m => Text -> m Binary _readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8 {-# INLINE _readBinaryBase64 #-} @@ -541,6 +541,6 @@ -- * Lens Type Aliases -type Lens_' s a = Lens_ s s a a -type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t +type Lens_' s a = Lens_ s s a a +type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.MimeTypes.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.MimeTypes.html index 36c59b5ed1e..0389be7f092 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.MimeTypes.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.MimeTypes.html @@ -45,19 +45,19 @@ -- * ContentType MimeType -data ContentType a = MimeType a => ContentType { unContentType :: a } +data ContentType a = MimeType a => ContentType { unContentType :: a } -- * Accept MimeType -data Accept a = MimeType a => Accept { unAccept :: a } +data Accept a = MimeType a => Accept { unAccept :: a } -- * Consumes Class -class MimeType mtype => Consumes req mtype where +class MimeType mtype => Consumes req mtype where -- * Produces Class -class MimeType mtype => Produces req mtype where +class MimeType mtype => Produces req mtype where -- * Default Mime Types @@ -77,127 +77,153 @@ -- * MimeType Class -class P.Typeable mtype => MimeType mtype where +class P.Typeable mtype => MimeType mtype where {-# MINIMAL mimeType | mimeTypes #-} - mimeTypes :: P.Proxy mtype -> [ME.MediaType] - mimeTypes p = - case mimeType p of - Just x -> [x] + mimeTypes :: P.Proxy mtype -> [ME.MediaType] + mimeTypes p = + case mimeType p of + Just x -> [x] Nothing -> [] - mimeType :: P.Proxy mtype -> Maybe ME.MediaType - mimeType p = - case mimeTypes p of + mimeType :: P.Proxy mtype -> Maybe ME.MediaType + mimeType p = + case mimeTypes p of [] -> Nothing - (x:_) -> Just x + (x:_) -> Just x - mimeType' :: mtype -> Maybe ME.MediaType - mimeType' _ = mimeType (P.Proxy :: P.Proxy mtype) - mimeTypes' :: mtype -> [ME.MediaType] - mimeTypes' _ = mimeTypes (P.Proxy :: P.Proxy mtype) + mimeType' :: mtype -> Maybe ME.MediaType + mimeType' _ = mimeType (P.Proxy :: P.Proxy mtype) + mimeTypes' :: mtype -> [ME.MediaType] + mimeTypes' _ = mimeTypes (P.Proxy :: P.Proxy mtype) -- Default MimeType Instances -- | @application/json; charset=utf-8@ instance MimeType MimeJSON where - mimeType _ = Just $ P.fromString "application/json" + mimeType _ = Just $ P.fromString "application/json" -- | @application/xml; charset=utf-8@ instance MimeType MimeXML where - mimeType _ = Just $ P.fromString "application/xml" + mimeType _ = Just $ P.fromString "application/xml" -- | @application/x-www-form-urlencoded@ instance MimeType MimeFormUrlEncoded where - mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded" + mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded" -- | @multipart/form-data@ instance MimeType MimeMultipartFormData where - mimeType _ = Just $ P.fromString "multipart/form-data" + mimeType _ = Just $ P.fromString "multipart/form-data" -- | @text/plain; charset=utf-8@ instance MimeType MimePlainText where - mimeType _ = Just $ P.fromString "text/plain" + mimeType _ = Just $ P.fromString "text/plain" -- | @application/octet-stream@ instance MimeType MimeOctetStream where - mimeType _ = Just $ P.fromString "application/octet-stream" + mimeType _ = Just $ P.fromString "application/octet-stream" -- | @"*/*"@ instance MimeType MimeAny where - mimeType _ = Just $ P.fromString "*/*" + mimeType _ = Just $ P.fromString "*/*" instance MimeType MimeNoContent where - mimeType _ = Nothing + mimeType _ = Nothing -- * MimeRender Class -class MimeType mtype => MimeRender mtype x where - mimeRender :: P.Proxy mtype -> x -> BL.ByteString - mimeRender' :: mtype -> x -> BL.ByteString - mimeRender' _ x = mimeRender (P.Proxy :: P.Proxy mtype) x +class MimeType mtype => MimeRender mtype x where + mimeRender :: P.Proxy mtype -> x -> BL.ByteString + mimeRender' :: mtype -> x -> BL.ByteString + mimeRender' _ x = mimeRender (P.Proxy :: P.Proxy mtype) x -mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString +mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam -- Default MimeRender Instances -- | `A.encode` -instance A.ToJSON a => MimeRender MimeJSON a where mimeRender _ = A.encode +instance A.ToJSON a => MimeRender MimeJSON a where mimeRender _ = A.encode -- | @WH.urlEncodeAsForm@ -instance WH.ToForm a => MimeRender MimeFormUrlEncoded a where mimeRender _ = WH.urlEncodeAsForm +instance WH.ToForm a => MimeRender MimeFormUrlEncoded a where mimeRender _ = WH.urlEncodeAsForm -- | @P.id@ -instance MimeRender MimePlainText BL.ByteString where mimeRender _ = P.id +instance MimeRender MimePlainText BL.ByteString where mimeRender _ = P.id -- | @BL.fromStrict . T.encodeUtf8@ -instance MimeRender MimePlainText T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 +instance MimeRender MimePlainText T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 -- | @BCL.pack@ -instance MimeRender MimePlainText String where mimeRender _ = BCL.pack +instance MimeRender MimePlainText String where mimeRender _ = BCL.pack -- | @P.id@ -instance MimeRender MimeOctetStream BL.ByteString where mimeRender _ = P.id +instance MimeRender MimeOctetStream BL.ByteString where mimeRender _ = P.id -- | @BL.fromStrict . T.encodeUtf8@ -instance MimeRender MimeOctetStream T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 +instance MimeRender MimeOctetStream T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 -- | @BCL.pack@ -instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack +instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack -instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id +instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id -instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Double where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Float where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Int where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Integer where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData String where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Double where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Float where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Int where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Integer where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData String where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = mimeRenderDefaultMultipartFormData -- | @P.Right . P.const NoContent@ -instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty +instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty -- * MimeUnrender Class -class MimeType mtype => MimeUnrender mtype o where - mimeUnrender :: P.Proxy mtype -> BL.ByteString -> P.Either String o - mimeUnrender' :: mtype -> BL.ByteString -> P.Either String o - mimeUnrender' _ x = mimeUnrender (P.Proxy :: P.Proxy mtype) x +class MimeType mtype => MimeUnrender mtype o where + mimeUnrender :: P.Proxy mtype -> BL.ByteString -> P.Either String o + mimeUnrender' :: mtype -> BL.ByteString -> P.Either String o + mimeUnrender' _ x = mimeUnrender (P.Proxy :: P.Proxy mtype) x -- Default MimeUnrender Instances -- | @A.eitherDecode@ -instance A.FromJSON a => MimeUnrender MimeJSON a where mimeUnrender _ = A.eitherDecode +instance A.FromJSON a => MimeUnrender MimeJSON a where mimeUnrender _ = A.eitherDecode -- | @P.left T.unpack . WH.urlDecodeAsForm@ -instance WH.FromForm a => MimeUnrender MimeFormUrlEncoded a where mimeUnrender _ = P.left T.unpack . WH.urlDecodeAsForm +instance WH.FromForm a => MimeUnrender MimeFormUrlEncoded a where mimeUnrender _ = P.left T.unpack . WH.urlDecodeAsForm -- | @P.Right . P.id@ -instance MimeUnrender MimePlainText BL.ByteString where mimeUnrender _ = P.Right . P.id +instance MimeUnrender MimePlainText BL.ByteString where mimeUnrender _ = P.Right . P.id -- | @P.left P.show . TL.decodeUtf8'@ -instance MimeUnrender MimePlainText T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict +instance MimeUnrender MimePlainText T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict -- | @P.Right . BCL.unpack@ -instance MimeUnrender MimePlainText String where mimeUnrender _ = P.Right . BCL.unpack +instance MimeUnrender MimePlainText String where mimeUnrender _ = P.Right . BCL.unpack -- | @P.Right . P.id@ -instance MimeUnrender MimeOctetStream BL.ByteString where mimeUnrender _ = P.Right . P.id +instance MimeUnrender MimeOctetStream BL.ByteString where mimeUnrender _ = P.Right . P.id -- | @P.left P.show . T.decodeUtf8' . BL.toStrict@ -instance MimeUnrender MimeOctetStream T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict +instance MimeUnrender MimeOctetStream T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict -- | @P.Right . BCL.unpack@ -instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BCL.unpack +instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BCL.unpack -- | @P.Right . P.const NoContent@ -instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent - \ No newline at end of file +instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent + + +-- * Custom Mime Types + +-- ** MimeJsonCharsetutf8 + +data MimeJsonCharsetutf8 = MimeJsonCharsetutf8 deriving (P.Typeable) + +-- | @application/json; charset=utf-8@ +instance MimeType MimeJsonCharsetutf8 where + mimeType _ = Just $ P.fromString "application/json; charset=utf-8" +instance A.ToJSON a => MimeRender MimeJsonCharsetutf8 a where mimeRender _ = A.encode +instance A.FromJSON a => MimeUnrender MimeJsonCharsetutf8 a where mimeUnrender _ = A.eitherDecode +-- instance MimeRender MimeJsonCharsetutf8 T.Text where mimeRender _ = undefined +-- instance MimeUnrender MimeJsonCharsetutf8 T.Text where mimeUnrender _ = undefined + +-- ** MimeXmlCharsetutf8 + +data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable) + +-- | @application/xml; charset=utf-8@ +instance MimeType MimeXmlCharsetutf8 where + mimeType _ = Just $ P.fromString "application/xml; charset=utf-8" +-- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined +-- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined + + \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Model.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Model.html index 36715562467..74ae7df0c7d 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Model.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.Model.html @@ -37,1562 +37,1735 @@ import qualified Control.Arrow as P (left) import qualified Data.Aeson as A import qualified Data.ByteString as B -import qualified Data.ByteString.Lazy as BL -import qualified Data.Data as P (Data, Typeable) -import qualified Data.Foldable as P -import qualified Data.HashMap.Lazy as HM -import qualified Data.Map as Map -import qualified Data.Maybe as P -import qualified Data.Set as Set -import qualified Data.Text as T -import qualified Data.Text.Encoding as T -import qualified Data.Time as TI -import qualified Web.FormUrlEncoded as WH -import qualified Web.HttpApiData as WH - -import Control.Applicative ((<|>)) -import Control.Applicative (Alternative) -import Data.Text (Text) -import Prelude (($), (.),(<$>),(<*>),(>>=),(=<<),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) - -import qualified Prelude as P - - - --- * Models - +import qualified Data.ByteString.Base64 as B64 +import qualified Data.ByteString.Char8 as BC +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.HashMap.Lazy as HM +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Set as Set +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Time as TI +import qualified Lens.Micro as L +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Control.Applicative ((<|>)) +import Control.Applicative (Alternative) +import Data.Function ((&)) +import Data.Monoid ((<>)) +import Data.Text (Text) +import Prelude (($),(/=),(.),(<$>),(<*>),(>>=),(=<<),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) + +import qualified Prelude as P --- ** AdditionalPropertiesClass --- | AdditionalPropertiesClass -data AdditionalPropertiesClass = AdditionalPropertiesClass - { additionalPropertiesClassMapProperty :: !(Maybe (Map.Map String Text)) -- ^ "map_property" - , additionalPropertiesClassMapOfMapProperty :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_of_map_property" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AdditionalPropertiesClass -instance A.FromJSON AdditionalPropertiesClass where - parseJSON = A.withObject "AdditionalPropertiesClass" $ \o -> - AdditionalPropertiesClass - <$> (o .:? "map_property") - <*> (o .:? "map_of_map_property") + + +-- * Parameter newtypes + + +-- ** AdditionalMetadata +newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } deriving (P.Eq, P.Show) + +-- ** ApiKey +newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show) + +-- ** Body +newtype Body = Body { unBody :: [User] } deriving (P.Eq, P.Show, A.ToJSON) --- | ToJSON AdditionalPropertiesClass -instance A.ToJSON AdditionalPropertiesClass where - toJSON AdditionalPropertiesClass {..} = - _omitNulls - [ "map_property" .= additionalPropertiesClassMapProperty - , "map_of_map_property" .= additionalPropertiesClassMapOfMapProperty - ] - +-- ** Byte +newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show) + +-- ** Callback +newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show) + +-- ** EnumFormString +newtype EnumFormString = EnumFormString { unEnumFormString :: E'EnumFormString } deriving (P.Eq, P.Show) --- | Construct a value of type 'AdditionalPropertiesClass' (by applying it's required fields, if any) -mkAdditionalPropertiesClass - :: AdditionalPropertiesClass -mkAdditionalPropertiesClass = - AdditionalPropertiesClass - { additionalPropertiesClassMapProperty = Nothing - , additionalPropertiesClassMapOfMapProperty = Nothing - } +-- ** EnumFormStringArray +newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [E'Inner2] } deriving (P.Eq, P.Show) + +-- ** EnumHeaderString +newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: E'EnumFormString } deriving (P.Eq, P.Show) + +-- ** EnumHeaderStringArray +newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [E'Inner2] } deriving (P.Eq, P.Show) --- ** Animal --- | Animal -data Animal = Animal - { animalClassName :: !(Text) -- ^ /Required/ "className" - , animalColor :: !(Maybe Text) -- ^ "color" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Animal -instance A.FromJSON Animal where - parseJSON = A.withObject "Animal" $ \o -> - Animal - <$> (o .: "className") - <*> (o .:? "color") - --- | ToJSON Animal -instance A.ToJSON Animal where - toJSON Animal {..} = - _omitNulls - [ "className" .= animalClassName - , "color" .= animalColor - ] - - --- | Construct a value of type 'Animal' (by applying it's required fields, if any) -mkAnimal - :: Text -- ^ 'animalClassName' - -> Animal -mkAnimal animalClassName = - Animal - { animalClassName - , animalColor = Nothing - } +-- ** EnumQueryDouble +newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: E'EnumNumber } deriving (P.Eq, P.Show) + +-- ** EnumQueryInteger +newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: E'EnumQueryInteger } deriving (P.Eq, P.Show) + +-- ** EnumQueryString +newtype EnumQueryString = EnumQueryString { unEnumQueryString :: E'EnumFormString } deriving (P.Eq, P.Show) + +-- ** EnumQueryStringArray +newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [E'Inner2] } deriving (P.Eq, P.Show) + +-- ** File +newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show) + +-- ** Int32 +newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show) + +-- ** Int64 +newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show) + +-- ** Name2 +newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show) + +-- ** Number +newtype Number = Number { unNumber :: Double } deriving (P.Eq, P.Show) + +-- ** OrderId +newtype OrderId = OrderId { unOrderId :: Integer } deriving (P.Eq, P.Show) + +-- ** OrderIdText +newtype OrderIdText = OrderIdText { unOrderIdText :: Text } deriving (P.Eq, P.Show) --- ** AnimalFarm --- | AnimalFarm -data AnimalFarm = AnimalFarm - { - } deriving (P.Show, P.Eq, P.Typeable) +-- ** Param +newtype Param = Param { unParam :: Text } deriving (P.Eq, P.Show) + +-- ** Param2 +newtype Param2 = Param2 { unParam2 :: Text } deriving (P.Eq, P.Show) --- | FromJSON AnimalFarm -instance A.FromJSON AnimalFarm where - parseJSON = A.withObject "AnimalFarm" $ \o -> - pure AnimalFarm - +-- ** ParamBinary +newtype ParamBinary = ParamBinary { unParamBinary :: Binary } deriving (P.Eq, P.Show) + +-- ** ParamDate +newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show) --- | ToJSON AnimalFarm -instance A.ToJSON AnimalFarm where - toJSON AnimalFarm = - _omitNulls - [ - ] - - --- | Construct a value of type 'AnimalFarm' (by applying it's required fields, if any) -mkAnimalFarm - :: AnimalFarm -mkAnimalFarm = - AnimalFarm - { - } - --- ** ApiResponse --- | ApiResponse -data ApiResponse = ApiResponse - { apiResponseCode :: !(Maybe Int) -- ^ "code" - , apiResponseType :: !(Maybe Text) -- ^ "type" - , apiResponseMessage :: !(Maybe Text) -- ^ "message" - } deriving (P.Show, P.Eq, P.Typeable) +-- ** ParamDateTime +newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show) + +-- ** ParamDouble +newtype ParamDouble = ParamDouble { unParamDouble :: Double } deriving (P.Eq, P.Show) + +-- ** ParamFloat +newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show) + +-- ** ParamInteger +newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show) + +-- ** ParamString +newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show) + +-- ** Password +newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show) + +-- ** PatternWithoutDelimiter +newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDelimiter :: Text } deriving (P.Eq, P.Show) + +-- ** PetId +newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show) --- | FromJSON ApiResponse -instance A.FromJSON ApiResponse where - parseJSON = A.withObject "ApiResponse" $ \o -> - ApiResponse - <$> (o .:? "code") - <*> (o .:? "type") - <*> (o .:? "message") - --- | ToJSON ApiResponse -instance A.ToJSON ApiResponse where - toJSON ApiResponse {..} = - _omitNulls - [ "code" .= apiResponseCode - , "type" .= apiResponseType - , "message" .= apiResponseMessage - ] - - --- | Construct a value of type 'ApiResponse' (by applying it's required fields, if any) -mkApiResponse - :: ApiResponse -mkApiResponse = - ApiResponse - { apiResponseCode = Nothing - , apiResponseType = Nothing - , apiResponseMessage = Nothing - } - --- ** ArrayOfArrayOfNumberOnly --- | ArrayOfArrayOfNumberOnly -data ArrayOfArrayOfNumberOnly = ArrayOfArrayOfNumberOnly - { arrayOfArrayOfNumberOnlyArrayArrayNumber :: !(Maybe [[Double]]) -- ^ "ArrayArrayNumber" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ArrayOfArrayOfNumberOnly -instance A.FromJSON ArrayOfArrayOfNumberOnly where - parseJSON = A.withObject "ArrayOfArrayOfNumberOnly" $ \o -> - ArrayOfArrayOfNumberOnly - <$> (o .:? "ArrayArrayNumber") - --- | ToJSON ArrayOfArrayOfNumberOnly -instance A.ToJSON ArrayOfArrayOfNumberOnly where - toJSON ArrayOfArrayOfNumberOnly {..} = - _omitNulls - [ "ArrayArrayNumber" .= arrayOfArrayOfNumberOnlyArrayArrayNumber - ] +-- ** Status +newtype Status = Status { unStatus :: [E'Status2] } deriving (P.Eq, P.Show) + +-- ** StatusText +newtype StatusText = StatusText { unStatusText :: Text } deriving (P.Eq, P.Show) + +-- ** Tags +newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show) + +-- ** Username +newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show) + +-- * Models + + +-- ** AdditionalPropertiesClass +-- | AdditionalPropertiesClass +data AdditionalPropertiesClass = AdditionalPropertiesClass + { additionalPropertiesClassMapProperty :: !(Maybe (Map.Map String Text)) -- ^ "map_property" + , additionalPropertiesClassMapOfMapProperty :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_of_map_property" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON AdditionalPropertiesClass +instance A.FromJSON AdditionalPropertiesClass where + parseJSON = A.withObject "AdditionalPropertiesClass" $ \o -> + AdditionalPropertiesClass + <$> (o .:? "map_property") + <*> (o .:? "map_of_map_property") + +-- | ToJSON AdditionalPropertiesClass +instance A.ToJSON AdditionalPropertiesClass where + toJSON AdditionalPropertiesClass {..} = + _omitNulls + [ "map_property" .= additionalPropertiesClassMapProperty + , "map_of_map_property" .= additionalPropertiesClassMapOfMapProperty + ] + + +-- | Construct a value of type 'AdditionalPropertiesClass' (by applying it's required fields, if any) +mkAdditionalPropertiesClass + :: AdditionalPropertiesClass +mkAdditionalPropertiesClass = + AdditionalPropertiesClass + { additionalPropertiesClassMapProperty = Nothing + , additionalPropertiesClassMapOfMapProperty = Nothing + } - --- | Construct a value of type 'ArrayOfArrayOfNumberOnly' (by applying it's required fields, if any) -mkArrayOfArrayOfNumberOnly - :: ArrayOfArrayOfNumberOnly -mkArrayOfArrayOfNumberOnly = - ArrayOfArrayOfNumberOnly - { arrayOfArrayOfNumberOnlyArrayArrayNumber = Nothing - } - --- ** ArrayOfNumberOnly --- | ArrayOfNumberOnly -data ArrayOfNumberOnly = ArrayOfNumberOnly - { arrayOfNumberOnlyArrayNumber :: !(Maybe [Double]) -- ^ "ArrayNumber" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ArrayOfNumberOnly -instance A.FromJSON ArrayOfNumberOnly where - parseJSON = A.withObject "ArrayOfNumberOnly" $ \o -> - ArrayOfNumberOnly - <$> (o .:? "ArrayNumber") - --- | ToJSON ArrayOfNumberOnly -instance A.ToJSON ArrayOfNumberOnly where - toJSON ArrayOfNumberOnly {..} = - _omitNulls - [ "ArrayNumber" .= arrayOfNumberOnlyArrayNumber - ] - - --- | Construct a value of type 'ArrayOfNumberOnly' (by applying it's required fields, if any) -mkArrayOfNumberOnly - :: ArrayOfNumberOnly -mkArrayOfNumberOnly = - ArrayOfNumberOnly - { arrayOfNumberOnlyArrayNumber = Nothing - } - --- ** ArrayTest --- | ArrayTest -data ArrayTest = ArrayTest - { arrayTestArrayOfString :: !(Maybe [Text]) -- ^ "array_of_string" - , arrayTestArrayArrayOfInteger :: !(Maybe [[Integer]]) -- ^ "array_array_of_integer" - , arrayTestArrayArrayOfModel :: !(Maybe [[ReadOnlyFirst]]) -- ^ "array_array_of_model" - } deriving (P.Show, P.Eq, P.Typeable) +-- ** Animal +-- | Animal +data Animal = Animal + { animalClassName :: !(Text) -- ^ /Required/ "className" + , animalColor :: !(Maybe Text) -- ^ "color" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Animal +instance A.FromJSON Animal where + parseJSON = A.withObject "Animal" $ \o -> + Animal + <$> (o .: "className") + <*> (o .:? "color") + +-- | ToJSON Animal +instance A.ToJSON Animal where + toJSON Animal {..} = + _omitNulls + [ "className" .= animalClassName + , "color" .= animalColor + ] + + +-- | Construct a value of type 'Animal' (by applying it's required fields, if any) +mkAnimal + :: Text -- ^ 'animalClassName' + -> Animal +mkAnimal animalClassName = + Animal + { animalClassName + , animalColor = Nothing + } + +-- ** AnimalFarm +-- | AnimalFarm +data AnimalFarm = AnimalFarm + { + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON AnimalFarm +instance A.FromJSON AnimalFarm where + parseJSON = A.withObject "AnimalFarm" $ \o -> + pure AnimalFarm + --- | FromJSON ArrayTest -instance A.FromJSON ArrayTest where - parseJSON = A.withObject "ArrayTest" $ \o -> - ArrayTest - <$> (o .:? "array_of_string") - <*> (o .:? "array_array_of_integer") - <*> (o .:? "array_array_of_model") +-- | ToJSON AnimalFarm +instance A.ToJSON AnimalFarm where + toJSON AnimalFarm = + _omitNulls + [ + ] + --- | ToJSON ArrayTest -instance A.ToJSON ArrayTest where - toJSON ArrayTest {..} = - _omitNulls - [ "array_of_string" .= arrayTestArrayOfString - , "array_array_of_integer" .= arrayTestArrayArrayOfInteger - , "array_array_of_model" .= arrayTestArrayArrayOfModel - ] - - --- | Construct a value of type 'ArrayTest' (by applying it's required fields, if any) -mkArrayTest - :: ArrayTest -mkArrayTest = - ArrayTest - { arrayTestArrayOfString = Nothing - , arrayTestArrayArrayOfInteger = Nothing - , arrayTestArrayArrayOfModel = Nothing - } - --- ** Capitalization --- | Capitalization -data Capitalization = Capitalization - { capitalizationSmallCamel :: !(Maybe Text) -- ^ "smallCamel" - , capitalizationCapitalCamel :: !(Maybe Text) -- ^ "CapitalCamel" - , capitalizationSmallSnake :: !(Maybe Text) -- ^ "small_Snake" - , capitalizationCapitalSnake :: !(Maybe Text) -- ^ "Capital_Snake" - , capitalizationScaEthFlowPoints :: !(Maybe Text) -- ^ "SCA_ETH_Flow_Points" - , capitalizationAttName :: !(Maybe Text) -- ^ "ATT_NAME" - Name of the pet - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Capitalization -instance A.FromJSON Capitalization where - parseJSON = A.withObject "Capitalization" $ \o -> - Capitalization - <$> (o .:? "smallCamel") - <*> (o .:? "CapitalCamel") - <*> (o .:? "small_Snake") - <*> (o .:? "Capital_Snake") - <*> (o .:? "SCA_ETH_Flow_Points") - <*> (o .:? "ATT_NAME") - --- | ToJSON Capitalization -instance A.ToJSON Capitalization where - toJSON Capitalization {..} = - _omitNulls - [ "smallCamel" .= capitalizationSmallCamel - , "CapitalCamel" .= capitalizationCapitalCamel - , "small_Snake" .= capitalizationSmallSnake - , "Capital_Snake" .= capitalizationCapitalSnake - , "SCA_ETH_Flow_Points" .= capitalizationScaEthFlowPoints - , "ATT_NAME" .= capitalizationAttName - ] - - --- | Construct a value of type 'Capitalization' (by applying it's required fields, if any) -mkCapitalization - :: Capitalization -mkCapitalization = - Capitalization - { capitalizationSmallCamel = Nothing - , capitalizationCapitalCamel = Nothing - , capitalizationSmallSnake = Nothing - , capitalizationCapitalSnake = Nothing - , capitalizationScaEthFlowPoints = Nothing - , capitalizationAttName = Nothing - } - --- ** Category --- | Category -data Category = Category - { categoryId :: !(Maybe Integer) -- ^ "id" - , categoryName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Category -instance A.FromJSON Category where - parseJSON = A.withObject "Category" $ \o -> - Category - <$> (o .:? "id") - <*> (o .:? "name") - --- | ToJSON Category -instance A.ToJSON Category where - toJSON Category {..} = - _omitNulls - [ "id" .= categoryId - , "name" .= categoryName - ] - +-- | Construct a value of type 'AnimalFarm' (by applying it's required fields, if any) +mkAnimalFarm + :: AnimalFarm +mkAnimalFarm = + AnimalFarm + { + } + +-- ** ApiResponse +-- | ApiResponse +data ApiResponse = ApiResponse + { apiResponseCode :: !(Maybe Int) -- ^ "code" + , apiResponseType :: !(Maybe Text) -- ^ "type" + , apiResponseMessage :: !(Maybe Text) -- ^ "message" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ApiResponse +instance A.FromJSON ApiResponse where + parseJSON = A.withObject "ApiResponse" $ \o -> + ApiResponse + <$> (o .:? "code") + <*> (o .:? "type") + <*> (o .:? "message") + +-- | ToJSON ApiResponse +instance A.ToJSON ApiResponse where + toJSON ApiResponse {..} = + _omitNulls + [ "code" .= apiResponseCode + , "type" .= apiResponseType + , "message" .= apiResponseMessage + ] + + +-- | Construct a value of type 'ApiResponse' (by applying it's required fields, if any) +mkApiResponse + :: ApiResponse +mkApiResponse = + ApiResponse + { apiResponseCode = Nothing + , apiResponseType = Nothing + , apiResponseMessage = Nothing + } + +-- ** ArrayOfArrayOfNumberOnly +-- | ArrayOfArrayOfNumberOnly +data ArrayOfArrayOfNumberOnly = ArrayOfArrayOfNumberOnly + { arrayOfArrayOfNumberOnlyArrayArrayNumber :: !(Maybe [[Double]]) -- ^ "ArrayArrayNumber" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ArrayOfArrayOfNumberOnly +instance A.FromJSON ArrayOfArrayOfNumberOnly where + parseJSON = A.withObject "ArrayOfArrayOfNumberOnly" $ \o -> + ArrayOfArrayOfNumberOnly + <$> (o .:? "ArrayArrayNumber") + +-- | ToJSON ArrayOfArrayOfNumberOnly +instance A.ToJSON ArrayOfArrayOfNumberOnly where + toJSON ArrayOfArrayOfNumberOnly {..} = + _omitNulls + [ "ArrayArrayNumber" .= arrayOfArrayOfNumberOnlyArrayArrayNumber + ] + + +-- | Construct a value of type 'ArrayOfArrayOfNumberOnly' (by applying it's required fields, if any) +mkArrayOfArrayOfNumberOnly + :: ArrayOfArrayOfNumberOnly +mkArrayOfArrayOfNumberOnly = + ArrayOfArrayOfNumberOnly + { arrayOfArrayOfNumberOnlyArrayArrayNumber = Nothing + } + +-- ** ArrayOfNumberOnly +-- | ArrayOfNumberOnly +data ArrayOfNumberOnly = ArrayOfNumberOnly + { arrayOfNumberOnlyArrayNumber :: !(Maybe [Double]) -- ^ "ArrayNumber" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ArrayOfNumberOnly +instance A.FromJSON ArrayOfNumberOnly where + parseJSON = A.withObject "ArrayOfNumberOnly" $ \o -> + ArrayOfNumberOnly + <$> (o .:? "ArrayNumber") + +-- | ToJSON ArrayOfNumberOnly +instance A.ToJSON ArrayOfNumberOnly where + toJSON ArrayOfNumberOnly {..} = + _omitNulls + [ "ArrayNumber" .= arrayOfNumberOnlyArrayNumber + ] --- | Construct a value of type 'Category' (by applying it's required fields, if any) -mkCategory - :: Category -mkCategory = - Category - { categoryId = Nothing - , categoryName = Nothing + +-- | Construct a value of type 'ArrayOfNumberOnly' (by applying it's required fields, if any) +mkArrayOfNumberOnly + :: ArrayOfNumberOnly +mkArrayOfNumberOnly = + ArrayOfNumberOnly + { arrayOfNumberOnlyArrayNumber = Nothing } --- ** ClassModel --- | ClassModel --- Model for testing model with \"_class\" property -data ClassModel = ClassModel - { classModelClass :: !(Maybe Text) -- ^ "_class" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ClassModel -instance A.FromJSON ClassModel where - parseJSON = A.withObject "ClassModel" $ \o -> - ClassModel - <$> (o .:? "_class") - --- | ToJSON ClassModel -instance A.ToJSON ClassModel where - toJSON ClassModel {..} = - _omitNulls - [ "_class" .= classModelClass - ] - - --- | Construct a value of type 'ClassModel' (by applying it's required fields, if any) -mkClassModel - :: ClassModel -mkClassModel = - ClassModel - { classModelClass = Nothing - } - --- ** Client --- | Client -data Client = Client - { clientClient :: !(Maybe Text) -- ^ "client" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Client -instance A.FromJSON Client where - parseJSON = A.withObject "Client" $ \o -> - Client - <$> (o .:? "client") - --- | ToJSON Client -instance A.ToJSON Client where - toJSON Client {..} = - _omitNulls - [ "client" .= clientClient - ] - - --- | Construct a value of type 'Client' (by applying it's required fields, if any) -mkClient - :: Client -mkClient = - Client - { clientClient = Nothing - } - --- ** EnumArrays --- | EnumArrays -data EnumArrays = EnumArrays - { enumArraysJustSymbol :: !(Maybe E'JustSymbol) -- ^ "just_symbol" - , enumArraysArrayEnum :: !(Maybe [E'ArrayEnum]) -- ^ "array_enum" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON EnumArrays -instance A.FromJSON EnumArrays where - parseJSON = A.withObject "EnumArrays" $ \o -> - EnumArrays - <$> (o .:? "just_symbol") - <*> (o .:? "array_enum") +-- ** ArrayTest +-- | ArrayTest +data ArrayTest = ArrayTest + { arrayTestArrayOfString :: !(Maybe [Text]) -- ^ "array_of_string" + , arrayTestArrayArrayOfInteger :: !(Maybe [[Integer]]) -- ^ "array_array_of_integer" + , arrayTestArrayArrayOfModel :: !(Maybe [[ReadOnlyFirst]]) -- ^ "array_array_of_model" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ArrayTest +instance A.FromJSON ArrayTest where + parseJSON = A.withObject "ArrayTest" $ \o -> + ArrayTest + <$> (o .:? "array_of_string") + <*> (o .:? "array_array_of_integer") + <*> (o .:? "array_array_of_model") + +-- | ToJSON ArrayTest +instance A.ToJSON ArrayTest where + toJSON ArrayTest {..} = + _omitNulls + [ "array_of_string" .= arrayTestArrayOfString + , "array_array_of_integer" .= arrayTestArrayArrayOfInteger + , "array_array_of_model" .= arrayTestArrayArrayOfModel + ] + + +-- | Construct a value of type 'ArrayTest' (by applying it's required fields, if any) +mkArrayTest + :: ArrayTest +mkArrayTest = + ArrayTest + { arrayTestArrayOfString = Nothing + , arrayTestArrayArrayOfInteger = Nothing + , arrayTestArrayArrayOfModel = Nothing + } + +-- ** Capitalization +-- | Capitalization +data Capitalization = Capitalization + { capitalizationSmallCamel :: !(Maybe Text) -- ^ "smallCamel" + , capitalizationCapitalCamel :: !(Maybe Text) -- ^ "CapitalCamel" + , capitalizationSmallSnake :: !(Maybe Text) -- ^ "small_Snake" + , capitalizationCapitalSnake :: !(Maybe Text) -- ^ "Capital_Snake" + , capitalizationScaEthFlowPoints :: !(Maybe Text) -- ^ "SCA_ETH_Flow_Points" + , capitalizationAttName :: !(Maybe Text) -- ^ "ATT_NAME" - Name of the pet + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Capitalization +instance A.FromJSON Capitalization where + parseJSON = A.withObject "Capitalization" $ \o -> + Capitalization + <$> (o .:? "smallCamel") + <*> (o .:? "CapitalCamel") + <*> (o .:? "small_Snake") + <*> (o .:? "Capital_Snake") + <*> (o .:? "SCA_ETH_Flow_Points") + <*> (o .:? "ATT_NAME") + +-- | ToJSON Capitalization +instance A.ToJSON Capitalization where + toJSON Capitalization {..} = + _omitNulls + [ "smallCamel" .= capitalizationSmallCamel + , "CapitalCamel" .= capitalizationCapitalCamel + , "small_Snake" .= capitalizationSmallSnake + , "Capital_Snake" .= capitalizationCapitalSnake + , "SCA_ETH_Flow_Points" .= capitalizationScaEthFlowPoints + , "ATT_NAME" .= capitalizationAttName + ] + --- | ToJSON EnumArrays -instance A.ToJSON EnumArrays where - toJSON EnumArrays {..} = - _omitNulls - [ "just_symbol" .= enumArraysJustSymbol - , "array_enum" .= enumArraysArrayEnum - ] - - --- | Construct a value of type 'EnumArrays' (by applying it's required fields, if any) -mkEnumArrays - :: EnumArrays -mkEnumArrays = - EnumArrays - { enumArraysJustSymbol = Nothing - , enumArraysArrayEnum = Nothing - } - --- ** EnumTest --- | EnumTest -data EnumTest = EnumTest - { enumTestEnumString :: !(Maybe E'EnumString) -- ^ "enum_string" - , enumTestEnumInteger :: !(Maybe E'EnumInteger) -- ^ "enum_integer" - , enumTestEnumNumber :: !(Maybe E'EnumNumber) -- ^ "enum_number" - , enumTestOuterEnum :: !(Maybe OuterEnum) -- ^ "outerEnum" - } deriving (P.Show, P.Eq, P.Typeable) +-- | Construct a value of type 'Capitalization' (by applying it's required fields, if any) +mkCapitalization + :: Capitalization +mkCapitalization = + Capitalization + { capitalizationSmallCamel = Nothing + , capitalizationCapitalCamel = Nothing + , capitalizationSmallSnake = Nothing + , capitalizationCapitalSnake = Nothing + , capitalizationScaEthFlowPoints = Nothing + , capitalizationAttName = Nothing + } + +-- ** Category +-- | Category +data Category = Category + { categoryId :: !(Maybe Integer) -- ^ "id" + , categoryName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Category +instance A.FromJSON Category where + parseJSON = A.withObject "Category" $ \o -> + Category + <$> (o .:? "id") + <*> (o .:? "name") --- | FromJSON EnumTest -instance A.FromJSON EnumTest where - parseJSON = A.withObject "EnumTest" $ \o -> - EnumTest - <$> (o .:? "enum_string") - <*> (o .:? "enum_integer") - <*> (o .:? "enum_number") - <*> (o .:? "outerEnum") +-- | ToJSON Category +instance A.ToJSON Category where + toJSON Category {..} = + _omitNulls + [ "id" .= categoryId + , "name" .= categoryName + ] + --- | ToJSON EnumTest -instance A.ToJSON EnumTest where - toJSON EnumTest {..} = - _omitNulls - [ "enum_string" .= enumTestEnumString - , "enum_integer" .= enumTestEnumInteger - , "enum_number" .= enumTestEnumNumber - , "outerEnum" .= enumTestOuterEnum - ] - - --- | Construct a value of type 'EnumTest' (by applying it's required fields, if any) -mkEnumTest - :: EnumTest -mkEnumTest = - EnumTest - { enumTestEnumString = Nothing - , enumTestEnumInteger = Nothing - , enumTestEnumNumber = Nothing - , enumTestOuterEnum = Nothing - } +-- | Construct a value of type 'Category' (by applying it's required fields, if any) +mkCategory + :: Category +mkCategory = + Category + { categoryId = Nothing + , categoryName = Nothing + } + +-- ** ClassModel +-- | ClassModel +-- Model for testing model with \"_class\" property +data ClassModel = ClassModel + { classModelClass :: !(Maybe Text) -- ^ "_class" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ClassModel +instance A.FromJSON ClassModel where + parseJSON = A.withObject "ClassModel" $ \o -> + ClassModel + <$> (o .:? "_class") --- ** FormatTest --- | FormatTest -data FormatTest = FormatTest - { formatTestInteger :: !(Maybe Int) -- ^ "integer" - , formatTestInt32 :: !(Maybe Int) -- ^ "int32" - , formatTestInt64 :: !(Maybe Integer) -- ^ "int64" - , formatTestNumber :: !(Double) -- ^ /Required/ "number" - , formatTestFloat :: !(Maybe Float) -- ^ "float" - , formatTestDouble :: !(Maybe Double) -- ^ "double" - , formatTestString :: !(Maybe Text) -- ^ "string" - , formatTestByte :: !(ByteArray) -- ^ /Required/ "byte" - , formatTestBinary :: !(Maybe Binary) -- ^ "binary" - , formatTestDate :: !(Date) -- ^ /Required/ "date" - , formatTestDateTime :: !(Maybe DateTime) -- ^ "dateTime" - , formatTestUuid :: !(Maybe Text) -- ^ "uuid" - , formatTestPassword :: !(Text) -- ^ /Required/ "password" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON FormatTest -instance A.FromJSON FormatTest where - parseJSON = A.withObject "FormatTest" $ \o -> - FormatTest - <$> (o .:? "integer") - <*> (o .:? "int32") - <*> (o .:? "int64") - <*> (o .: "number") - <*> (o .:? "float") - <*> (o .:? "double") - <*> (o .:? "string") - <*> (o .: "byte") - <*> (o .:? "binary") - <*> (o .: "date") - <*> (o .:? "dateTime") - <*> (o .:? "uuid") - <*> (o .: "password") +-- | ToJSON ClassModel +instance A.ToJSON ClassModel where + toJSON ClassModel {..} = + _omitNulls + [ "_class" .= classModelClass + ] + + +-- | Construct a value of type 'ClassModel' (by applying it's required fields, if any) +mkClassModel + :: ClassModel +mkClassModel = + ClassModel + { classModelClass = Nothing + } + +-- ** Client +-- | Client +data Client = Client + { clientClient :: !(Maybe Text) -- ^ "client" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Client +instance A.FromJSON Client where + parseJSON = A.withObject "Client" $ \o -> + Client + <$> (o .:? "client") + +-- | ToJSON Client +instance A.ToJSON Client where + toJSON Client {..} = + _omitNulls + [ "client" .= clientClient + ] + --- | ToJSON FormatTest -instance A.ToJSON FormatTest where - toJSON FormatTest {..} = - _omitNulls - [ "integer" .= formatTestInteger - , "int32" .= formatTestInt32 - , "int64" .= formatTestInt64 - , "number" .= formatTestNumber - , "float" .= formatTestFloat - , "double" .= formatTestDouble - , "string" .= formatTestString - , "byte" .= formatTestByte - , "binary" .= formatTestBinary - , "date" .= formatTestDate - , "dateTime" .= formatTestDateTime - , "uuid" .= formatTestUuid - , "password" .= formatTestPassword - ] - - --- | Construct a value of type 'FormatTest' (by applying it's required fields, if any) -mkFormatTest - :: Double -- ^ 'formatTestNumber' - -> ByteArray -- ^ 'formatTestByte' - -> Date -- ^ 'formatTestDate' - -> Text -- ^ 'formatTestPassword' - -> FormatTest -mkFormatTest formatTestNumber formatTestByte formatTestDate formatTestPassword = - FormatTest - { formatTestInteger = Nothing - , formatTestInt32 = Nothing - , formatTestInt64 = Nothing - , formatTestNumber - , formatTestFloat = Nothing - , formatTestDouble = Nothing - , formatTestString = Nothing - , formatTestByte - , formatTestBinary = Nothing - , formatTestDate - , formatTestDateTime = Nothing - , formatTestUuid = Nothing - , formatTestPassword - } - --- ** HasOnlyReadOnly --- | HasOnlyReadOnly -data HasOnlyReadOnly = HasOnlyReadOnly - { hasOnlyReadOnlyBar :: !(Maybe Text) -- ^ "bar" - , hasOnlyReadOnlyFoo :: !(Maybe Text) -- ^ "foo" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON HasOnlyReadOnly -instance A.FromJSON HasOnlyReadOnly where - parseJSON = A.withObject "HasOnlyReadOnly" $ \o -> - HasOnlyReadOnly - <$> (o .:? "bar") - <*> (o .:? "foo") +-- | Construct a value of type 'Client' (by applying it's required fields, if any) +mkClient + :: Client +mkClient = + Client + { clientClient = Nothing + } + +-- ** EnumArrays +-- | EnumArrays +data EnumArrays = EnumArrays + { enumArraysJustSymbol :: !(Maybe E'JustSymbol) -- ^ "just_symbol" + , enumArraysArrayEnum :: !(Maybe [E'ArrayEnum]) -- ^ "array_enum" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON EnumArrays +instance A.FromJSON EnumArrays where + parseJSON = A.withObject "EnumArrays" $ \o -> + EnumArrays + <$> (o .:? "just_symbol") + <*> (o .:? "array_enum") + +-- | ToJSON EnumArrays +instance A.ToJSON EnumArrays where + toJSON EnumArrays {..} = + _omitNulls + [ "just_symbol" .= enumArraysJustSymbol + , "array_enum" .= enumArraysArrayEnum + ] + + +-- | Construct a value of type 'EnumArrays' (by applying it's required fields, if any) +mkEnumArrays + :: EnumArrays +mkEnumArrays = + EnumArrays + { enumArraysJustSymbol = Nothing + , enumArraysArrayEnum = Nothing + } + +-- ** EnumTest +-- | EnumTest +data EnumTest = EnumTest + { enumTestEnumString :: !(Maybe E'EnumString) -- ^ "enum_string" + , enumTestEnumInteger :: !(Maybe E'EnumInteger) -- ^ "enum_integer" + , enumTestEnumNumber :: !(Maybe E'EnumNumber) -- ^ "enum_number" + , enumTestOuterEnum :: !(Maybe OuterEnum) -- ^ "outerEnum" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON EnumTest +instance A.FromJSON EnumTest where + parseJSON = A.withObject "EnumTest" $ \o -> + EnumTest + <$> (o .:? "enum_string") + <*> (o .:? "enum_integer") + <*> (o .:? "enum_number") + <*> (o .:? "outerEnum") --- | ToJSON HasOnlyReadOnly -instance A.ToJSON HasOnlyReadOnly where - toJSON HasOnlyReadOnly {..} = +-- | ToJSON EnumTest +instance A.ToJSON EnumTest where + toJSON EnumTest {..} = _omitNulls - [ "bar" .= hasOnlyReadOnlyBar - , "foo" .= hasOnlyReadOnlyFoo - ] - - --- | Construct a value of type 'HasOnlyReadOnly' (by applying it's required fields, if any) -mkHasOnlyReadOnly - :: HasOnlyReadOnly -mkHasOnlyReadOnly = - HasOnlyReadOnly - { hasOnlyReadOnlyBar = Nothing - , hasOnlyReadOnlyFoo = Nothing - } - --- ** MapTest --- | MapTest -data MapTest = MapTest - { mapTestMapMapOfString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_of_string" - , mapTestMapOfEnumString :: !(Maybe (Map.Map String E'Inner)) -- ^ "map_of_enum_string" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON MapTest -instance A.FromJSON MapTest where - parseJSON = A.withObject "MapTest" $ \o -> - MapTest - <$> (o .:? "map_map_of_string") - <*> (o .:? "map_of_enum_string") - --- | ToJSON MapTest -instance A.ToJSON MapTest where - toJSON MapTest {..} = - _omitNulls - [ "map_map_of_string" .= mapTestMapMapOfString - , "map_of_enum_string" .= mapTestMapOfEnumString - ] + [ "enum_string" .= enumTestEnumString + , "enum_integer" .= enumTestEnumInteger + , "enum_number" .= enumTestEnumNumber + , "outerEnum" .= enumTestOuterEnum + ] + + +-- | Construct a value of type 'EnumTest' (by applying it's required fields, if any) +mkEnumTest + :: EnumTest +mkEnumTest = + EnumTest + { enumTestEnumString = Nothing + , enumTestEnumInteger = Nothing + , enumTestEnumNumber = Nothing + , enumTestOuterEnum = Nothing + } + +-- ** FormatTest +-- | FormatTest +data FormatTest = FormatTest + { formatTestInteger :: !(Maybe Int) -- ^ "integer" + , formatTestInt32 :: !(Maybe Int) -- ^ "int32" + , formatTestInt64 :: !(Maybe Integer) -- ^ "int64" + , formatTestNumber :: !(Double) -- ^ /Required/ "number" + , formatTestFloat :: !(Maybe Float) -- ^ "float" + , formatTestDouble :: !(Maybe Double) -- ^ "double" + , formatTestString :: !(Maybe Text) -- ^ "string" + , formatTestByte :: !(ByteArray) -- ^ /Required/ "byte" + , formatTestBinary :: !(Maybe Binary) -- ^ "binary" + , formatTestDate :: !(Date) -- ^ /Required/ "date" + , formatTestDateTime :: !(Maybe DateTime) -- ^ "dateTime" + , formatTestUuid :: !(Maybe Text) -- ^ "uuid" + , formatTestPassword :: !(Text) -- ^ /Required/ "password" + } deriving (P.Show, P.Eq, P.Typeable) - --- | Construct a value of type 'MapTest' (by applying it's required fields, if any) -mkMapTest - :: MapTest -mkMapTest = - MapTest - { mapTestMapMapOfString = Nothing - , mapTestMapOfEnumString = Nothing - } - --- ** MixedPropertiesAndAdditionalPropertiesClass --- | MixedPropertiesAndAdditionalPropertiesClass -data MixedPropertiesAndAdditionalPropertiesClass = MixedPropertiesAndAdditionalPropertiesClass - { mixedPropertiesAndAdditionalPropertiesClassUuid :: !(Maybe Text) -- ^ "uuid" - , mixedPropertiesAndAdditionalPropertiesClassDateTime :: !(Maybe DateTime) -- ^ "dateTime" - , mixedPropertiesAndAdditionalPropertiesClassMap :: !(Maybe (Map.Map String Animal)) -- ^ "map" - } deriving (P.Show, P.Eq, P.Typeable) +-- | FromJSON FormatTest +instance A.FromJSON FormatTest where + parseJSON = A.withObject "FormatTest" $ \o -> + FormatTest + <$> (o .:? "integer") + <*> (o .:? "int32") + <*> (o .:? "int64") + <*> (o .: "number") + <*> (o .:? "float") + <*> (o .:? "double") + <*> (o .:? "string") + <*> (o .: "byte") + <*> (o .:? "binary") + <*> (o .: "date") + <*> (o .:? "dateTime") + <*> (o .:? "uuid") + <*> (o .: "password") --- | FromJSON MixedPropertiesAndAdditionalPropertiesClass -instance A.FromJSON MixedPropertiesAndAdditionalPropertiesClass where - parseJSON = A.withObject "MixedPropertiesAndAdditionalPropertiesClass" $ \o -> - MixedPropertiesAndAdditionalPropertiesClass - <$> (o .:? "uuid") - <*> (o .:? "dateTime") - <*> (o .:? "map") - --- | ToJSON MixedPropertiesAndAdditionalPropertiesClass -instance A.ToJSON MixedPropertiesAndAdditionalPropertiesClass where - toJSON MixedPropertiesAndAdditionalPropertiesClass {..} = - _omitNulls - [ "uuid" .= mixedPropertiesAndAdditionalPropertiesClassUuid - , "dateTime" .= mixedPropertiesAndAdditionalPropertiesClassDateTime - , "map" .= mixedPropertiesAndAdditionalPropertiesClassMap - ] - - --- | Construct a value of type 'MixedPropertiesAndAdditionalPropertiesClass' (by applying it's required fields, if any) -mkMixedPropertiesAndAdditionalPropertiesClass - :: MixedPropertiesAndAdditionalPropertiesClass -mkMixedPropertiesAndAdditionalPropertiesClass = - MixedPropertiesAndAdditionalPropertiesClass - { mixedPropertiesAndAdditionalPropertiesClassUuid = Nothing - , mixedPropertiesAndAdditionalPropertiesClassDateTime = Nothing - , mixedPropertiesAndAdditionalPropertiesClassMap = Nothing - } - --- ** Model200Response --- | Model200Response --- Model for testing model name starting with number -data Model200Response = Model200Response - { model200ResponseName :: !(Maybe Int) -- ^ "name" - , model200ResponseClass :: !(Maybe Text) -- ^ "class" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Model200Response -instance A.FromJSON Model200Response where - parseJSON = A.withObject "Model200Response" $ \o -> - Model200Response - <$> (o .:? "name") - <*> (o .:? "class") - --- | ToJSON Model200Response -instance A.ToJSON Model200Response where - toJSON Model200Response {..} = - _omitNulls - [ "name" .= model200ResponseName - , "class" .= model200ResponseClass - ] +-- | ToJSON FormatTest +instance A.ToJSON FormatTest where + toJSON FormatTest {..} = + _omitNulls + [ "integer" .= formatTestInteger + , "int32" .= formatTestInt32 + , "int64" .= formatTestInt64 + , "number" .= formatTestNumber + , "float" .= formatTestFloat + , "double" .= formatTestDouble + , "string" .= formatTestString + , "byte" .= formatTestByte + , "binary" .= formatTestBinary + , "date" .= formatTestDate + , "dateTime" .= formatTestDateTime + , "uuid" .= formatTestUuid + , "password" .= formatTestPassword + ] + + +-- | Construct a value of type 'FormatTest' (by applying it's required fields, if any) +mkFormatTest + :: Double -- ^ 'formatTestNumber' + -> ByteArray -- ^ 'formatTestByte' + -> Date -- ^ 'formatTestDate' + -> Text -- ^ 'formatTestPassword' + -> FormatTest +mkFormatTest formatTestNumber formatTestByte formatTestDate formatTestPassword = + FormatTest + { formatTestInteger = Nothing + , formatTestInt32 = Nothing + , formatTestInt64 = Nothing + , formatTestNumber + , formatTestFloat = Nothing + , formatTestDouble = Nothing + , formatTestString = Nothing + , formatTestByte + , formatTestBinary = Nothing + , formatTestDate + , formatTestDateTime = Nothing + , formatTestUuid = Nothing + , formatTestPassword + } + +-- ** HasOnlyReadOnly +-- | HasOnlyReadOnly +data HasOnlyReadOnly = HasOnlyReadOnly + { hasOnlyReadOnlyBar :: !(Maybe Text) -- ^ "bar" + , hasOnlyReadOnlyFoo :: !(Maybe Text) -- ^ "foo" + } deriving (P.Show, P.Eq, P.Typeable) - --- | Construct a value of type 'Model200Response' (by applying it's required fields, if any) -mkModel200Response - :: Model200Response -mkModel200Response = - Model200Response - { model200ResponseName = Nothing - , model200ResponseClass = Nothing - } - --- ** ModelList --- | ModelList -data ModelList = ModelList - { modelList123List :: !(Maybe Text) -- ^ "123-list" - } deriving (P.Show, P.Eq, P.Typeable) +-- | FromJSON HasOnlyReadOnly +instance A.FromJSON HasOnlyReadOnly where + parseJSON = A.withObject "HasOnlyReadOnly" $ \o -> + HasOnlyReadOnly + <$> (o .:? "bar") + <*> (o .:? "foo") + +-- | ToJSON HasOnlyReadOnly +instance A.ToJSON HasOnlyReadOnly where + toJSON HasOnlyReadOnly {..} = + _omitNulls + [ "bar" .= hasOnlyReadOnlyBar + , "foo" .= hasOnlyReadOnlyFoo + ] + --- | FromJSON ModelList -instance A.FromJSON ModelList where - parseJSON = A.withObject "ModelList" $ \o -> - ModelList - <$> (o .:? "123-list") - --- | ToJSON ModelList -instance A.ToJSON ModelList where - toJSON ModelList {..} = - _omitNulls - [ "123-list" .= modelList123List - ] - - --- | Construct a value of type 'ModelList' (by applying it's required fields, if any) -mkModelList - :: ModelList -mkModelList = - ModelList - { modelList123List = Nothing - } - --- ** ModelReturn --- | ModelReturn --- Model for testing reserved words -data ModelReturn = ModelReturn - { modelReturnReturn :: !(Maybe Int) -- ^ "return" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ModelReturn -instance A.FromJSON ModelReturn where - parseJSON = A.withObject "ModelReturn" $ \o -> - ModelReturn - <$> (o .:? "return") - --- | ToJSON ModelReturn -instance A.ToJSON ModelReturn where - toJSON ModelReturn {..} = - _omitNulls - [ "return" .= modelReturnReturn - ] - - --- | Construct a value of type 'ModelReturn' (by applying it's required fields, if any) -mkModelReturn - :: ModelReturn -mkModelReturn = - ModelReturn - { modelReturnReturn = Nothing - } - --- ** Name --- | Name --- Model for testing model name same as property name -data Name = Name - { nameName :: !(Int) -- ^ /Required/ "name" - , nameSnakeCase :: !(Maybe Int) -- ^ "snake_case" - , nameProperty :: !(Maybe Text) -- ^ "property" - , name123Number :: !(Maybe Int) -- ^ "123Number" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Name -instance A.FromJSON Name where - parseJSON = A.withObject "Name" $ \o -> - Name - <$> (o .: "name") - <*> (o .:? "snake_case") - <*> (o .:? "property") - <*> (o .:? "123Number") - --- | ToJSON Name -instance A.ToJSON Name where - toJSON Name {..} = - _omitNulls - [ "name" .= nameName - , "snake_case" .= nameSnakeCase - , "property" .= nameProperty - , "123Number" .= name123Number - ] - - --- | Construct a value of type 'Name' (by applying it's required fields, if any) -mkName - :: Int -- ^ 'nameName' - -> Name -mkName nameName = - Name - { nameName - , nameSnakeCase = Nothing - , nameProperty = Nothing - , name123Number = Nothing - } - --- ** NumberOnly --- | NumberOnly -data NumberOnly = NumberOnly - { numberOnlyJustNumber :: !(Maybe Double) -- ^ "JustNumber" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON NumberOnly -instance A.FromJSON NumberOnly where - parseJSON = A.withObject "NumberOnly" $ \o -> - NumberOnly - <$> (o .:? "JustNumber") - --- | ToJSON NumberOnly -instance A.ToJSON NumberOnly where - toJSON NumberOnly {..} = - _omitNulls - [ "JustNumber" .= numberOnlyJustNumber - ] - - --- | Construct a value of type 'NumberOnly' (by applying it's required fields, if any) -mkNumberOnly - :: NumberOnly -mkNumberOnly = - NumberOnly - { numberOnlyJustNumber = Nothing - } - --- ** Order --- | Order -data Order = Order - { orderId :: !(Maybe Integer) -- ^ "id" - , orderPetId :: !(Maybe Integer) -- ^ "petId" - , orderQuantity :: !(Maybe Int) -- ^ "quantity" - , orderShipDate :: !(Maybe DateTime) -- ^ "shipDate" - , orderStatus :: !(Maybe E'Status) -- ^ "status" - Order Status - , orderComplete :: !(Maybe Bool) -- ^ "complete" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Order -instance A.FromJSON Order where - parseJSON = A.withObject "Order" $ \o -> - Order - <$> (o .:? "id") - <*> (o .:? "petId") - <*> (o .:? "quantity") - <*> (o .:? "shipDate") - <*> (o .:? "status") - <*> (o .:? "complete") - --- | ToJSON Order -instance A.ToJSON Order where - toJSON Order {..} = - _omitNulls - [ "id" .= orderId - , "petId" .= orderPetId - , "quantity" .= orderQuantity - , "shipDate" .= orderShipDate - , "status" .= orderStatus - , "complete" .= orderComplete - ] - - --- | Construct a value of type 'Order' (by applying it's required fields, if any) -mkOrder - :: Order -mkOrder = - Order - { orderId = Nothing - , orderPetId = Nothing - , orderQuantity = Nothing - , orderShipDate = Nothing - , orderStatus = Nothing - , orderComplete = Nothing - } - --- ** OuterBoolean --- | OuterBoolean -newtype OuterBoolean = OuterBoolean - { unOuterBoolean :: Bool - } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData) - - --- ** OuterComposite --- | OuterComposite -data OuterComposite = OuterComposite - { outerCompositeMyNumber :: !(Maybe OuterNumber) -- ^ "my_number" - , outerCompositeMyString :: !(Maybe OuterString) -- ^ "my_string" - , outerCompositeMyBoolean :: !(Maybe OuterBoolean) -- ^ "my_boolean" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON OuterComposite -instance A.FromJSON OuterComposite where - parseJSON = A.withObject "OuterComposite" $ \o -> - OuterComposite - <$> (o .:? "my_number") - <*> (o .:? "my_string") - <*> (o .:? "my_boolean") - --- | ToJSON OuterComposite -instance A.ToJSON OuterComposite where - toJSON OuterComposite {..} = - _omitNulls - [ "my_number" .= outerCompositeMyNumber - , "my_string" .= outerCompositeMyString - , "my_boolean" .= outerCompositeMyBoolean - ] - - --- | Construct a value of type 'OuterComposite' (by applying it's required fields, if any) -mkOuterComposite - :: OuterComposite -mkOuterComposite = - OuterComposite - { outerCompositeMyNumber = Nothing - , outerCompositeMyString = Nothing - , outerCompositeMyBoolean = Nothing - } - --- ** OuterNumber --- | OuterNumber -newtype OuterNumber = OuterNumber - { unOuterNumber :: Double - } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData) - - --- ** OuterString --- | OuterString -newtype OuterString = OuterString - { unOuterString :: Text - } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData) - - --- ** Pet --- | Pet -data Pet = Pet - { petId :: !(Maybe Integer) -- ^ "id" - , petCategory :: !(Maybe Category) -- ^ "category" - , petName :: !(Text) -- ^ /Required/ "name" - , petPhotoUrls :: !([Text]) -- ^ /Required/ "photoUrls" - , petTags :: !(Maybe [Tag]) -- ^ "tags" - , petStatus :: !(Maybe E'Status2) -- ^ "status" - pet status in the store - } deriving (P.Show, P.Eq, P.Typeable) +-- | Construct a value of type 'HasOnlyReadOnly' (by applying it's required fields, if any) +mkHasOnlyReadOnly + :: HasOnlyReadOnly +mkHasOnlyReadOnly = + HasOnlyReadOnly + { hasOnlyReadOnlyBar = Nothing + , hasOnlyReadOnlyFoo = Nothing + } + +-- ** MapTest +-- | MapTest +data MapTest = MapTest + { mapTestMapMapOfString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_of_string" + , mapTestMapOfEnumString :: !(Maybe (Map.Map String E'Inner)) -- ^ "map_of_enum_string" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON MapTest +instance A.FromJSON MapTest where + parseJSON = A.withObject "MapTest" $ \o -> + MapTest + <$> (o .:? "map_map_of_string") + <*> (o .:? "map_of_enum_string") + +-- | ToJSON MapTest +instance A.ToJSON MapTest where + toJSON MapTest {..} = + _omitNulls + [ "map_map_of_string" .= mapTestMapMapOfString + , "map_of_enum_string" .= mapTestMapOfEnumString + ] + + +-- | Construct a value of type 'MapTest' (by applying it's required fields, if any) +mkMapTest + :: MapTest +mkMapTest = + MapTest + { mapTestMapMapOfString = Nothing + , mapTestMapOfEnumString = Nothing + } + +-- ** MixedPropertiesAndAdditionalPropertiesClass +-- | MixedPropertiesAndAdditionalPropertiesClass +data MixedPropertiesAndAdditionalPropertiesClass = MixedPropertiesAndAdditionalPropertiesClass + { mixedPropertiesAndAdditionalPropertiesClassUuid :: !(Maybe Text) -- ^ "uuid" + , mixedPropertiesAndAdditionalPropertiesClassDateTime :: !(Maybe DateTime) -- ^ "dateTime" + , mixedPropertiesAndAdditionalPropertiesClassMap :: !(Maybe (Map.Map String Animal)) -- ^ "map" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON MixedPropertiesAndAdditionalPropertiesClass +instance A.FromJSON MixedPropertiesAndAdditionalPropertiesClass where + parseJSON = A.withObject "MixedPropertiesAndAdditionalPropertiesClass" $ \o -> + MixedPropertiesAndAdditionalPropertiesClass + <$> (o .:? "uuid") + <*> (o .:? "dateTime") + <*> (o .:? "map") + +-- | ToJSON MixedPropertiesAndAdditionalPropertiesClass +instance A.ToJSON MixedPropertiesAndAdditionalPropertiesClass where + toJSON MixedPropertiesAndAdditionalPropertiesClass {..} = + _omitNulls + [ "uuid" .= mixedPropertiesAndAdditionalPropertiesClassUuid + , "dateTime" .= mixedPropertiesAndAdditionalPropertiesClassDateTime + , "map" .= mixedPropertiesAndAdditionalPropertiesClassMap + ] + + +-- | Construct a value of type 'MixedPropertiesAndAdditionalPropertiesClass' (by applying it's required fields, if any) +mkMixedPropertiesAndAdditionalPropertiesClass + :: MixedPropertiesAndAdditionalPropertiesClass +mkMixedPropertiesAndAdditionalPropertiesClass = + MixedPropertiesAndAdditionalPropertiesClass + { mixedPropertiesAndAdditionalPropertiesClassUuid = Nothing + , mixedPropertiesAndAdditionalPropertiesClassDateTime = Nothing + , mixedPropertiesAndAdditionalPropertiesClassMap = Nothing + } + +-- ** Model200Response +-- | Model200Response +-- Model for testing model name starting with number +data Model200Response = Model200Response + { model200ResponseName :: !(Maybe Int) -- ^ "name" + , model200ResponseClass :: !(Maybe Text) -- ^ "class" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Model200Response +instance A.FromJSON Model200Response where + parseJSON = A.withObject "Model200Response" $ \o -> + Model200Response + <$> (o .:? "name") + <*> (o .:? "class") + +-- | ToJSON Model200Response +instance A.ToJSON Model200Response where + toJSON Model200Response {..} = + _omitNulls + [ "name" .= model200ResponseName + , "class" .= model200ResponseClass + ] + + +-- | Construct a value of type 'Model200Response' (by applying it's required fields, if any) +mkModel200Response + :: Model200Response +mkModel200Response = + Model200Response + { model200ResponseName = Nothing + , model200ResponseClass = Nothing + } + +-- ** ModelList +-- | ModelList +data ModelList = ModelList + { modelList123List :: !(Maybe Text) -- ^ "123-list" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelList +instance A.FromJSON ModelList where + parseJSON = A.withObject "ModelList" $ \o -> + ModelList + <$> (o .:? "123-list") + +-- | ToJSON ModelList +instance A.ToJSON ModelList where + toJSON ModelList {..} = + _omitNulls + [ "123-list" .= modelList123List + ] + + +-- | Construct a value of type 'ModelList' (by applying it's required fields, if any) +mkModelList + :: ModelList +mkModelList = + ModelList + { modelList123List = Nothing + } + +-- ** ModelReturn +-- | ModelReturn +-- Model for testing reserved words +data ModelReturn = ModelReturn + { modelReturnReturn :: !(Maybe Int) -- ^ "return" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ModelReturn +instance A.FromJSON ModelReturn where + parseJSON = A.withObject "ModelReturn" $ \o -> + ModelReturn + <$> (o .:? "return") + +-- | ToJSON ModelReturn +instance A.ToJSON ModelReturn where + toJSON ModelReturn {..} = + _omitNulls + [ "return" .= modelReturnReturn + ] + + +-- | Construct a value of type 'ModelReturn' (by applying it's required fields, if any) +mkModelReturn + :: ModelReturn +mkModelReturn = + ModelReturn + { modelReturnReturn = Nothing + } + +-- ** Name +-- | Name +-- Model for testing model name same as property name +data Name = Name + { nameName :: !(Int) -- ^ /Required/ "name" + , nameSnakeCase :: !(Maybe Int) -- ^ "snake_case" + , nameProperty :: !(Maybe Text) -- ^ "property" + , name123Number :: !(Maybe Int) -- ^ "123Number" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Name +instance A.FromJSON Name where + parseJSON = A.withObject "Name" $ \o -> + Name + <$> (o .: "name") + <*> (o .:? "snake_case") + <*> (o .:? "property") + <*> (o .:? "123Number") + +-- | ToJSON Name +instance A.ToJSON Name where + toJSON Name {..} = + _omitNulls + [ "name" .= nameName + , "snake_case" .= nameSnakeCase + , "property" .= nameProperty + , "123Number" .= name123Number + ] + + +-- | Construct a value of type 'Name' (by applying it's required fields, if any) +mkName + :: Int -- ^ 'nameName' + -> Name +mkName nameName = + Name + { nameName + , nameSnakeCase = Nothing + , nameProperty = Nothing + , name123Number = Nothing + } + +-- ** NumberOnly +-- | NumberOnly +data NumberOnly = NumberOnly + { numberOnlyJustNumber :: !(Maybe Double) -- ^ "JustNumber" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON NumberOnly +instance A.FromJSON NumberOnly where + parseJSON = A.withObject "NumberOnly" $ \o -> + NumberOnly + <$> (o .:? "JustNumber") + +-- | ToJSON NumberOnly +instance A.ToJSON NumberOnly where + toJSON NumberOnly {..} = + _omitNulls + [ "JustNumber" .= numberOnlyJustNumber + ] + + +-- | Construct a value of type 'NumberOnly' (by applying it's required fields, if any) +mkNumberOnly + :: NumberOnly +mkNumberOnly = + NumberOnly + { numberOnlyJustNumber = Nothing + } --- | FromJSON Pet -instance A.FromJSON Pet where - parseJSON = A.withObject "Pet" $ \o -> - Pet - <$> (o .:? "id") - <*> (o .:? "category") - <*> (o .: "name") - <*> (o .: "photoUrls") - <*> (o .:? "tags") - <*> (o .:? "status") +-- ** Order +-- | Order +data Order = Order + { orderId :: !(Maybe Integer) -- ^ "id" + , orderPetId :: !(Maybe Integer) -- ^ "petId" + , orderQuantity :: !(Maybe Int) -- ^ "quantity" + , orderShipDate :: !(Maybe DateTime) -- ^ "shipDate" + , orderStatus :: !(Maybe E'Status) -- ^ "status" - Order Status + , orderComplete :: !(Maybe Bool) -- ^ "complete" + } deriving (P.Show, P.Eq, P.Typeable) --- | ToJSON Pet -instance A.ToJSON Pet where - toJSON Pet {..} = - _omitNulls - [ "id" .= petId - , "category" .= petCategory - , "name" .= petName - , "photoUrls" .= petPhotoUrls - , "tags" .= petTags - , "status" .= petStatus - ] - - --- | Construct a value of type 'Pet' (by applying it's required fields, if any) -mkPet - :: Text -- ^ 'petName' - -> [Text] -- ^ 'petPhotoUrls' - -> Pet -mkPet petName petPhotoUrls = - Pet - { petId = Nothing - , petCategory = Nothing - , petName - , petPhotoUrls - , petTags = Nothing - , petStatus = Nothing - } - --- ** ReadOnlyFirst --- | ReadOnlyFirst -data ReadOnlyFirst = ReadOnlyFirst - { readOnlyFirstBar :: !(Maybe Text) -- ^ "bar" - , readOnlyFirstBaz :: !(Maybe Text) -- ^ "baz" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON ReadOnlyFirst -instance A.FromJSON ReadOnlyFirst where - parseJSON = A.withObject "ReadOnlyFirst" $ \o -> - ReadOnlyFirst - <$> (o .:? "bar") - <*> (o .:? "baz") - --- | ToJSON ReadOnlyFirst -instance A.ToJSON ReadOnlyFirst where - toJSON ReadOnlyFirst {..} = - _omitNulls - [ "bar" .= readOnlyFirstBar - , "baz" .= readOnlyFirstBaz - ] - - --- | Construct a value of type 'ReadOnlyFirst' (by applying it's required fields, if any) -mkReadOnlyFirst - :: ReadOnlyFirst -mkReadOnlyFirst = - ReadOnlyFirst - { readOnlyFirstBar = Nothing - , readOnlyFirstBaz = Nothing - } +-- | FromJSON Order +instance A.FromJSON Order where + parseJSON = A.withObject "Order" $ \o -> + Order + <$> (o .:? "id") + <*> (o .:? "petId") + <*> (o .:? "quantity") + <*> (o .:? "shipDate") + <*> (o .:? "status") + <*> (o .:? "complete") + +-- | ToJSON Order +instance A.ToJSON Order where + toJSON Order {..} = + _omitNulls + [ "id" .= orderId + , "petId" .= orderPetId + , "quantity" .= orderQuantity + , "shipDate" .= orderShipDate + , "status" .= orderStatus + , "complete" .= orderComplete + ] + + +-- | Construct a value of type 'Order' (by applying it's required fields, if any) +mkOrder + :: Order +mkOrder = + Order + { orderId = Nothing + , orderPetId = Nothing + , orderQuantity = Nothing + , orderShipDate = Nothing + , orderStatus = Nothing + , orderComplete = Nothing + } + +-- ** OuterBoolean +-- | OuterBoolean +newtype OuterBoolean = OuterBoolean + { unOuterBoolean :: Bool + } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData) + + +-- ** OuterComposite +-- | OuterComposite +data OuterComposite = OuterComposite + { outerCompositeMyNumber :: !(Maybe OuterNumber) -- ^ "my_number" + , outerCompositeMyString :: !(Maybe OuterString) -- ^ "my_string" + , outerCompositeMyBoolean :: !(Maybe OuterBoolean) -- ^ "my_boolean" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON OuterComposite +instance A.FromJSON OuterComposite where + parseJSON = A.withObject "OuterComposite" $ \o -> + OuterComposite + <$> (o .:? "my_number") + <*> (o .:? "my_string") + <*> (o .:? "my_boolean") --- ** SpecialModelName --- | SpecialModelName -data SpecialModelName = SpecialModelName - { specialModelNameSpecialPropertyName :: !(Maybe Integer) -- ^ "$special[property.name]" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON SpecialModelName -instance A.FromJSON SpecialModelName where - parseJSON = A.withObject "SpecialModelName" $ \o -> - SpecialModelName - <$> (o .:? "$special[property.name]") - --- | ToJSON SpecialModelName -instance A.ToJSON SpecialModelName where - toJSON SpecialModelName {..} = - _omitNulls - [ "$special[property.name]" .= specialModelNameSpecialPropertyName - ] - +-- | ToJSON OuterComposite +instance A.ToJSON OuterComposite where + toJSON OuterComposite {..} = + _omitNulls + [ "my_number" .= outerCompositeMyNumber + , "my_string" .= outerCompositeMyString + , "my_boolean" .= outerCompositeMyBoolean + ] + + +-- | Construct a value of type 'OuterComposite' (by applying it's required fields, if any) +mkOuterComposite + :: OuterComposite +mkOuterComposite = + OuterComposite + { outerCompositeMyNumber = Nothing + , outerCompositeMyString = Nothing + , outerCompositeMyBoolean = Nothing + } --- | Construct a value of type 'SpecialModelName' (by applying it's required fields, if any) -mkSpecialModelName - :: SpecialModelName -mkSpecialModelName = - SpecialModelName - { specialModelNameSpecialPropertyName = Nothing - } - --- ** Tag --- | Tag -data Tag = Tag - { tagId :: !(Maybe Integer) -- ^ "id" - , tagName :: !(Maybe Text) -- ^ "name" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Tag -instance A.FromJSON Tag where - parseJSON = A.withObject "Tag" $ \o -> - Tag - <$> (o .:? "id") - <*> (o .:? "name") - --- | ToJSON Tag -instance A.ToJSON Tag where - toJSON Tag {..} = - _omitNulls - [ "id" .= tagId - , "name" .= tagName - ] - - --- | Construct a value of type 'Tag' (by applying it's required fields, if any) -mkTag - :: Tag -mkTag = - Tag - { tagId = Nothing - , tagName = Nothing - } - --- ** User --- | User -data User = User - { userId :: !(Maybe Integer) -- ^ "id" - , userUsername :: !(Maybe Text) -- ^ "username" - , userFirstName :: !(Maybe Text) -- ^ "firstName" - , userLastName :: !(Maybe Text) -- ^ "lastName" - , userEmail :: !(Maybe Text) -- ^ "email" - , userPassword :: !(Maybe Text) -- ^ "password" - , userPhone :: !(Maybe Text) -- ^ "phone" - , userUserStatus :: !(Maybe Int) -- ^ "userStatus" - User Status - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON User -instance A.FromJSON User where - parseJSON = A.withObject "User" $ \o -> - User - <$> (o .:? "id") - <*> (o .:? "username") - <*> (o .:? "firstName") - <*> (o .:? "lastName") - <*> (o .:? "email") - <*> (o .:? "password") - <*> (o .:? "phone") - <*> (o .:? "userStatus") - --- | ToJSON User -instance A.ToJSON User where - toJSON User {..} = - _omitNulls - [ "id" .= userId - , "username" .= userUsername - , "firstName" .= userFirstName - , "lastName" .= userLastName - , "email" .= userEmail - , "password" .= userPassword - , "phone" .= userPhone - , "userStatus" .= userUserStatus - ] - - --- | Construct a value of type 'User' (by applying it's required fields, if any) -mkUser - :: User -mkUser = - User - { userId = Nothing - , userUsername = Nothing - , userFirstName = Nothing - , userLastName = Nothing - , userEmail = Nothing - , userPassword = Nothing - , userPhone = Nothing - , userUserStatus = Nothing +-- ** OuterNumber +-- | OuterNumber +newtype OuterNumber = OuterNumber + { unOuterNumber :: Double + } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData) + + +-- ** OuterString +-- | OuterString +newtype OuterString = OuterString + { unOuterString :: Text + } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData) + + +-- ** Pet +-- | Pet +data Pet = Pet + { petId :: !(Maybe Integer) -- ^ "id" + , petCategory :: !(Maybe Category) -- ^ "category" + , petName :: !(Text) -- ^ /Required/ "name" + , petPhotoUrls :: !([Text]) -- ^ /Required/ "photoUrls" + , petTags :: !(Maybe [Tag]) -- ^ "tags" + , petStatus :: !(Maybe E'Status2) -- ^ "status" - pet status in the store + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Pet +instance A.FromJSON Pet where + parseJSON = A.withObject "Pet" $ \o -> + Pet + <$> (o .:? "id") + <*> (o .:? "category") + <*> (o .: "name") + <*> (o .: "photoUrls") + <*> (o .:? "tags") + <*> (o .:? "status") + +-- | ToJSON Pet +instance A.ToJSON Pet where + toJSON Pet {..} = + _omitNulls + [ "id" .= petId + , "category" .= petCategory + , "name" .= petName + , "photoUrls" .= petPhotoUrls + , "tags" .= petTags + , "status" .= petStatus + ] + + +-- | Construct a value of type 'Pet' (by applying it's required fields, if any) +mkPet + :: Text -- ^ 'petName' + -> [Text] -- ^ 'petPhotoUrls' + -> Pet +mkPet petName petPhotoUrls = + Pet + { petId = Nothing + , petCategory = Nothing + , petName + , petPhotoUrls + , petTags = Nothing + , petStatus = Nothing + } + +-- ** ReadOnlyFirst +-- | ReadOnlyFirst +data ReadOnlyFirst = ReadOnlyFirst + { readOnlyFirstBar :: !(Maybe Text) -- ^ "bar" + , readOnlyFirstBaz :: !(Maybe Text) -- ^ "baz" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON ReadOnlyFirst +instance A.FromJSON ReadOnlyFirst where + parseJSON = A.withObject "ReadOnlyFirst" $ \o -> + ReadOnlyFirst + <$> (o .:? "bar") + <*> (o .:? "baz") + +-- | ToJSON ReadOnlyFirst +instance A.ToJSON ReadOnlyFirst where + toJSON ReadOnlyFirst {..} = + _omitNulls + [ "bar" .= readOnlyFirstBar + , "baz" .= readOnlyFirstBaz + ] + + +-- | Construct a value of type 'ReadOnlyFirst' (by applying it's required fields, if any) +mkReadOnlyFirst + :: ReadOnlyFirst +mkReadOnlyFirst = + ReadOnlyFirst + { readOnlyFirstBar = Nothing + , readOnlyFirstBaz = Nothing } --- ** Cat --- | Cat -data Cat = Cat - { catClassName :: !(Text) -- ^ /Required/ "className" - , catColor :: !(Maybe Text) -- ^ "color" - , catDeclawed :: !(Maybe Bool) -- ^ "declawed" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Cat -instance A.FromJSON Cat where - parseJSON = A.withObject "Cat" $ \o -> - Cat - <$> (o .: "className") - <*> (o .:? "color") - <*> (o .:? "declawed") - --- | ToJSON Cat -instance A.ToJSON Cat where - toJSON Cat {..} = - _omitNulls - [ "className" .= catClassName - , "color" .= catColor - , "declawed" .= catDeclawed - ] - - --- | Construct a value of type 'Cat' (by applying it's required fields, if any) -mkCat - :: Text -- ^ 'catClassName' - -> Cat -mkCat catClassName = - Cat - { catClassName - , catColor = Nothing - , catDeclawed = Nothing - } - --- ** Dog --- | Dog -data Dog = Dog - { dogClassName :: !(Text) -- ^ /Required/ "className" - , dogColor :: !(Maybe Text) -- ^ "color" - , dogBreed :: !(Maybe Text) -- ^ "breed" - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON Dog -instance A.FromJSON Dog where - parseJSON = A.withObject "Dog" $ \o -> - Dog - <$> (o .: "className") - <*> (o .:? "color") - <*> (o .:? "breed") - --- | ToJSON Dog -instance A.ToJSON Dog where - toJSON Dog {..} = - _omitNulls - [ "className" .= dogClassName - , "color" .= dogColor - , "breed" .= dogBreed - ] - - --- | Construct a value of type 'Dog' (by applying it's required fields, if any) -mkDog - :: Text -- ^ 'dogClassName' - -> Dog -mkDog dogClassName = - Dog - { dogClassName - , dogColor = Nothing - , dogBreed = Nothing - } - - --- * Enums - - --- ** E'ArrayEnum - --- | Enum of 'Text' -data E'ArrayEnum - = E'ArrayEnum'Fish -- ^ @"fish"@ - | E'ArrayEnum'Crab -- ^ @"crab"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) +-- ** SpecialModelName +-- | SpecialModelName +data SpecialModelName = SpecialModelName + { specialModelNameSpecialPropertyName :: !(Maybe Integer) -- ^ "$special[property.name]" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON SpecialModelName +instance A.FromJSON SpecialModelName where + parseJSON = A.withObject "SpecialModelName" $ \o -> + SpecialModelName + <$> (o .:? "$special[property.name]") + +-- | ToJSON SpecialModelName +instance A.ToJSON SpecialModelName where + toJSON SpecialModelName {..} = + _omitNulls + [ "$special[property.name]" .= specialModelNameSpecialPropertyName + ] + + +-- | Construct a value of type 'SpecialModelName' (by applying it's required fields, if any) +mkSpecialModelName + :: SpecialModelName +mkSpecialModelName = + SpecialModelName + { specialModelNameSpecialPropertyName = Nothing + } + +-- ** Tag +-- | Tag +data Tag = Tag + { tagId :: !(Maybe Integer) -- ^ "id" + , tagName :: !(Maybe Text) -- ^ "name" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Tag +instance A.FromJSON Tag where + parseJSON = A.withObject "Tag" $ \o -> + Tag + <$> (o .:? "id") + <*> (o .:? "name") + +-- | ToJSON Tag +instance A.ToJSON Tag where + toJSON Tag {..} = + _omitNulls + [ "id" .= tagId + , "name" .= tagName + ] + + +-- | Construct a value of type 'Tag' (by applying it's required fields, if any) +mkTag + :: Tag +mkTag = + Tag + { tagId = Nothing + , tagName = Nothing + } + +-- ** User +-- | User +data User = User + { userId :: !(Maybe Integer) -- ^ "id" + , userUsername :: !(Maybe Text) -- ^ "username" + , userFirstName :: !(Maybe Text) -- ^ "firstName" + , userLastName :: !(Maybe Text) -- ^ "lastName" + , userEmail :: !(Maybe Text) -- ^ "email" + , userPassword :: !(Maybe Text) -- ^ "password" + , userPhone :: !(Maybe Text) -- ^ "phone" + , userUserStatus :: !(Maybe Int) -- ^ "userStatus" - User Status + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON User +instance A.FromJSON User where + parseJSON = A.withObject "User" $ \o -> + User + <$> (o .:? "id") + <*> (o .:? "username") + <*> (o .:? "firstName") + <*> (o .:? "lastName") + <*> (o .:? "email") + <*> (o .:? "password") + <*> (o .:? "phone") + <*> (o .:? "userStatus") -instance A.ToJSON E'ArrayEnum where toJSON = A.toJSON . fromE'ArrayEnum -instance A.FromJSON E'ArrayEnum where parseJSON o = P.either P.fail (pure . P.id) . toE'ArrayEnum =<< A.parseJSON o -instance WH.ToHttpApiData E'ArrayEnum where toQueryParam = WH.toQueryParam . fromE'ArrayEnum -instance WH.FromHttpApiData E'ArrayEnum where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'ArrayEnum -instance MimeRender MimeMultipartFormData E'ArrayEnum where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'ArrayEnum' enum -fromE'ArrayEnum :: E'ArrayEnum -> Text -fromE'ArrayEnum = \case - E'ArrayEnum'Fish -> "fish" - E'ArrayEnum'Crab -> "crab" - --- | parse 'E'ArrayEnum' enum -toE'ArrayEnum :: Text -> P.Either String E'ArrayEnum -toE'ArrayEnum = \case - "fish" -> P.Right E'ArrayEnum'Fish - "crab" -> P.Right E'ArrayEnum'Crab - s -> P.Left $ "toE'ArrayEnum: enum parse failure: " P.++ P.show s - - --- ** E'EnumFormString - --- | Enum of 'Text' -data E'EnumFormString - = E'EnumFormString'_abc -- ^ @"_abc"@ - | E'EnumFormString'_efg -- ^ @"-efg"@ - | E'EnumFormString'_xyz -- ^ @"(xyz)"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'EnumFormString where toJSON = A.toJSON . fromE'EnumFormString -instance A.FromJSON E'EnumFormString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumFormString =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumFormString where toQueryParam = WH.toQueryParam . fromE'EnumFormString -instance WH.FromHttpApiData E'EnumFormString where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumFormString -instance MimeRender MimeMultipartFormData E'EnumFormString where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'EnumFormString' enum -fromE'EnumFormString :: E'EnumFormString -> Text -fromE'EnumFormString = \case - E'EnumFormString'_abc -> "_abc" - E'EnumFormString'_efg -> "-efg" - E'EnumFormString'_xyz -> "(xyz)" - --- | parse 'E'EnumFormString' enum -toE'EnumFormString :: Text -> P.Either String E'EnumFormString -toE'EnumFormString = \case - "_abc" -> P.Right E'EnumFormString'_abc - "-efg" -> P.Right E'EnumFormString'_efg - "(xyz)" -> P.Right E'EnumFormString'_xyz - s -> P.Left $ "toE'EnumFormString: enum parse failure: " P.++ P.show s - - --- ** E'EnumInteger - --- | Enum of 'Int' -data E'EnumInteger - = E'EnumInteger'Num1 -- ^ @1@ - | E'EnumInteger'NumMinus_1 -- ^ @-1@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'EnumInteger where toJSON = A.toJSON . fromE'EnumInteger -instance A.FromJSON E'EnumInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumInteger =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumInteger where toQueryParam = WH.toQueryParam . fromE'EnumInteger -instance WH.FromHttpApiData E'EnumInteger where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumInteger -instance MimeRender MimeMultipartFormData E'EnumInteger where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'EnumInteger' enum -fromE'EnumInteger :: E'EnumInteger -> Int -fromE'EnumInteger = \case - E'EnumInteger'Num1 -> 1 - E'EnumInteger'NumMinus_1 -> -1 - --- | parse 'E'EnumInteger' enum -toE'EnumInteger :: Int -> P.Either String E'EnumInteger -toE'EnumInteger = \case - 1 -> P.Right E'EnumInteger'Num1 - -1 -> P.Right E'EnumInteger'NumMinus_1 - s -> P.Left $ "toE'EnumInteger: enum parse failure: " P.++ P.show s - - --- ** E'EnumNumber - --- | Enum of 'Double' -data E'EnumNumber - = E'EnumNumber'Num1_Dot_1 -- ^ @1.1@ - | E'EnumNumber'NumMinus_1_Dot_2 -- ^ @-1.2@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'EnumNumber where toJSON = A.toJSON . fromE'EnumNumber -instance A.FromJSON E'EnumNumber where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumNumber =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumNumber where toQueryParam = WH.toQueryParam . fromE'EnumNumber -instance WH.FromHttpApiData E'EnumNumber where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumNumber -instance MimeRender MimeMultipartFormData E'EnumNumber where mimeRender _ = mimeRenderDefaultMultipartFormData +-- | ToJSON User +instance A.ToJSON User where + toJSON User {..} = + _omitNulls + [ "id" .= userId + , "username" .= userUsername + , "firstName" .= userFirstName + , "lastName" .= userLastName + , "email" .= userEmail + , "password" .= userPassword + , "phone" .= userPhone + , "userStatus" .= userUserStatus + ] + + +-- | Construct a value of type 'User' (by applying it's required fields, if any) +mkUser + :: User +mkUser = + User + { userId = Nothing + , userUsername = Nothing + , userFirstName = Nothing + , userLastName = Nothing + , userEmail = Nothing + , userPassword = Nothing + , userPhone = Nothing + , userUserStatus = Nothing + } + +-- ** Cat +-- | Cat +data Cat = Cat + { catClassName :: !(Text) -- ^ /Required/ "className" + , catColor :: !(Maybe Text) -- ^ "color" + , catDeclawed :: !(Maybe Bool) -- ^ "declawed" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Cat +instance A.FromJSON Cat where + parseJSON = A.withObject "Cat" $ \o -> + Cat + <$> (o .: "className") + <*> (o .:? "color") + <*> (o .:? "declawed") + +-- | ToJSON Cat +instance A.ToJSON Cat where + toJSON Cat {..} = + _omitNulls + [ "className" .= catClassName + , "color" .= catColor + , "declawed" .= catDeclawed + ] + + +-- | Construct a value of type 'Cat' (by applying it's required fields, if any) +mkCat + :: Text -- ^ 'catClassName' + -> Cat +mkCat catClassName = + Cat + { catClassName + , catColor = Nothing + , catDeclawed = Nothing + } + +-- ** Dog +-- | Dog +data Dog = Dog + { dogClassName :: !(Text) -- ^ /Required/ "className" + , dogColor :: !(Maybe Text) -- ^ "color" + , dogBreed :: !(Maybe Text) -- ^ "breed" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON Dog +instance A.FromJSON Dog where + parseJSON = A.withObject "Dog" $ \o -> + Dog + <$> (o .: "className") + <*> (o .:? "color") + <*> (o .:? "breed") + +-- | ToJSON Dog +instance A.ToJSON Dog where + toJSON Dog {..} = + _omitNulls + [ "className" .= dogClassName + , "color" .= dogColor + , "breed" .= dogBreed + ] + --- | unwrap 'E'EnumNumber' enum -fromE'EnumNumber :: E'EnumNumber -> Double -fromE'EnumNumber = \case - E'EnumNumber'Num1_Dot_1 -> 1.1 - E'EnumNumber'NumMinus_1_Dot_2 -> -1.2 - --- | parse 'E'EnumNumber' enum -toE'EnumNumber :: Double -> P.Either String E'EnumNumber -toE'EnumNumber = \case - 1.1 -> P.Right E'EnumNumber'Num1_Dot_1 - -1.2 -> P.Right E'EnumNumber'NumMinus_1_Dot_2 - s -> P.Left $ "toE'EnumNumber: enum parse failure: " P.++ P.show s - +-- | Construct a value of type 'Dog' (by applying it's required fields, if any) +mkDog + :: Text -- ^ 'dogClassName' + -> Dog +mkDog dogClassName = + Dog + { dogClassName + , dogColor = Nothing + , dogBreed = Nothing + } + + +-- * Enums --- ** E'EnumQueryInteger - --- | Enum of 'Int' -data E'EnumQueryInteger - = E'EnumQueryInteger'Num1 -- ^ @1@ - | E'EnumQueryInteger'NumMinus_2 -- ^ @-2@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'EnumQueryInteger where toJSON = A.toJSON . fromE'EnumQueryInteger -instance A.FromJSON E'EnumQueryInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumQueryInteger =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumQueryInteger where toQueryParam = WH.toQueryParam . fromE'EnumQueryInteger -instance WH.FromHttpApiData E'EnumQueryInteger where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumQueryInteger -instance MimeRender MimeMultipartFormData E'EnumQueryInteger where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'EnumQueryInteger' enum -fromE'EnumQueryInteger :: E'EnumQueryInteger -> Int -fromE'EnumQueryInteger = \case - E'EnumQueryInteger'Num1 -> 1 - E'EnumQueryInteger'NumMinus_2 -> -2 - --- | parse 'E'EnumQueryInteger' enum -toE'EnumQueryInteger :: Int -> P.Either String E'EnumQueryInteger -toE'EnumQueryInteger = \case - 1 -> P.Right E'EnumQueryInteger'Num1 - -2 -> P.Right E'EnumQueryInteger'NumMinus_2 - s -> P.Left $ "toE'EnumQueryInteger: enum parse failure: " P.++ P.show s - + +-- ** E'ArrayEnum + +-- | Enum of 'Text' +data E'ArrayEnum + = E'ArrayEnum'Fish -- ^ @"fish"@ + | E'ArrayEnum'Crab -- ^ @"crab"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'ArrayEnum where toJSON = A.toJSON . fromE'ArrayEnum +instance A.FromJSON E'ArrayEnum where parseJSON o = P.either P.fail (pure . P.id) . toE'ArrayEnum =<< A.parseJSON o +instance WH.ToHttpApiData E'ArrayEnum where toQueryParam = WH.toQueryParam . fromE'ArrayEnum +instance WH.FromHttpApiData E'ArrayEnum where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'ArrayEnum +instance MimeRender MimeMultipartFormData E'ArrayEnum where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'ArrayEnum' enum +fromE'ArrayEnum :: E'ArrayEnum -> Text +fromE'ArrayEnum = \case + E'ArrayEnum'Fish -> "fish" + E'ArrayEnum'Crab -> "crab" + +-- | parse 'E'ArrayEnum' enum +toE'ArrayEnum :: Text -> P.Either String E'ArrayEnum +toE'ArrayEnum = \case + "fish" -> P.Right E'ArrayEnum'Fish + "crab" -> P.Right E'ArrayEnum'Crab + s -> P.Left $ "toE'ArrayEnum: enum parse failure: " P.++ P.show s --- ** E'EnumString - --- | Enum of 'Text' -data E'EnumString - = E'EnumString'UPPER -- ^ @"UPPER"@ - | E'EnumString'Lower -- ^ @"lower"@ - | E'EnumString'Empty -- ^ @""@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'EnumString where toJSON = A.toJSON . fromE'EnumString -instance A.FromJSON E'EnumString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumString =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumString where toQueryParam = WH.toQueryParam . fromE'EnumString -instance WH.FromHttpApiData E'EnumString where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumString -instance MimeRender MimeMultipartFormData E'EnumString where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'EnumString' enum -fromE'EnumString :: E'EnumString -> Text -fromE'EnumString = \case - E'EnumString'UPPER -> "UPPER" - E'EnumString'Lower -> "lower" - E'EnumString'Empty -> "" - --- | parse 'E'EnumString' enum -toE'EnumString :: Text -> P.Either String E'EnumString -toE'EnumString = \case - "UPPER" -> P.Right E'EnumString'UPPER - "lower" -> P.Right E'EnumString'Lower - "" -> P.Right E'EnumString'Empty - s -> P.Left $ "toE'EnumString: enum parse failure: " P.++ P.show s - + +-- ** E'EnumFormString + +-- | Enum of 'Text' +data E'EnumFormString + = E'EnumFormString'_abc -- ^ @"_abc"@ + | E'EnumFormString'_efg -- ^ @"-efg"@ + | E'EnumFormString'_xyz -- ^ @"(xyz)"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'EnumFormString where toJSON = A.toJSON . fromE'EnumFormString +instance A.FromJSON E'EnumFormString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumFormString =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumFormString where toQueryParam = WH.toQueryParam . fromE'EnumFormString +instance WH.FromHttpApiData E'EnumFormString where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumFormString +instance MimeRender MimeMultipartFormData E'EnumFormString where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'EnumFormString' enum +fromE'EnumFormString :: E'EnumFormString -> Text +fromE'EnumFormString = \case + E'EnumFormString'_abc -> "_abc" + E'EnumFormString'_efg -> "-efg" + E'EnumFormString'_xyz -> "(xyz)" + +-- | parse 'E'EnumFormString' enum +toE'EnumFormString :: Text -> P.Either String E'EnumFormString +toE'EnumFormString = \case + "_abc" -> P.Right E'EnumFormString'_abc + "-efg" -> P.Right E'EnumFormString'_efg + "(xyz)" -> P.Right E'EnumFormString'_xyz + s -> P.Left $ "toE'EnumFormString: enum parse failure: " P.++ P.show s --- ** E'Inner - --- | Enum of 'Text' -data E'Inner - = E'Inner'UPPER -- ^ @"UPPER"@ - | E'Inner'Lower -- ^ @"lower"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'Inner where toJSON = A.toJSON . fromE'Inner -instance A.FromJSON E'Inner where parseJSON o = P.either P.fail (pure . P.id) . toE'Inner =<< A.parseJSON o -instance WH.ToHttpApiData E'Inner where toQueryParam = WH.toQueryParam . fromE'Inner -instance WH.FromHttpApiData E'Inner where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Inner -instance MimeRender MimeMultipartFormData E'Inner where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'Inner' enum -fromE'Inner :: E'Inner -> Text -fromE'Inner = \case - E'Inner'UPPER -> "UPPER" - E'Inner'Lower -> "lower" - --- | parse 'E'Inner' enum -toE'Inner :: Text -> P.Either String E'Inner -toE'Inner = \case - "UPPER" -> P.Right E'Inner'UPPER - "lower" -> P.Right E'Inner'Lower - s -> P.Left $ "toE'Inner: enum parse failure: " P.++ P.show s - + +-- ** E'EnumInteger + +-- | Enum of 'Int' +data E'EnumInteger + = E'EnumInteger'Num1 -- ^ @1@ + | E'EnumInteger'NumMinus_1 -- ^ @-1@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'EnumInteger where toJSON = A.toJSON . fromE'EnumInteger +instance A.FromJSON E'EnumInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumInteger =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumInteger where toQueryParam = WH.toQueryParam . fromE'EnumInteger +instance WH.FromHttpApiData E'EnumInteger where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumInteger +instance MimeRender MimeMultipartFormData E'EnumInteger where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'EnumInteger' enum +fromE'EnumInteger :: E'EnumInteger -> Int +fromE'EnumInteger = \case + E'EnumInteger'Num1 -> 1 + E'EnumInteger'NumMinus_1 -> -1 + +-- | parse 'E'EnumInteger' enum +toE'EnumInteger :: Int -> P.Either String E'EnumInteger +toE'EnumInteger = \case + 1 -> P.Right E'EnumInteger'Num1 + -1 -> P.Right E'EnumInteger'NumMinus_1 + s -> P.Left $ "toE'EnumInteger: enum parse failure: " P.++ P.show s --- ** E'Inner2 - --- | Enum of 'Text' -data E'Inner2 - = E'Inner2'GreaterThan -- ^ @">"@ - | E'Inner2'Dollar -- ^ @"$"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'Inner2 where toJSON = A.toJSON . fromE'Inner2 -instance A.FromJSON E'Inner2 where parseJSON o = P.either P.fail (pure . P.id) . toE'Inner2 =<< A.parseJSON o -instance WH.ToHttpApiData E'Inner2 where toQueryParam = WH.toQueryParam . fromE'Inner2 -instance WH.FromHttpApiData E'Inner2 where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Inner2 -instance MimeRender MimeMultipartFormData E'Inner2 where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'Inner2' enum -fromE'Inner2 :: E'Inner2 -> Text -fromE'Inner2 = \case - E'Inner2'GreaterThan -> ">" - E'Inner2'Dollar -> "$" - --- | parse 'E'Inner2' enum -toE'Inner2 :: Text -> P.Either String E'Inner2 -toE'Inner2 = \case - ">" -> P.Right E'Inner2'GreaterThan - "$" -> P.Right E'Inner2'Dollar - s -> P.Left $ "toE'Inner2: enum parse failure: " P.++ P.show s - + +-- ** E'EnumNumber + +-- | Enum of 'Double' +data E'EnumNumber + = E'EnumNumber'Num1_Dot_1 -- ^ @1.1@ + | E'EnumNumber'NumMinus_1_Dot_2 -- ^ @-1.2@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'EnumNumber where toJSON = A.toJSON . fromE'EnumNumber +instance A.FromJSON E'EnumNumber where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumNumber =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumNumber where toQueryParam = WH.toQueryParam . fromE'EnumNumber +instance WH.FromHttpApiData E'EnumNumber where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumNumber +instance MimeRender MimeMultipartFormData E'EnumNumber where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'EnumNumber' enum +fromE'EnumNumber :: E'EnumNumber -> Double +fromE'EnumNumber = \case + E'EnumNumber'Num1_Dot_1 -> 1.1 + E'EnumNumber'NumMinus_1_Dot_2 -> -1.2 + +-- | parse 'E'EnumNumber' enum +toE'EnumNumber :: Double -> P.Either String E'EnumNumber +toE'EnumNumber = \case + 1.1 -> P.Right E'EnumNumber'Num1_Dot_1 + -1.2 -> P.Right E'EnumNumber'NumMinus_1_Dot_2 + s -> P.Left $ "toE'EnumNumber: enum parse failure: " P.++ P.show s --- ** E'JustSymbol - --- | Enum of 'Text' -data E'JustSymbol - = E'JustSymbol'Greater_Than_Or_Equal_To -- ^ @">="@ - | E'JustSymbol'Dollar -- ^ @"$"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'JustSymbol where toJSON = A.toJSON . fromE'JustSymbol -instance A.FromJSON E'JustSymbol where parseJSON o = P.either P.fail (pure . P.id) . toE'JustSymbol =<< A.parseJSON o -instance WH.ToHttpApiData E'JustSymbol where toQueryParam = WH.toQueryParam . fromE'JustSymbol -instance WH.FromHttpApiData E'JustSymbol where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'JustSymbol -instance MimeRender MimeMultipartFormData E'JustSymbol where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'JustSymbol' enum -fromE'JustSymbol :: E'JustSymbol -> Text -fromE'JustSymbol = \case - E'JustSymbol'Greater_Than_Or_Equal_To -> ">=" - E'JustSymbol'Dollar -> "$" - --- | parse 'E'JustSymbol' enum -toE'JustSymbol :: Text -> P.Either String E'JustSymbol -toE'JustSymbol = \case - ">=" -> P.Right E'JustSymbol'Greater_Than_Or_Equal_To - "$" -> P.Right E'JustSymbol'Dollar - s -> P.Left $ "toE'JustSymbol: enum parse failure: " P.++ P.show s - + +-- ** E'EnumQueryInteger + +-- | Enum of 'Int' +data E'EnumQueryInteger + = E'EnumQueryInteger'Num1 -- ^ @1@ + | E'EnumQueryInteger'NumMinus_2 -- ^ @-2@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'EnumQueryInteger where toJSON = A.toJSON . fromE'EnumQueryInteger +instance A.FromJSON E'EnumQueryInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumQueryInteger =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumQueryInteger where toQueryParam = WH.toQueryParam . fromE'EnumQueryInteger +instance WH.FromHttpApiData E'EnumQueryInteger where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumQueryInteger +instance MimeRender MimeMultipartFormData E'EnumQueryInteger where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'EnumQueryInteger' enum +fromE'EnumQueryInteger :: E'EnumQueryInteger -> Int +fromE'EnumQueryInteger = \case + E'EnumQueryInteger'Num1 -> 1 + E'EnumQueryInteger'NumMinus_2 -> -2 + +-- | parse 'E'EnumQueryInteger' enum +toE'EnumQueryInteger :: Int -> P.Either String E'EnumQueryInteger +toE'EnumQueryInteger = \case + 1 -> P.Right E'EnumQueryInteger'Num1 + -2 -> P.Right E'EnumQueryInteger'NumMinus_2 + s -> P.Left $ "toE'EnumQueryInteger: enum parse failure: " P.++ P.show s --- ** E'Status - --- | Enum of 'Text' . --- Order Status -data E'Status - = E'Status'Placed -- ^ @"placed"@ - | E'Status'Approved -- ^ @"approved"@ - | E'Status'Delivered -- ^ @"delivered"@ + +-- ** E'EnumString + +-- | Enum of 'Text' +data E'EnumString + = E'EnumString'UPPER -- ^ @"UPPER"@ + | E'EnumString'Lower -- ^ @"lower"@ + | E'EnumString'Empty -- ^ @""@ deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) -instance A.ToJSON E'Status where toJSON = A.toJSON . fromE'Status -instance A.FromJSON E'Status where parseJSON o = P.either P.fail (pure . P.id) . toE'Status =<< A.parseJSON o -instance WH.ToHttpApiData E'Status where toQueryParam = WH.toQueryParam . fromE'Status -instance WH.FromHttpApiData E'Status where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Status -instance MimeRender MimeMultipartFormData E'Status where mimeRender _ = mimeRenderDefaultMultipartFormData +instance A.ToJSON E'EnumString where toJSON = A.toJSON . fromE'EnumString +instance A.FromJSON E'EnumString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumString =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumString where toQueryParam = WH.toQueryParam . fromE'EnumString +instance WH.FromHttpApiData E'EnumString where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumString +instance MimeRender MimeMultipartFormData E'EnumString where mimeRender _ = mimeRenderDefaultMultipartFormData --- | unwrap 'E'Status' enum -fromE'Status :: E'Status -> Text -fromE'Status = \case - E'Status'Placed -> "placed" - E'Status'Approved -> "approved" - E'Status'Delivered -> "delivered" +-- | unwrap 'E'EnumString' enum +fromE'EnumString :: E'EnumString -> Text +fromE'EnumString = \case + E'EnumString'UPPER -> "UPPER" + E'EnumString'Lower -> "lower" + E'EnumString'Empty -> "" --- | parse 'E'Status' enum -toE'Status :: Text -> P.Either String E'Status -toE'Status = \case - "placed" -> P.Right E'Status'Placed - "approved" -> P.Right E'Status'Approved - "delivered" -> P.Right E'Status'Delivered - s -> P.Left $ "toE'Status: enum parse failure: " P.++ P.show s +-- | parse 'E'EnumString' enum +toE'EnumString :: Text -> P.Either String E'EnumString +toE'EnumString = \case + "UPPER" -> P.Right E'EnumString'UPPER + "lower" -> P.Right E'EnumString'Lower + "" -> P.Right E'EnumString'Empty + s -> P.Left $ "toE'EnumString: enum parse failure: " P.++ P.show s --- ** E'Status2 +-- ** E'Inner --- | Enum of 'Text' . --- pet status in the store -data E'Status2 - = E'Status2'Available -- ^ @"available"@ - | E'Status2'Pending -- ^ @"pending"@ - | E'Status2'Sold -- ^ @"sold"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON E'Status2 where toJSON = A.toJSON . fromE'Status2 -instance A.FromJSON E'Status2 where parseJSON o = P.either P.fail (pure . P.id) . toE'Status2 =<< A.parseJSON o -instance WH.ToHttpApiData E'Status2 where toQueryParam = WH.toQueryParam . fromE'Status2 -instance WH.FromHttpApiData E'Status2 where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Status2 -instance MimeRender MimeMultipartFormData E'Status2 where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'E'Status2' enum -fromE'Status2 :: E'Status2 -> Text -fromE'Status2 = \case - E'Status2'Available -> "available" - E'Status2'Pending -> "pending" - E'Status2'Sold -> "sold" - --- | parse 'E'Status2' enum -toE'Status2 :: Text -> P.Either String E'Status2 -toE'Status2 = \case - "available" -> P.Right E'Status2'Available - "pending" -> P.Right E'Status2'Pending - "sold" -> P.Right E'Status2'Sold - s -> P.Left $ "toE'Status2: enum parse failure: " P.++ P.show s - - --- ** EnumClass - --- | Enum of 'Text' -data EnumClass - = EnumClass'_abc -- ^ @"_abc"@ - | EnumClass'_efg -- ^ @"-efg"@ - | EnumClass'_xyz -- ^ @"(xyz)"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON EnumClass where toJSON = A.toJSON . fromEnumClass -instance A.FromJSON EnumClass where parseJSON o = P.either P.fail (pure . P.id) . toEnumClass =<< A.parseJSON o -instance WH.ToHttpApiData EnumClass where toQueryParam = WH.toQueryParam . fromEnumClass -instance WH.FromHttpApiData EnumClass where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toEnumClass -instance MimeRender MimeMultipartFormData EnumClass where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'EnumClass' enum -fromEnumClass :: EnumClass -> Text -fromEnumClass = \case - EnumClass'_abc -> "_abc" - EnumClass'_efg -> "-efg" - EnumClass'_xyz -> "(xyz)" - --- | parse 'EnumClass' enum -toEnumClass :: Text -> P.Either String EnumClass -toEnumClass = \case - "_abc" -> P.Right EnumClass'_abc - "-efg" -> P.Right EnumClass'_efg - "(xyz)" -> P.Right EnumClass'_xyz - s -> P.Left $ "toEnumClass: enum parse failure: " P.++ P.show s - - --- ** OuterEnum - --- | Enum of 'Text' -data OuterEnum - = OuterEnum'Placed -- ^ @"placed"@ - | OuterEnum'Approved -- ^ @"approved"@ - | OuterEnum'Delivered -- ^ @"delivered"@ - deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) - -instance A.ToJSON OuterEnum where toJSON = A.toJSON . fromOuterEnum -instance A.FromJSON OuterEnum where parseJSON o = P.either P.fail (pure . P.id) . toOuterEnum =<< A.parseJSON o -instance WH.ToHttpApiData OuterEnum where toQueryParam = WH.toQueryParam . fromOuterEnum -instance WH.FromHttpApiData OuterEnum where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toOuterEnum -instance MimeRender MimeMultipartFormData OuterEnum where mimeRender _ = mimeRenderDefaultMultipartFormData - --- | unwrap 'OuterEnum' enum -fromOuterEnum :: OuterEnum -> Text -fromOuterEnum = \case - OuterEnum'Placed -> "placed" - OuterEnum'Approved -> "approved" - OuterEnum'Delivered -> "delivered" - --- | parse 'OuterEnum' enum -toOuterEnum :: Text -> P.Either String OuterEnum -toOuterEnum = \case - "placed" -> P.Right OuterEnum'Placed - "approved" -> P.Right OuterEnum'Approved - "delivered" -> P.Right OuterEnum'Delivered - s -> P.Left $ "toOuterEnum: enum parse failure: " P.++ P.show s - \ No newline at end of file +-- | Enum of 'Text' +data E'Inner + = E'Inner'UPPER -- ^ @"UPPER"@ + | E'Inner'Lower -- ^ @"lower"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'Inner where toJSON = A.toJSON . fromE'Inner +instance A.FromJSON E'Inner where parseJSON o = P.either P.fail (pure . P.id) . toE'Inner =<< A.parseJSON o +instance WH.ToHttpApiData E'Inner where toQueryParam = WH.toQueryParam . fromE'Inner +instance WH.FromHttpApiData E'Inner where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Inner +instance MimeRender MimeMultipartFormData E'Inner where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'Inner' enum +fromE'Inner :: E'Inner -> Text +fromE'Inner = \case + E'Inner'UPPER -> "UPPER" + E'Inner'Lower -> "lower" + +-- | parse 'E'Inner' enum +toE'Inner :: Text -> P.Either String E'Inner +toE'Inner = \case + "UPPER" -> P.Right E'Inner'UPPER + "lower" -> P.Right E'Inner'Lower + s -> P.Left $ "toE'Inner: enum parse failure: " P.++ P.show s + + +-- ** E'Inner2 + +-- | Enum of 'Text' +data E'Inner2 + = E'Inner2'GreaterThan -- ^ @">"@ + | E'Inner2'Dollar -- ^ @"$"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'Inner2 where toJSON = A.toJSON . fromE'Inner2 +instance A.FromJSON E'Inner2 where parseJSON o = P.either P.fail (pure . P.id) . toE'Inner2 =<< A.parseJSON o +instance WH.ToHttpApiData E'Inner2 where toQueryParam = WH.toQueryParam . fromE'Inner2 +instance WH.FromHttpApiData E'Inner2 where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Inner2 +instance MimeRender MimeMultipartFormData E'Inner2 where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'Inner2' enum +fromE'Inner2 :: E'Inner2 -> Text +fromE'Inner2 = \case + E'Inner2'GreaterThan -> ">" + E'Inner2'Dollar -> "$" + +-- | parse 'E'Inner2' enum +toE'Inner2 :: Text -> P.Either String E'Inner2 +toE'Inner2 = \case + ">" -> P.Right E'Inner2'GreaterThan + "$" -> P.Right E'Inner2'Dollar + s -> P.Left $ "toE'Inner2: enum parse failure: " P.++ P.show s + + +-- ** E'JustSymbol + +-- | Enum of 'Text' +data E'JustSymbol + = E'JustSymbol'Greater_Than_Or_Equal_To -- ^ @">="@ + | E'JustSymbol'Dollar -- ^ @"$"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'JustSymbol where toJSON = A.toJSON . fromE'JustSymbol +instance A.FromJSON E'JustSymbol where parseJSON o = P.either P.fail (pure . P.id) . toE'JustSymbol =<< A.parseJSON o +instance WH.ToHttpApiData E'JustSymbol where toQueryParam = WH.toQueryParam . fromE'JustSymbol +instance WH.FromHttpApiData E'JustSymbol where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'JustSymbol +instance MimeRender MimeMultipartFormData E'JustSymbol where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'JustSymbol' enum +fromE'JustSymbol :: E'JustSymbol -> Text +fromE'JustSymbol = \case + E'JustSymbol'Greater_Than_Or_Equal_To -> ">=" + E'JustSymbol'Dollar -> "$" + +-- | parse 'E'JustSymbol' enum +toE'JustSymbol :: Text -> P.Either String E'JustSymbol +toE'JustSymbol = \case + ">=" -> P.Right E'JustSymbol'Greater_Than_Or_Equal_To + "$" -> P.Right E'JustSymbol'Dollar + s -> P.Left $ "toE'JustSymbol: enum parse failure: " P.++ P.show s + + +-- ** E'Status + +-- | Enum of 'Text' . +-- Order Status +data E'Status + = E'Status'Placed -- ^ @"placed"@ + | E'Status'Approved -- ^ @"approved"@ + | E'Status'Delivered -- ^ @"delivered"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'Status where toJSON = A.toJSON . fromE'Status +instance A.FromJSON E'Status where parseJSON o = P.either P.fail (pure . P.id) . toE'Status =<< A.parseJSON o +instance WH.ToHttpApiData E'Status where toQueryParam = WH.toQueryParam . fromE'Status +instance WH.FromHttpApiData E'Status where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Status +instance MimeRender MimeMultipartFormData E'Status where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'Status' enum +fromE'Status :: E'Status -> Text +fromE'Status = \case + E'Status'Placed -> "placed" + E'Status'Approved -> "approved" + E'Status'Delivered -> "delivered" + +-- | parse 'E'Status' enum +toE'Status :: Text -> P.Either String E'Status +toE'Status = \case + "placed" -> P.Right E'Status'Placed + "approved" -> P.Right E'Status'Approved + "delivered" -> P.Right E'Status'Delivered + s -> P.Left $ "toE'Status: enum parse failure: " P.++ P.show s + + +-- ** E'Status2 + +-- | Enum of 'Text' . +-- pet status in the store +data E'Status2 + = E'Status2'Available -- ^ @"available"@ + | E'Status2'Pending -- ^ @"pending"@ + | E'Status2'Sold -- ^ @"sold"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'Status2 where toJSON = A.toJSON . fromE'Status2 +instance A.FromJSON E'Status2 where parseJSON o = P.either P.fail (pure . P.id) . toE'Status2 =<< A.parseJSON o +instance WH.ToHttpApiData E'Status2 where toQueryParam = WH.toQueryParam . fromE'Status2 +instance WH.FromHttpApiData E'Status2 where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Status2 +instance MimeRender MimeMultipartFormData E'Status2 where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'Status2' enum +fromE'Status2 :: E'Status2 -> Text +fromE'Status2 = \case + E'Status2'Available -> "available" + E'Status2'Pending -> "pending" + E'Status2'Sold -> "sold" + +-- | parse 'E'Status2' enum +toE'Status2 :: Text -> P.Either String E'Status2 +toE'Status2 = \case + "available" -> P.Right E'Status2'Available + "pending" -> P.Right E'Status2'Pending + "sold" -> P.Right E'Status2'Sold + s -> P.Left $ "toE'Status2: enum parse failure: " P.++ P.show s + + +-- ** EnumClass + +-- | Enum of 'Text' +data EnumClass + = EnumClass'_abc -- ^ @"_abc"@ + | EnumClass'_efg -- ^ @"-efg"@ + | EnumClass'_xyz -- ^ @"(xyz)"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON EnumClass where toJSON = A.toJSON . fromEnumClass +instance A.FromJSON EnumClass where parseJSON o = P.either P.fail (pure . P.id) . toEnumClass =<< A.parseJSON o +instance WH.ToHttpApiData EnumClass where toQueryParam = WH.toQueryParam . fromEnumClass +instance WH.FromHttpApiData EnumClass where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toEnumClass +instance MimeRender MimeMultipartFormData EnumClass where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'EnumClass' enum +fromEnumClass :: EnumClass -> Text +fromEnumClass = \case + EnumClass'_abc -> "_abc" + EnumClass'_efg -> "-efg" + EnumClass'_xyz -> "(xyz)" + +-- | parse 'EnumClass' enum +toEnumClass :: Text -> P.Either String EnumClass +toEnumClass = \case + "_abc" -> P.Right EnumClass'_abc + "-efg" -> P.Right EnumClass'_efg + "(xyz)" -> P.Right EnumClass'_xyz + s -> P.Left $ "toEnumClass: enum parse failure: " P.++ P.show s + + +-- ** OuterEnum + +-- | Enum of 'Text' +data OuterEnum + = OuterEnum'Placed -- ^ @"placed"@ + | OuterEnum'Approved -- ^ @"approved"@ + | OuterEnum'Delivered -- ^ @"delivered"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON OuterEnum where toJSON = A.toJSON . fromOuterEnum +instance A.FromJSON OuterEnum where parseJSON o = P.either P.fail (pure . P.id) . toOuterEnum =<< A.parseJSON o +instance WH.ToHttpApiData OuterEnum where toQueryParam = WH.toQueryParam . fromOuterEnum +instance WH.FromHttpApiData OuterEnum where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toOuterEnum +instance MimeRender MimeMultipartFormData OuterEnum where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'OuterEnum' enum +fromOuterEnum :: OuterEnum -> Text +fromOuterEnum = \case + OuterEnum'Placed -> "placed" + OuterEnum'Approved -> "approved" + OuterEnum'Delivered -> "delivered" + +-- | parse 'OuterEnum' enum +toOuterEnum :: Text -> P.Either String OuterEnum +toOuterEnum = \case + "placed" -> P.Right OuterEnum'Placed + "approved" -> P.Right OuterEnum'Approved + "delivered" -> P.Right OuterEnum'Delivered + s -> P.Left $ "toOuterEnum: enum parse failure: " P.++ P.show s + + +-- * Auth Methods + +-- ** AuthApiKeyApiKey +data AuthApiKeyApiKey = + AuthApiKeyApiKey Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthApiKeyApiKey where + applyAuthMethod _ a@(AuthApiKeyApiKey secret) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("api_key", secret) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + +-- ** AuthApiKeyApiKeyQuery +data AuthApiKeyApiKeyQuery = + AuthApiKeyApiKeyQuery Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthApiKeyApiKeyQuery where + applyAuthMethod _ a@(AuthApiKeyApiKeyQuery secret) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setQuery` toQuery ("api_key_query", Just secret) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + +-- ** AuthBasicHttpBasicTest +data AuthBasicHttpBasicTest = + AuthBasicHttpBasicTest B.ByteString B.ByteString -- ^ username password + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthBasicHttpBasicTest where + applyAuthMethod _ a@(AuthBasicHttpBasicTest user pw) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ]) + +-- ** AuthOAuthPetstoreAuth +data AuthOAuthPetstoreAuth = + AuthOAuthPetstoreAuth Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthOAuthPetstoreAuth where + applyAuthMethod _ a@(AuthOAuthPetstoreAuth secret) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + + \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.ModelLens.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.ModelLens.html index 90082a8a82a..23322d2979d 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.ModelLens.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.ModelLens.html @@ -41,12 +41,12 @@ -- | 'additionalPropertiesClassMapProperty' Lens additionalPropertiesClassMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text)) -additionalPropertiesClassMapPropertyL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapProperty -> AdditionalPropertiesClass { additionalPropertiesClassMapProperty, ..} ) <$> f additionalPropertiesClassMapProperty +additionalPropertiesClassMapPropertyL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapProperty -> AdditionalPropertiesClass { additionalPropertiesClassMapProperty, ..} ) <$> f additionalPropertiesClassMapProperty {-# INLINE additionalPropertiesClassMapPropertyL #-} -- | 'additionalPropertiesClassMapOfMapProperty' Lens additionalPropertiesClassMapOfMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String (Map.Map String Text))) -additionalPropertiesClassMapOfMapPropertyL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapOfMapProperty -> AdditionalPropertiesClass { additionalPropertiesClassMapOfMapProperty, ..} ) <$> f additionalPropertiesClassMapOfMapProperty +additionalPropertiesClassMapOfMapPropertyL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapOfMapProperty -> AdditionalPropertiesClass { additionalPropertiesClassMapOfMapProperty, ..} ) <$> f additionalPropertiesClassMapOfMapProperty {-# INLINE additionalPropertiesClassMapOfMapPropertyL #-} @@ -55,12 +55,12 @@ -- | 'animalClassName' Lens animalClassNameL :: Lens_' Animal (Text) -animalClassNameL f Animal{..} = (\animalClassName -> Animal { animalClassName, ..} ) <$> f animalClassName +animalClassNameL f Animal{..} = (\animalClassName -> Animal { animalClassName, ..} ) <$> f animalClassName {-# INLINE animalClassNameL #-} -- | 'animalColor' Lens animalColorL :: Lens_' Animal (Maybe Text) -animalColorL f Animal{..} = (\animalColor -> Animal { animalColor, ..} ) <$> f animalColor +animalColorL f Animal{..} = (\animalColor -> Animal { animalColor, ..} ) <$> f animalColor {-# INLINE animalColorL #-} @@ -73,17 +73,17 @@ -- | 'apiResponseCode' Lens apiResponseCodeL :: Lens_' ApiResponse (Maybe Int) -apiResponseCodeL f ApiResponse{..} = (\apiResponseCode -> ApiResponse { apiResponseCode, ..} ) <$> f apiResponseCode +apiResponseCodeL f ApiResponse{..} = (\apiResponseCode -> ApiResponse { apiResponseCode, ..} ) <$> f apiResponseCode {-# INLINE apiResponseCodeL #-} -- | 'apiResponseType' Lens apiResponseTypeL :: Lens_' ApiResponse (Maybe Text) -apiResponseTypeL f ApiResponse{..} = (\apiResponseType -> ApiResponse { apiResponseType, ..} ) <$> f apiResponseType +apiResponseTypeL f ApiResponse{..} = (\apiResponseType -> ApiResponse { apiResponseType, ..} ) <$> f apiResponseType {-# INLINE apiResponseTypeL #-} -- | 'apiResponseMessage' Lens apiResponseMessageL :: Lens_' ApiResponse (Maybe Text) -apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage +apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage {-# INLINE apiResponseMessageL #-} @@ -92,7 +92,7 @@ -- | 'arrayOfArrayOfNumberOnlyArrayArrayNumber' Lens arrayOfArrayOfNumberOnlyArrayArrayNumberL :: Lens_' ArrayOfArrayOfNumberOnly (Maybe [[Double]]) -arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber +arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber {-# INLINE arrayOfArrayOfNumberOnlyArrayArrayNumberL #-} @@ -101,7 +101,7 @@ -- | 'arrayOfNumberOnlyArrayNumber' Lens arrayOfNumberOnlyArrayNumberL :: Lens_' ArrayOfNumberOnly (Maybe [Double]) -arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber +arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber {-# INLINE arrayOfNumberOnlyArrayNumberL #-} @@ -110,17 +110,17 @@ -- | 'arrayTestArrayOfString' Lens arrayTestArrayOfStringL :: Lens_' ArrayTest (Maybe [Text]) -arrayTestArrayOfStringL f ArrayTest{..} = (\arrayTestArrayOfString -> ArrayTest { arrayTestArrayOfString, ..} ) <$> f arrayTestArrayOfString +arrayTestArrayOfStringL f ArrayTest{..} = (\arrayTestArrayOfString -> ArrayTest { arrayTestArrayOfString, ..} ) <$> f arrayTestArrayOfString {-# INLINE arrayTestArrayOfStringL #-} -- | 'arrayTestArrayArrayOfInteger' Lens arrayTestArrayArrayOfIntegerL :: Lens_' ArrayTest (Maybe [[Integer]]) -arrayTestArrayArrayOfIntegerL f ArrayTest{..} = (\arrayTestArrayArrayOfInteger -> ArrayTest { arrayTestArrayArrayOfInteger, ..} ) <$> f arrayTestArrayArrayOfInteger +arrayTestArrayArrayOfIntegerL f ArrayTest{..} = (\arrayTestArrayArrayOfInteger -> ArrayTest { arrayTestArrayArrayOfInteger, ..} ) <$> f arrayTestArrayArrayOfInteger {-# INLINE arrayTestArrayArrayOfIntegerL #-} -- | 'arrayTestArrayArrayOfModel' Lens arrayTestArrayArrayOfModelL :: Lens_' ArrayTest (Maybe [[ReadOnlyFirst]]) -arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> ArrayTest { arrayTestArrayArrayOfModel, ..} ) <$> f arrayTestArrayArrayOfModel +arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> ArrayTest { arrayTestArrayArrayOfModel, ..} ) <$> f arrayTestArrayArrayOfModel {-# INLINE arrayTestArrayArrayOfModelL #-} @@ -129,32 +129,32 @@ -- | 'capitalizationSmallCamel' Lens capitalizationSmallCamelL :: Lens_' Capitalization (Maybe Text) -capitalizationSmallCamelL f Capitalization{..} = (\capitalizationSmallCamel -> Capitalization { capitalizationSmallCamel, ..} ) <$> f capitalizationSmallCamel +capitalizationSmallCamelL f Capitalization{..} = (\capitalizationSmallCamel -> Capitalization { capitalizationSmallCamel, ..} ) <$> f capitalizationSmallCamel {-# INLINE capitalizationSmallCamelL #-} -- | 'capitalizationCapitalCamel' Lens capitalizationCapitalCamelL :: Lens_' Capitalization (Maybe Text) -capitalizationCapitalCamelL f Capitalization{..} = (\capitalizationCapitalCamel -> Capitalization { capitalizationCapitalCamel, ..} ) <$> f capitalizationCapitalCamel +capitalizationCapitalCamelL f Capitalization{..} = (\capitalizationCapitalCamel -> Capitalization { capitalizationCapitalCamel, ..} ) <$> f capitalizationCapitalCamel {-# INLINE capitalizationCapitalCamelL #-} -- | 'capitalizationSmallSnake' Lens capitalizationSmallSnakeL :: Lens_' Capitalization (Maybe Text) -capitalizationSmallSnakeL f Capitalization{..} = (\capitalizationSmallSnake -> Capitalization { capitalizationSmallSnake, ..} ) <$> f capitalizationSmallSnake +capitalizationSmallSnakeL f Capitalization{..} = (\capitalizationSmallSnake -> Capitalization { capitalizationSmallSnake, ..} ) <$> f capitalizationSmallSnake {-# INLINE capitalizationSmallSnakeL #-} -- | 'capitalizationCapitalSnake' Lens capitalizationCapitalSnakeL :: Lens_' Capitalization (Maybe Text) -capitalizationCapitalSnakeL f Capitalization{..} = (\capitalizationCapitalSnake -> Capitalization { capitalizationCapitalSnake, ..} ) <$> f capitalizationCapitalSnake +capitalizationCapitalSnakeL f Capitalization{..} = (\capitalizationCapitalSnake -> Capitalization { capitalizationCapitalSnake, ..} ) <$> f capitalizationCapitalSnake {-# INLINE capitalizationCapitalSnakeL #-} -- | 'capitalizationScaEthFlowPoints' Lens capitalizationScaEthFlowPointsL :: Lens_' Capitalization (Maybe Text) -capitalizationScaEthFlowPointsL f Capitalization{..} = (\capitalizationScaEthFlowPoints -> Capitalization { capitalizationScaEthFlowPoints, ..} ) <$> f capitalizationScaEthFlowPoints +capitalizationScaEthFlowPointsL f Capitalization{..} = (\capitalizationScaEthFlowPoints -> Capitalization { capitalizationScaEthFlowPoints, ..} ) <$> f capitalizationScaEthFlowPoints {-# INLINE capitalizationScaEthFlowPointsL #-} -- | 'capitalizationAttName' Lens capitalizationAttNameL :: Lens_' Capitalization (Maybe Text) -capitalizationAttNameL f Capitalization{..} = (\capitalizationAttName -> Capitalization { capitalizationAttName, ..} ) <$> f capitalizationAttName +capitalizationAttNameL f Capitalization{..} = (\capitalizationAttName -> Capitalization { capitalizationAttName, ..} ) <$> f capitalizationAttName {-# INLINE capitalizationAttNameL #-} @@ -163,12 +163,12 @@ -- | 'categoryId' Lens categoryIdL :: Lens_' Category (Maybe Integer) -categoryIdL f Category{..} = (\categoryId -> Category { categoryId, ..} ) <$> f categoryId +categoryIdL f Category{..} = (\categoryId -> Category { categoryId, ..} ) <$> f categoryId {-# INLINE categoryIdL #-} -- | 'categoryName' Lens categoryNameL :: Lens_' Category (Maybe Text) -categoryNameL f Category{..} = (\categoryName -> Category { categoryName, ..} ) <$> f categoryName +categoryNameL f Category{..} = (\categoryName -> Category { categoryName, ..} ) <$> f categoryName {-# INLINE categoryNameL #-} @@ -177,7 +177,7 @@ -- | 'classModelClass' Lens classModelClassL :: Lens_' ClassModel (Maybe Text) -classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass +classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass {-# INLINE classModelClassL #-} @@ -186,7 +186,7 @@ -- | 'clientClient' Lens clientClientL :: Lens_' Client (Maybe Text) -clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient +clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient {-# INLINE clientClientL #-} @@ -195,12 +195,12 @@ -- | 'enumArraysJustSymbol' Lens enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe E'JustSymbol) -enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol +enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol {-# INLINE enumArraysJustSymbolL #-} -- | 'enumArraysArrayEnum' Lens enumArraysArrayEnumL :: Lens_' EnumArrays (Maybe [E'ArrayEnum]) -enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum +enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum {-# INLINE enumArraysArrayEnumL #-} @@ -213,22 +213,22 @@ -- | 'enumTestEnumString' Lens enumTestEnumStringL :: Lens_' EnumTest (Maybe E'EnumString) -enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString +enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString {-# INLINE enumTestEnumStringL #-} -- | 'enumTestEnumInteger' Lens enumTestEnumIntegerL :: Lens_' EnumTest (Maybe E'EnumInteger) -enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger +enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger {-# INLINE enumTestEnumIntegerL #-} -- | 'enumTestEnumNumber' Lens enumTestEnumNumberL :: Lens_' EnumTest (Maybe E'EnumNumber) -enumTestEnumNumberL f EnumTest{..} = (\enumTestEnumNumber -> EnumTest { enumTestEnumNumber, ..} ) <$> f enumTestEnumNumber +enumTestEnumNumberL f EnumTest{..} = (\enumTestEnumNumber -> EnumTest { enumTestEnumNumber, ..} ) <$> f enumTestEnumNumber {-# INLINE enumTestEnumNumberL #-} -- | 'enumTestOuterEnum' Lens enumTestOuterEnumL :: Lens_' EnumTest (Maybe OuterEnum) -enumTestOuterEnumL f EnumTest{..} = (\enumTestOuterEnum -> EnumTest { enumTestOuterEnum, ..} ) <$> f enumTestOuterEnum +enumTestOuterEnumL f EnumTest{..} = (\enumTestOuterEnum -> EnumTest { enumTestOuterEnum, ..} ) <$> f enumTestOuterEnum {-# INLINE enumTestOuterEnumL #-} @@ -237,67 +237,67 @@ -- | 'formatTestInteger' Lens formatTestIntegerL :: Lens_' FormatTest (Maybe Int) -formatTestIntegerL f FormatTest{..} = (\formatTestInteger -> FormatTest { formatTestInteger, ..} ) <$> f formatTestInteger +formatTestIntegerL f FormatTest{..} = (\formatTestInteger -> FormatTest { formatTestInteger, ..} ) <$> f formatTestInteger {-# INLINE formatTestIntegerL #-} -- | 'formatTestInt32' Lens formatTestInt32L :: Lens_' FormatTest (Maybe Int) -formatTestInt32L f FormatTest{..} = (\formatTestInt32 -> FormatTest { formatTestInt32, ..} ) <$> f formatTestInt32 +formatTestInt32L f FormatTest{..} = (\formatTestInt32 -> FormatTest { formatTestInt32, ..} ) <$> f formatTestInt32 {-# INLINE formatTestInt32L #-} -- | 'formatTestInt64' Lens formatTestInt64L :: Lens_' FormatTest (Maybe Integer) -formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64 +formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64 {-# INLINE formatTestInt64L #-} -- | 'formatTestNumber' Lens formatTestNumberL :: Lens_' FormatTest (Double) -formatTestNumberL f FormatTest{..} = (\formatTestNumber -> FormatTest { formatTestNumber, ..} ) <$> f formatTestNumber +formatTestNumberL f FormatTest{..} = (\formatTestNumber -> FormatTest { formatTestNumber, ..} ) <$> f formatTestNumber {-# INLINE formatTestNumberL #-} -- | 'formatTestFloat' Lens formatTestFloatL :: Lens_' FormatTest (Maybe Float) -formatTestFloatL f FormatTest{..} = (\formatTestFloat -> FormatTest { formatTestFloat, ..} ) <$> f formatTestFloat +formatTestFloatL f FormatTest{..} = (\formatTestFloat -> FormatTest { formatTestFloat, ..} ) <$> f formatTestFloat {-# INLINE formatTestFloatL #-} -- | 'formatTestDouble' Lens formatTestDoubleL :: Lens_' FormatTest (Maybe Double) -formatTestDoubleL f FormatTest{..} = (\formatTestDouble -> FormatTest { formatTestDouble, ..} ) <$> f formatTestDouble +formatTestDoubleL f FormatTest{..} = (\formatTestDouble -> FormatTest { formatTestDouble, ..} ) <$> f formatTestDouble {-# INLINE formatTestDoubleL #-} -- | 'formatTestString' Lens formatTestStringL :: Lens_' FormatTest (Maybe Text) -formatTestStringL f FormatTest{..} = (\formatTestString -> FormatTest { formatTestString, ..} ) <$> f formatTestString +formatTestStringL f FormatTest{..} = (\formatTestString -> FormatTest { formatTestString, ..} ) <$> f formatTestString {-# INLINE formatTestStringL #-} -- | 'formatTestByte' Lens formatTestByteL :: Lens_' FormatTest (ByteArray) -formatTestByteL f FormatTest{..} = (\formatTestByte -> FormatTest { formatTestByte, ..} ) <$> f formatTestByte +formatTestByteL f FormatTest{..} = (\formatTestByte -> FormatTest { formatTestByte, ..} ) <$> f formatTestByte {-# INLINE formatTestByteL #-} -- | 'formatTestBinary' Lens formatTestBinaryL :: Lens_' FormatTest (Maybe Binary) -formatTestBinaryL f FormatTest{..} = (\formatTestBinary -> FormatTest { formatTestBinary, ..} ) <$> f formatTestBinary +formatTestBinaryL f FormatTest{..} = (\formatTestBinary -> FormatTest { formatTestBinary, ..} ) <$> f formatTestBinary {-# INLINE formatTestBinaryL #-} -- | 'formatTestDate' Lens formatTestDateL :: Lens_' FormatTest (Date) -formatTestDateL f FormatTest{..} = (\formatTestDate -> FormatTest { formatTestDate, ..} ) <$> f formatTestDate +formatTestDateL f FormatTest{..} = (\formatTestDate -> FormatTest { formatTestDate, ..} ) <$> f formatTestDate {-# INLINE formatTestDateL #-} -- | 'formatTestDateTime' Lens formatTestDateTimeL :: Lens_' FormatTest (Maybe DateTime) -formatTestDateTimeL f FormatTest{..} = (\formatTestDateTime -> FormatTest { formatTestDateTime, ..} ) <$> f formatTestDateTime +formatTestDateTimeL f FormatTest{..} = (\formatTestDateTime -> FormatTest { formatTestDateTime, ..} ) <$> f formatTestDateTime {-# INLINE formatTestDateTimeL #-} -- | 'formatTestUuid' Lens formatTestUuidL :: Lens_' FormatTest (Maybe Text) -formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid +formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid {-# INLINE formatTestUuidL #-} -- | 'formatTestPassword' Lens formatTestPasswordL :: Lens_' FormatTest (Text) -formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword +formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword {-# INLINE formatTestPasswordL #-} @@ -306,12 +306,12 @@ -- | 'hasOnlyReadOnlyBar' Lens hasOnlyReadOnlyBarL :: Lens_' HasOnlyReadOnly (Maybe Text) -hasOnlyReadOnlyBarL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyBar -> HasOnlyReadOnly { hasOnlyReadOnlyBar, ..} ) <$> f hasOnlyReadOnlyBar +hasOnlyReadOnlyBarL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyBar -> HasOnlyReadOnly { hasOnlyReadOnlyBar, ..} ) <$> f hasOnlyReadOnlyBar {-# INLINE hasOnlyReadOnlyBarL #-} -- | 'hasOnlyReadOnlyFoo' Lens hasOnlyReadOnlyFooL :: Lens_' HasOnlyReadOnly (Maybe Text) -hasOnlyReadOnlyFooL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyFoo -> HasOnlyReadOnly { hasOnlyReadOnlyFoo, ..} ) <$> f hasOnlyReadOnlyFoo +hasOnlyReadOnlyFooL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyFoo -> HasOnlyReadOnly { hasOnlyReadOnlyFoo, ..} ) <$> f hasOnlyReadOnlyFoo {-# INLINE hasOnlyReadOnlyFooL #-} @@ -320,12 +320,12 @@ -- | 'mapTestMapMapOfString' Lens mapTestMapMapOfStringL :: Lens_' MapTest (Maybe (Map.Map String (Map.Map String Text))) -mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString +mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString {-# INLINE mapTestMapMapOfStringL #-} -- | 'mapTestMapOfEnumString' Lens mapTestMapOfEnumStringL :: Lens_' MapTest (Maybe (Map.Map String E'Inner)) -mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString +mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString {-# INLINE mapTestMapOfEnumStringL #-} @@ -334,17 +334,17 @@ -- | 'mixedPropertiesAndAdditionalPropertiesClassUuid' Lens mixedPropertiesAndAdditionalPropertiesClassUuidL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe Text) -mixedPropertiesAndAdditionalPropertiesClassUuidL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassUuid -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassUuid, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassUuid +mixedPropertiesAndAdditionalPropertiesClassUuidL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassUuid -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassUuid, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassUuid {-# INLINE mixedPropertiesAndAdditionalPropertiesClassUuidL #-} -- | 'mixedPropertiesAndAdditionalPropertiesClassDateTime' Lens mixedPropertiesAndAdditionalPropertiesClassDateTimeL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe DateTime) -mixedPropertiesAndAdditionalPropertiesClassDateTimeL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassDateTime -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassDateTime, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassDateTime +mixedPropertiesAndAdditionalPropertiesClassDateTimeL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassDateTime -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassDateTime, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassDateTime {-# INLINE mixedPropertiesAndAdditionalPropertiesClassDateTimeL #-} -- | 'mixedPropertiesAndAdditionalPropertiesClassMap' Lens mixedPropertiesAndAdditionalPropertiesClassMapL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe (Map.Map String Animal)) -mixedPropertiesAndAdditionalPropertiesClassMapL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassMap -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassMap, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassMap +mixedPropertiesAndAdditionalPropertiesClassMapL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassMap -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassMap, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassMap {-# INLINE mixedPropertiesAndAdditionalPropertiesClassMapL #-} @@ -353,12 +353,12 @@ -- | 'model200ResponseName' Lens model200ResponseNameL :: Lens_' Model200Response (Maybe Int) -model200ResponseNameL f Model200Response{..} = (\model200ResponseName -> Model200Response { model200ResponseName, ..} ) <$> f model200ResponseName +model200ResponseNameL f Model200Response{..} = (\model200ResponseName -> Model200Response { model200ResponseName, ..} ) <$> f model200ResponseName {-# INLINE model200ResponseNameL #-} -- | 'model200ResponseClass' Lens model200ResponseClassL :: Lens_' Model200Response (Maybe Text) -model200ResponseClassL f Model200Response{..} = (\model200ResponseClass -> Model200Response { model200ResponseClass, ..} ) <$> f model200ResponseClass +model200ResponseClassL f Model200Response{..} = (\model200ResponseClass -> Model200Response { model200ResponseClass, ..} ) <$> f model200ResponseClass {-# INLINE model200ResponseClassL #-} @@ -367,7 +367,7 @@ -- | 'modelList123List' Lens modelList123ListL :: Lens_' ModelList (Maybe Text) -modelList123ListL f ModelList{..} = (\modelList123List -> ModelList { modelList123List, ..} ) <$> f modelList123List +modelList123ListL f ModelList{..} = (\modelList123List -> ModelList { modelList123List, ..} ) <$> f modelList123List {-# INLINE modelList123ListL #-} @@ -376,7 +376,7 @@ -- | 'modelReturnReturn' Lens modelReturnReturnL :: Lens_' ModelReturn (Maybe Int) -modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn +modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn {-# INLINE modelReturnReturnL #-} @@ -385,22 +385,22 @@ -- | 'nameName' Lens nameNameL :: Lens_' Name (Int) -nameNameL f Name{..} = (\nameName -> Name { nameName, ..} ) <$> f nameName +nameNameL f Name{..} = (\nameName -> Name { nameName, ..} ) <$> f nameName {-# INLINE nameNameL #-} -- | 'nameSnakeCase' Lens nameSnakeCaseL :: Lens_' Name (Maybe Int) -nameSnakeCaseL f Name{..} = (\nameSnakeCase -> Name { nameSnakeCase, ..} ) <$> f nameSnakeCase +nameSnakeCaseL f Name{..} = (\nameSnakeCase -> Name { nameSnakeCase, ..} ) <$> f nameSnakeCase {-# INLINE nameSnakeCaseL #-} -- | 'nameProperty' Lens namePropertyL :: Lens_' Name (Maybe Text) -namePropertyL f Name{..} = (\nameProperty -> Name { nameProperty, ..} ) <$> f nameProperty +namePropertyL f Name{..} = (\nameProperty -> Name { nameProperty, ..} ) <$> f nameProperty {-# INLINE namePropertyL #-} -- | 'name123Number' Lens name123NumberL :: Lens_' Name (Maybe Int) -name123NumberL f Name{..} = (\name123Number -> Name { name123Number, ..} ) <$> f name123Number +name123NumberL f Name{..} = (\name123Number -> Name { name123Number, ..} ) <$> f name123Number {-# INLINE name123NumberL #-} @@ -409,7 +409,7 @@ -- | 'numberOnlyJustNumber' Lens numberOnlyJustNumberL :: Lens_' NumberOnly (Maybe Double) -numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber +numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber {-# INLINE numberOnlyJustNumberL #-} @@ -418,32 +418,32 @@ -- | 'orderId' Lens orderIdL :: Lens_' Order (Maybe Integer) -orderIdL f Order{..} = (\orderId -> Order { orderId, ..} ) <$> f orderId +orderIdL f Order{..} = (\orderId -> Order { orderId, ..} ) <$> f orderId {-# INLINE orderIdL #-} -- | 'orderPetId' Lens orderPetIdL :: Lens_' Order (Maybe Integer) -orderPetIdL f Order{..} = (\orderPetId -> Order { orderPetId, ..} ) <$> f orderPetId +orderPetIdL f Order{..} = (\orderPetId -> Order { orderPetId, ..} ) <$> f orderPetId {-# INLINE orderPetIdL #-} -- | 'orderQuantity' Lens orderQuantityL :: Lens_' Order (Maybe Int) -orderQuantityL f Order{..} = (\orderQuantity -> Order { orderQuantity, ..} ) <$> f orderQuantity +orderQuantityL f Order{..} = (\orderQuantity -> Order { orderQuantity, ..} ) <$> f orderQuantity {-# INLINE orderQuantityL #-} -- | 'orderShipDate' Lens orderShipDateL :: Lens_' Order (Maybe DateTime) -orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate +orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate {-# INLINE orderShipDateL #-} -- | 'orderStatus' Lens orderStatusL :: Lens_' Order (Maybe E'Status) -orderStatusL f Order{..} = (\orderStatus -> Order { orderStatus, ..} ) <$> f orderStatus +orderStatusL f Order{..} = (\orderStatus -> Order { orderStatus, ..} ) <$> f orderStatus {-# INLINE orderStatusL #-} -- | 'orderComplete' Lens orderCompleteL :: Lens_' Order (Maybe Bool) -orderCompleteL f Order{..} = (\orderComplete -> Order { orderComplete, ..} ) <$> f orderComplete +orderCompleteL f Order{..} = (\orderComplete -> Order { orderComplete, ..} ) <$> f orderComplete {-# INLINE orderCompleteL #-} @@ -456,17 +456,17 @@ -- | 'outerCompositeMyNumber' Lens outerCompositeMyNumberL :: Lens_' OuterComposite (Maybe OuterNumber) -outerCompositeMyNumberL f OuterComposite{..} = (\outerCompositeMyNumber -> OuterComposite { outerCompositeMyNumber, ..} ) <$> f outerCompositeMyNumber +outerCompositeMyNumberL f OuterComposite{..} = (\outerCompositeMyNumber -> OuterComposite { outerCompositeMyNumber, ..} ) <$> f outerCompositeMyNumber {-# INLINE outerCompositeMyNumberL #-} -- | 'outerCompositeMyString' Lens outerCompositeMyStringL :: Lens_' OuterComposite (Maybe OuterString) -outerCompositeMyStringL f OuterComposite{..} = (\outerCompositeMyString -> OuterComposite { outerCompositeMyString, ..} ) <$> f outerCompositeMyString +outerCompositeMyStringL f OuterComposite{..} = (\outerCompositeMyString -> OuterComposite { outerCompositeMyString, ..} ) <$> f outerCompositeMyString {-# INLINE outerCompositeMyStringL #-} -- | 'outerCompositeMyBoolean' Lens outerCompositeMyBooleanL :: Lens_' OuterComposite (Maybe OuterBoolean) -outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean +outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean {-# INLINE outerCompositeMyBooleanL #-} @@ -487,32 +487,32 @@ -- | 'petId' Lens petIdL :: Lens_' Pet (Maybe Integer) -petIdL f Pet{..} = (\petId -> Pet { petId, ..} ) <$> f petId +petIdL f Pet{..} = (\petId -> Pet { petId, ..} ) <$> f petId {-# INLINE petIdL #-} -- | 'petCategory' Lens petCategoryL :: Lens_' Pet (Maybe Category) -petCategoryL f Pet{..} = (\petCategory -> Pet { petCategory, ..} ) <$> f petCategory +petCategoryL f Pet{..} = (\petCategory -> Pet { petCategory, ..} ) <$> f petCategory {-# INLINE petCategoryL #-} -- | 'petName' Lens petNameL :: Lens_' Pet (Text) -petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName +petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName {-# INLINE petNameL #-} -- | 'petPhotoUrls' Lens petPhotoUrlsL :: Lens_' Pet ([Text]) -petPhotoUrlsL f Pet{..} = (\petPhotoUrls -> Pet { petPhotoUrls, ..} ) <$> f petPhotoUrls +petPhotoUrlsL f Pet{..} = (\petPhotoUrls -> Pet { petPhotoUrls, ..} ) <$> f petPhotoUrls {-# INLINE petPhotoUrlsL #-} -- | 'petTags' Lens petTagsL :: Lens_' Pet (Maybe [Tag]) -petTagsL f Pet{..} = (\petTags -> Pet { petTags, ..} ) <$> f petTags +petTagsL f Pet{..} = (\petTags -> Pet { petTags, ..} ) <$> f petTags {-# INLINE petTagsL #-} -- | 'petStatus' Lens petStatusL :: Lens_' Pet (Maybe E'Status2) -petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus +petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus {-# INLINE petStatusL #-} @@ -521,12 +521,12 @@ -- | 'readOnlyFirstBar' Lens readOnlyFirstBarL :: Lens_' ReadOnlyFirst (Maybe Text) -readOnlyFirstBarL f ReadOnlyFirst{..} = (\readOnlyFirstBar -> ReadOnlyFirst { readOnlyFirstBar, ..} ) <$> f readOnlyFirstBar +readOnlyFirstBarL f ReadOnlyFirst{..} = (\readOnlyFirstBar -> ReadOnlyFirst { readOnlyFirstBar, ..} ) <$> f readOnlyFirstBar {-# INLINE readOnlyFirstBarL #-} -- | 'readOnlyFirstBaz' Lens readOnlyFirstBazL :: Lens_' ReadOnlyFirst (Maybe Text) -readOnlyFirstBazL f ReadOnlyFirst{..} = (\readOnlyFirstBaz -> ReadOnlyFirst { readOnlyFirstBaz, ..} ) <$> f readOnlyFirstBaz +readOnlyFirstBazL f ReadOnlyFirst{..} = (\readOnlyFirstBaz -> ReadOnlyFirst { readOnlyFirstBaz, ..} ) <$> f readOnlyFirstBaz {-# INLINE readOnlyFirstBazL #-} @@ -535,7 +535,7 @@ -- | 'specialModelNameSpecialPropertyName' Lens specialModelNameSpecialPropertyNameL :: Lens_' SpecialModelName (Maybe Integer) -specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName +specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName {-# INLINE specialModelNameSpecialPropertyNameL #-} @@ -544,12 +544,12 @@ -- | 'tagId' Lens tagIdL :: Lens_' Tag (Maybe Integer) -tagIdL f Tag{..} = (\tagId -> Tag { tagId, ..} ) <$> f tagId +tagIdL f Tag{..} = (\tagId -> Tag { tagId, ..} ) <$> f tagId {-# INLINE tagIdL #-} -- | 'tagName' Lens tagNameL :: Lens_' Tag (Maybe Text) -tagNameL f Tag{..} = (\tagName -> Tag { tagName, ..} ) <$> f tagName +tagNameL f Tag{..} = (\tagName -> Tag { tagName, ..} ) <$> f tagName {-# INLINE tagNameL #-} @@ -558,42 +558,42 @@ -- | 'userId' Lens userIdL :: Lens_' User (Maybe Integer) -userIdL f User{..} = (\userId -> User { userId, ..} ) <$> f userId +userIdL f User{..} = (\userId -> User { userId, ..} ) <$> f userId {-# INLINE userIdL #-} -- | 'userUsername' Lens userUsernameL :: Lens_' User (Maybe Text) -userUsernameL f User{..} = (\userUsername -> User { userUsername, ..} ) <$> f userUsername +userUsernameL f User{..} = (\userUsername -> User { userUsername, ..} ) <$> f userUsername {-# INLINE userUsernameL #-} -- | 'userFirstName' Lens userFirstNameL :: Lens_' User (Maybe Text) -userFirstNameL f User{..} = (\userFirstName -> User { userFirstName, ..} ) <$> f userFirstName +userFirstNameL f User{..} = (\userFirstName -> User { userFirstName, ..} ) <$> f userFirstName {-# INLINE userFirstNameL #-} -- | 'userLastName' Lens userLastNameL :: Lens_' User (Maybe Text) -userLastNameL f User{..} = (\userLastName -> User { userLastName, ..} ) <$> f userLastName +userLastNameL f User{..} = (\userLastName -> User { userLastName, ..} ) <$> f userLastName {-# INLINE userLastNameL #-} -- | 'userEmail' Lens userEmailL :: Lens_' User (Maybe Text) -userEmailL f User{..} = (\userEmail -> User { userEmail, ..} ) <$> f userEmail +userEmailL f User{..} = (\userEmail -> User { userEmail, ..} ) <$> f userEmail {-# INLINE userEmailL #-} -- | 'userPassword' Lens userPasswordL :: Lens_' User (Maybe Text) -userPasswordL f User{..} = (\userPassword -> User { userPassword, ..} ) <$> f userPassword +userPasswordL f User{..} = (\userPassword -> User { userPassword, ..} ) <$> f userPassword {-# INLINE userPasswordL #-} -- | 'userPhone' Lens userPhoneL :: Lens_' User (Maybe Text) -userPhoneL f User{..} = (\userPhone -> User { userPhone, ..} ) <$> f userPhone +userPhoneL f User{..} = (\userPhone -> User { userPhone, ..} ) <$> f userPhone {-# INLINE userPhoneL #-} -- | 'userUserStatus' Lens userUserStatusL :: Lens_' User (Maybe Int) -userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$> f userUserStatus +userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$> f userUserStatus {-# INLINE userUserStatusL #-} @@ -602,17 +602,17 @@ -- | 'catClassName' Lens catClassNameL :: Lens_' Cat (Text) -catClassNameL f Cat{..} = (\catClassName -> Cat { catClassName, ..} ) <$> f catClassName +catClassNameL f Cat{..} = (\catClassName -> Cat { catClassName, ..} ) <$> f catClassName {-# INLINE catClassNameL #-} -- | 'catColor' Lens catColorL :: Lens_' Cat (Maybe Text) -catColorL f Cat{..} = (\catColor -> Cat { catColor, ..} ) <$> f catColor +catColorL f Cat{..} = (\catColor -> Cat { catColor, ..} ) <$> f catColor {-# INLINE catColorL #-} -- | 'catDeclawed' Lens catDeclawedL :: Lens_' Cat (Maybe Bool) -catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed +catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed {-# INLINE catDeclawedL #-} @@ -621,17 +621,17 @@ -- | 'dogClassName' Lens dogClassNameL :: Lens_' Dog (Text) -dogClassNameL f Dog{..} = (\dogClassName -> Dog { dogClassName, ..} ) <$> f dogClassName +dogClassNameL f Dog{..} = (\dogClassName -> Dog { dogClassName, ..} ) <$> f dogClassName {-# INLINE dogClassNameL #-} -- | 'dogColor' Lens dogColorL :: Lens_' Dog (Maybe Text) -dogColorL f Dog{..} = (\dogColor -> Dog { dogColor, ..} ) <$> f dogColor +dogColorL f Dog{..} = (\dogColor -> Dog { dogColor, ..} ) <$> f dogColor {-# INLINE dogColorL #-} -- | 'dogBreed' Lens dogBreedL :: Lens_' Dog (Maybe Text) -dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed +dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed {-# INLINE dogBreedL #-} diff --git a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.html b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.html index 2233a4024a2..3aaf341c3b4 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.html +++ b/samples/client/petstore/haskell-http-client/docs/src/SwaggerPetstore.html @@ -14,7 +14,7 @@ -} module SwaggerPetstore - ( module SwaggerPetstore.API + ( module SwaggerPetstore.API , module SwaggerPetstore.Client , module SwaggerPetstore.Core , module SwaggerPetstore.Logging @@ -29,5 +29,4 @@ import SwaggerPetstore.Logging import SwaggerPetstore.MimeTypes import SwaggerPetstore.Model -import SwaggerPetstore.ModelLens - \ No newline at end of file +import SwaggerPetstore.ModelLens \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/swagger-petstore.txt b/samples/client/petstore/haskell-http-client/docs/swagger-petstore.txt index 213dba9bd2a..36e2174b57d 100644 --- a/samples/client/petstore/haskell-http-client/docs/swagger-petstore.txt +++ b/samples/client/petstore/haskell-http-client/docs/swagger-petstore.txt @@ -206,8 +206,24 @@ mimeUnrender' :: MimeUnrender mtype o => mtype -> ByteString -> Either String o -- |
 --   P.Right . P.const NoContent
 --   
+data MimeJsonCharsetutf8 +MimeJsonCharsetutf8 :: MimeJsonCharsetutf8 + +-- |
+--   application/json; charset=utf-8
+--   
+data MimeXmlCharsetutf8 +MimeXmlCharsetutf8 :: MimeXmlCharsetutf8 + +-- |
+--   application/xml; charset=utf-8
+--   
instance GHC.Classes.Eq SwaggerPetstore.MimeTypes.NoContent instance GHC.Show.Show SwaggerPetstore.MimeTypes.NoContent +instance SwaggerPetstore.MimeTypes.MimeType SwaggerPetstore.MimeTypes.MimeXmlCharsetutf8 +instance SwaggerPetstore.MimeTypes.MimeType SwaggerPetstore.MimeTypes.MimeJsonCharsetutf8 +instance Data.Aeson.Types.ToJSON.ToJSON a => SwaggerPetstore.MimeTypes.MimeRender SwaggerPetstore.MimeTypes.MimeJsonCharsetutf8 a +instance Data.Aeson.Types.FromJSON.FromJSON a => SwaggerPetstore.MimeTypes.MimeUnrender SwaggerPetstore.MimeTypes.MimeJsonCharsetutf8 a instance Data.Aeson.Types.FromJSON.FromJSON a => SwaggerPetstore.MimeTypes.MimeUnrender SwaggerPetstore.MimeTypes.MimeJSON a instance Web.Internal.FormUrlEncoded.FromForm a => SwaggerPetstore.MimeTypes.MimeUnrender SwaggerPetstore.MimeTypes.MimeFormUrlEncoded a instance SwaggerPetstore.MimeTypes.MimeUnrender SwaggerPetstore.MimeTypes.MimePlainText Data.ByteString.Lazy.Internal.ByteString @@ -613,6 +629,114 @@ instance GHC.Classes.Eq SwaggerPetstore.Client.MimeError module SwaggerPetstore.Model +newtype AdditionalMetadata +AdditionalMetadata :: Text -> AdditionalMetadata +[unAdditionalMetadata] :: AdditionalMetadata -> Text +newtype ApiKey +ApiKey :: Text -> ApiKey +[unApiKey] :: ApiKey -> Text +newtype Body +Body :: [User] -> Body +[unBody] :: Body -> [User] +newtype Byte +Byte :: ByteArray -> Byte +[unByte] :: Byte -> ByteArray +newtype Callback +Callback :: Text -> Callback +[unCallback] :: Callback -> Text +newtype EnumFormString +EnumFormString :: E'EnumFormString -> EnumFormString +[unEnumFormString] :: EnumFormString -> E'EnumFormString +newtype EnumFormStringArray +EnumFormStringArray :: [E'Inner2] -> EnumFormStringArray +[unEnumFormStringArray] :: EnumFormStringArray -> [E'Inner2] +newtype EnumHeaderString +EnumHeaderString :: E'EnumFormString -> EnumHeaderString +[unEnumHeaderString] :: EnumHeaderString -> E'EnumFormString +newtype EnumHeaderStringArray +EnumHeaderStringArray :: [E'Inner2] -> EnumHeaderStringArray +[unEnumHeaderStringArray] :: EnumHeaderStringArray -> [E'Inner2] +newtype EnumQueryDouble +EnumQueryDouble :: E'EnumNumber -> EnumQueryDouble +[unEnumQueryDouble] :: EnumQueryDouble -> E'EnumNumber +newtype EnumQueryInteger +EnumQueryInteger :: E'EnumQueryInteger -> EnumQueryInteger +[unEnumQueryInteger] :: EnumQueryInteger -> E'EnumQueryInteger +newtype EnumQueryString +EnumQueryString :: E'EnumFormString -> EnumQueryString +[unEnumQueryString] :: EnumQueryString -> E'EnumFormString +newtype EnumQueryStringArray +EnumQueryStringArray :: [E'Inner2] -> EnumQueryStringArray +[unEnumQueryStringArray] :: EnumQueryStringArray -> [E'Inner2] +newtype File +File :: FilePath -> File +[unFile] :: File -> FilePath +newtype Int32 +Int32 :: Int -> Int32 +[unInt32] :: Int32 -> Int +newtype Int64 +Int64 :: Integer -> Int64 +[unInt64] :: Int64 -> Integer +newtype Name2 +Name2 :: Text -> Name2 +[unName2] :: Name2 -> Text +newtype Number +Number :: Double -> Number +[unNumber] :: Number -> Double +newtype OrderId +OrderId :: Integer -> OrderId +[unOrderId] :: OrderId -> Integer +newtype OrderIdText +OrderIdText :: Text -> OrderIdText +[unOrderIdText] :: OrderIdText -> Text +newtype Param +Param :: Text -> Param +[unParam] :: Param -> Text +newtype Param2 +Param2 :: Text -> Param2 +[unParam2] :: Param2 -> Text +newtype ParamBinary +ParamBinary :: Binary -> ParamBinary +[unParamBinary] :: ParamBinary -> Binary +newtype ParamDate +ParamDate :: Date -> ParamDate +[unParamDate] :: ParamDate -> Date +newtype ParamDateTime +ParamDateTime :: DateTime -> ParamDateTime +[unParamDateTime] :: ParamDateTime -> DateTime +newtype ParamDouble +ParamDouble :: Double -> ParamDouble +[unParamDouble] :: ParamDouble -> Double +newtype ParamFloat +ParamFloat :: Float -> ParamFloat +[unParamFloat] :: ParamFloat -> Float +newtype ParamInteger +ParamInteger :: Int -> ParamInteger +[unParamInteger] :: ParamInteger -> Int +newtype ParamString +ParamString :: Text -> ParamString +[unParamString] :: ParamString -> Text +newtype Password +Password :: Text -> Password +[unPassword] :: Password -> Text +newtype PatternWithoutDelimiter +PatternWithoutDelimiter :: Text -> PatternWithoutDelimiter +[unPatternWithoutDelimiter] :: PatternWithoutDelimiter -> Text +newtype PetId +PetId :: Integer -> PetId +[unPetId] :: PetId -> Integer +newtype Status +Status :: [E'Status2] -> Status +[unStatus] :: Status -> [E'Status2] +newtype StatusText +StatusText :: Text -> StatusText +[unStatusText] :: StatusText -> Text +newtype Tags +Tags :: [Text] -> Tags +[unTags] :: Tags -> [Text] +newtype Username +Username :: Text -> Username +[unUsername] :: Username -> Text -- | AdditionalPropertiesClass data AdditionalPropertiesClass @@ -1551,6 +1675,30 @@ fromOuterEnum :: OuterEnum -> Text -- | parse OuterEnum enum toOuterEnum :: Text -> Either String OuterEnum +data AuthApiKeyApiKey + +-- | secret +AuthApiKeyApiKey :: Text -> AuthApiKeyApiKey +data AuthApiKeyApiKeyQuery + +-- | secret +AuthApiKeyApiKeyQuery :: Text -> AuthApiKeyApiKeyQuery +data AuthBasicHttpBasicTest + +-- | username password +AuthBasicHttpBasicTest :: ByteString -> ByteString -> AuthBasicHttpBasicTest +data AuthOAuthPetstoreAuth + +-- | secret +AuthOAuthPetstoreAuth :: Text -> AuthOAuthPetstoreAuth +instance GHC.Show.Show SwaggerPetstore.Model.AuthOAuthPetstoreAuth +instance GHC.Classes.Eq SwaggerPetstore.Model.AuthOAuthPetstoreAuth +instance GHC.Show.Show SwaggerPetstore.Model.AuthBasicHttpBasicTest +instance GHC.Classes.Eq SwaggerPetstore.Model.AuthBasicHttpBasicTest +instance GHC.Show.Show SwaggerPetstore.Model.AuthApiKeyApiKeyQuery +instance GHC.Classes.Eq SwaggerPetstore.Model.AuthApiKeyApiKeyQuery +instance GHC.Show.Show SwaggerPetstore.Model.AuthApiKeyApiKey +instance GHC.Classes.Eq SwaggerPetstore.Model.AuthApiKeyApiKey instance GHC.Classes.Eq SwaggerPetstore.Model.EnumTest instance GHC.Show.Show SwaggerPetstore.Model.EnumTest instance GHC.Enum.Enum SwaggerPetstore.Model.OuterEnum @@ -1563,6 +1711,8 @@ instance GHC.Enum.Bounded SwaggerPetstore.Model.EnumClass instance GHC.Classes.Ord SwaggerPetstore.Model.EnumClass instance GHC.Classes.Eq SwaggerPetstore.Model.EnumClass instance GHC.Show.Show SwaggerPetstore.Model.EnumClass +instance GHC.Show.Show SwaggerPetstore.Model.Status +instance GHC.Classes.Eq SwaggerPetstore.Model.Status instance GHC.Classes.Eq SwaggerPetstore.Model.Pet instance GHC.Show.Show SwaggerPetstore.Model.Pet instance GHC.Enum.Enum SwaggerPetstore.Model.E'Status2 @@ -1584,6 +1734,12 @@ instance GHC.Enum.Bounded SwaggerPetstore.Model.E'JustSymbol instance GHC.Classes.Ord SwaggerPetstore.Model.E'JustSymbol instance GHC.Classes.Eq SwaggerPetstore.Model.E'JustSymbol instance GHC.Show.Show SwaggerPetstore.Model.E'JustSymbol +instance GHC.Show.Show SwaggerPetstore.Model.EnumFormStringArray +instance GHC.Classes.Eq SwaggerPetstore.Model.EnumFormStringArray +instance GHC.Show.Show SwaggerPetstore.Model.EnumHeaderStringArray +instance GHC.Classes.Eq SwaggerPetstore.Model.EnumHeaderStringArray +instance GHC.Show.Show SwaggerPetstore.Model.EnumQueryStringArray +instance GHC.Classes.Eq SwaggerPetstore.Model.EnumQueryStringArray instance GHC.Enum.Enum SwaggerPetstore.Model.E'Inner2 instance GHC.Enum.Bounded SwaggerPetstore.Model.E'Inner2 instance GHC.Classes.Ord SwaggerPetstore.Model.E'Inner2 @@ -1601,11 +1757,15 @@ instance GHC.Enum.Bounded SwaggerPetstore.Model.E'EnumString instance GHC.Classes.Ord SwaggerPetstore.Model.E'EnumString instance GHC.Classes.Eq SwaggerPetstore.Model.E'EnumString instance GHC.Show.Show SwaggerPetstore.Model.E'EnumString +instance GHC.Show.Show SwaggerPetstore.Model.EnumQueryInteger +instance GHC.Classes.Eq SwaggerPetstore.Model.EnumQueryInteger instance GHC.Enum.Enum SwaggerPetstore.Model.E'EnumQueryInteger instance GHC.Enum.Bounded SwaggerPetstore.Model.E'EnumQueryInteger instance GHC.Classes.Ord SwaggerPetstore.Model.E'EnumQueryInteger instance GHC.Classes.Eq SwaggerPetstore.Model.E'EnumQueryInteger instance GHC.Show.Show SwaggerPetstore.Model.E'EnumQueryInteger +instance GHC.Show.Show SwaggerPetstore.Model.EnumQueryDouble +instance GHC.Classes.Eq SwaggerPetstore.Model.EnumQueryDouble instance GHC.Enum.Enum SwaggerPetstore.Model.E'EnumNumber instance GHC.Enum.Bounded SwaggerPetstore.Model.E'EnumNumber instance GHC.Classes.Ord SwaggerPetstore.Model.E'EnumNumber @@ -1616,6 +1776,12 @@ instance GHC.Enum.Bounded SwaggerPetstore.Model.E'EnumInteger instance GHC.Classes.Ord SwaggerPetstore.Model.E'EnumInteger instance GHC.Classes.Eq SwaggerPetstore.Model.E'EnumInteger instance GHC.Show.Show SwaggerPetstore.Model.E'EnumInteger +instance GHC.Show.Show SwaggerPetstore.Model.EnumFormString +instance GHC.Classes.Eq SwaggerPetstore.Model.EnumFormString +instance GHC.Show.Show SwaggerPetstore.Model.EnumHeaderString +instance GHC.Classes.Eq SwaggerPetstore.Model.EnumHeaderString +instance GHC.Show.Show SwaggerPetstore.Model.EnumQueryString +instance GHC.Classes.Eq SwaggerPetstore.Model.EnumQueryString instance GHC.Enum.Enum SwaggerPetstore.Model.E'EnumFormString instance GHC.Enum.Bounded SwaggerPetstore.Model.E'EnumFormString instance GHC.Classes.Ord SwaggerPetstore.Model.E'EnumFormString @@ -1630,6 +1796,9 @@ instance GHC.Classes.Eq SwaggerPetstore.Model.Dog instance GHC.Show.Show SwaggerPetstore.Model.Dog instance GHC.Classes.Eq SwaggerPetstore.Model.Cat instance GHC.Show.Show SwaggerPetstore.Model.Cat +instance Data.Aeson.Types.ToJSON.ToJSON SwaggerPetstore.Model.Body +instance GHC.Show.Show SwaggerPetstore.Model.Body +instance GHC.Classes.Eq SwaggerPetstore.Model.Body instance GHC.Classes.Eq SwaggerPetstore.Model.User instance GHC.Show.Show SwaggerPetstore.Model.User instance GHC.Classes.Eq SwaggerPetstore.Model.Tag @@ -1696,6 +1865,62 @@ instance GHC.Classes.Eq SwaggerPetstore.Model.Animal instance GHC.Show.Show SwaggerPetstore.Model.Animal instance GHC.Classes.Eq SwaggerPetstore.Model.AdditionalPropertiesClass instance GHC.Show.Show SwaggerPetstore.Model.AdditionalPropertiesClass +instance GHC.Show.Show SwaggerPetstore.Model.Username +instance GHC.Classes.Eq SwaggerPetstore.Model.Username +instance GHC.Show.Show SwaggerPetstore.Model.Tags +instance GHC.Classes.Eq SwaggerPetstore.Model.Tags +instance GHC.Show.Show SwaggerPetstore.Model.StatusText +instance GHC.Classes.Eq SwaggerPetstore.Model.StatusText +instance GHC.Show.Show SwaggerPetstore.Model.PetId +instance GHC.Classes.Eq SwaggerPetstore.Model.PetId +instance GHC.Show.Show SwaggerPetstore.Model.PatternWithoutDelimiter +instance GHC.Classes.Eq SwaggerPetstore.Model.PatternWithoutDelimiter +instance GHC.Show.Show SwaggerPetstore.Model.Password +instance GHC.Classes.Eq SwaggerPetstore.Model.Password +instance GHC.Show.Show SwaggerPetstore.Model.ParamString +instance GHC.Classes.Eq SwaggerPetstore.Model.ParamString +instance GHC.Show.Show SwaggerPetstore.Model.ParamInteger +instance GHC.Classes.Eq SwaggerPetstore.Model.ParamInteger +instance GHC.Show.Show SwaggerPetstore.Model.ParamFloat +instance GHC.Classes.Eq SwaggerPetstore.Model.ParamFloat +instance GHC.Show.Show SwaggerPetstore.Model.ParamDouble +instance GHC.Classes.Eq SwaggerPetstore.Model.ParamDouble +instance GHC.Show.Show SwaggerPetstore.Model.ParamDateTime +instance GHC.Classes.Eq SwaggerPetstore.Model.ParamDateTime +instance GHC.Show.Show SwaggerPetstore.Model.ParamDate +instance GHC.Classes.Eq SwaggerPetstore.Model.ParamDate +instance GHC.Show.Show SwaggerPetstore.Model.ParamBinary +instance GHC.Classes.Eq SwaggerPetstore.Model.ParamBinary +instance GHC.Show.Show SwaggerPetstore.Model.Param2 +instance GHC.Classes.Eq SwaggerPetstore.Model.Param2 +instance GHC.Show.Show SwaggerPetstore.Model.Param +instance GHC.Classes.Eq SwaggerPetstore.Model.Param +instance GHC.Show.Show SwaggerPetstore.Model.OrderIdText +instance GHC.Classes.Eq SwaggerPetstore.Model.OrderIdText +instance GHC.Show.Show SwaggerPetstore.Model.OrderId +instance GHC.Classes.Eq SwaggerPetstore.Model.OrderId +instance GHC.Show.Show SwaggerPetstore.Model.Number +instance GHC.Classes.Eq SwaggerPetstore.Model.Number +instance GHC.Show.Show SwaggerPetstore.Model.Name2 +instance GHC.Classes.Eq SwaggerPetstore.Model.Name2 +instance GHC.Show.Show SwaggerPetstore.Model.Int64 +instance GHC.Classes.Eq SwaggerPetstore.Model.Int64 +instance GHC.Show.Show SwaggerPetstore.Model.Int32 +instance GHC.Classes.Eq SwaggerPetstore.Model.Int32 +instance GHC.Show.Show SwaggerPetstore.Model.File +instance GHC.Classes.Eq SwaggerPetstore.Model.File +instance GHC.Show.Show SwaggerPetstore.Model.Callback +instance GHC.Classes.Eq SwaggerPetstore.Model.Callback +instance GHC.Show.Show SwaggerPetstore.Model.Byte +instance GHC.Classes.Eq SwaggerPetstore.Model.Byte +instance GHC.Show.Show SwaggerPetstore.Model.ApiKey +instance GHC.Classes.Eq SwaggerPetstore.Model.ApiKey +instance GHC.Show.Show SwaggerPetstore.Model.AdditionalMetadata +instance GHC.Classes.Eq SwaggerPetstore.Model.AdditionalMetadata +instance SwaggerPetstore.Core.AuthMethod SwaggerPetstore.Model.AuthOAuthPetstoreAuth +instance SwaggerPetstore.Core.AuthMethod SwaggerPetstore.Model.AuthBasicHttpBasicTest +instance SwaggerPetstore.Core.AuthMethod SwaggerPetstore.Model.AuthApiKeyApiKeyQuery +instance SwaggerPetstore.Core.AuthMethod SwaggerPetstore.Model.AuthApiKeyApiKey instance Data.Aeson.Types.FromJSON.FromJSON SwaggerPetstore.Model.EnumTest instance Data.Aeson.Types.ToJSON.ToJSON SwaggerPetstore.Model.EnumTest instance Data.Aeson.Types.ToJSON.ToJSON SwaggerPetstore.Model.OuterEnum @@ -1825,22 +2050,24 @@ instance Data.Aeson.Types.FromJSON.FromJSON SwaggerPetstore.Model.AdditionalProp instance Data.Aeson.Types.ToJSON.ToJSON SwaggerPetstore.Model.AdditionalPropertiesClass -module SwaggerPetstore.API +module SwaggerPetstore.API.User -- |
---   PATCH /another-fake/dummy
+--   POST /user
 --   
-- --- To test special tags +-- Create user -- --- To test special tags -testSpecialTags :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) => ContentType contentType -> Accept accept -> Client -> SwaggerPetstoreRequest TestSpecialTags contentType Client accept -data TestSpecialTags +-- This can only be done by the logged in user. +-- +-- Note: Has Produces instances, but no response schema +createUser :: (Consumes CreateUser contentType, MimeRender contentType User) => ContentType contentType -> Accept accept -> User -> SwaggerPetstoreRequest CreateUser contentType res accept +data CreateUser --- | Body Param "body" - client model +-- | Body Param "body" - Created user object -- |
---   application/json
+--   application/xml
 --   
-- |
@@ -1848,59 +2075,39 @@ data TestSpecialTags
 --   
-- |
---   POST /fake/outer/boolean
+--   POST /user/createWithArray
 --   
-- --- Test serialization of outer boolean types -fakeOuterBooleanSerialize :: (Consumes FakeOuterBooleanSerialize contentType) => ContentType contentType -> Accept accept -> SwaggerPetstoreRequest FakeOuterBooleanSerialize contentType OuterBoolean accept -data FakeOuterBooleanSerialize - --- | Body Param "body" - Input boolean as post body - --- |
---   POST /fake/outer/composite
---   
+-- Creates list of users with given input array -- --- Test serialization of object with outer number type -fakeOuterCompositeSerialize :: (Consumes FakeOuterCompositeSerialize contentType) => ContentType contentType -> Accept accept -> SwaggerPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite accept -data FakeOuterCompositeSerialize +-- Note: Has Produces instances, but no response schema +createUsersWithArrayInput :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body) => ContentType contentType -> Accept accept -> Body -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res accept +data CreateUsersWithArrayInput --- | Body Param "body" - Input composite as post body +-- | Body Param "body" - List of user object -- |
---   POST /fake/outer/number
+--   application/xml
 --   
--- --- Test serialization of outer number types -fakeOuterNumberSerialize :: (Consumes FakeOuterNumberSerialize contentType) => ContentType contentType -> Accept accept -> SwaggerPetstoreRequest FakeOuterNumberSerialize contentType OuterNumber accept -data FakeOuterNumberSerialize - --- | Body Param "body" - Input number as post body -- |
---   POST /fake/outer/string
+--   application/json
 --   
--- --- Test serialization of outer string types -fakeOuterStringSerialize :: (Consumes FakeOuterStringSerialize contentType) => ContentType contentType -> Accept accept -> SwaggerPetstoreRequest FakeOuterStringSerialize contentType OuterString accept -data FakeOuterStringSerialize - --- | Body Param "body" - Input string as post body -- |
---   PATCH /fake
+--   POST /user/createWithList
 --   
-- --- To test "client" model +-- Creates list of users with given input array -- --- To test "client" model -testClientModel :: (Consumes TestClientModel contentType, MimeRender contentType Client) => ContentType contentType -> Accept accept -> Client -> SwaggerPetstoreRequest TestClientModel contentType Client accept -data TestClientModel +-- Note: Has Produces instances, but no response schema +createUsersWithListInput :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body) => ContentType contentType -> Accept accept -> Body -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res accept +data CreateUsersWithListInput --- | Body Param "body" - client model +-- | Body Param "body" - List of user object -- |
---   application/json
+--   application/xml
 --   
-- |
@@ -1908,144 +2115,204 @@ data TestClientModel
 --   
-- |
---   POST /fake
+--   DELETE /user/{username}
 --   
-- --- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 --- --- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +-- Delete user -- --- AuthMethod: AuthBasicHttpBasicTest +-- This can only be done by the logged in user. -- -- Note: Has Produces instances, but no response schema -testEndpointParameters :: (Consumes TestEndpointParameters contentType) => ContentType contentType -> Accept accept -> Number -> ParamDouble -> PatternWithoutDelimiter -> Byte -> SwaggerPetstoreRequest TestEndpointParameters contentType res accept -data TestEndpointParameters - --- | Optional Param "integer" - None - --- | Optional Param "int32" - None - --- | Optional Param "int64" - None - --- | Optional Param "float" - None - --- | Optional Param "string" - None - --- | Optional Param "binary" - None - --- | Optional Param "date" - None - --- | Optional Param "dateTime" - None - --- | Optional Param "password" - None +deleteUser :: Accept accept -> Username -> SwaggerPetstoreRequest DeleteUser MimeNoContent res accept +data DeleteUser --- | Optional Param "callback" - None +-- |
+--   application/xml
+--   
-- |
---   application/xml; charset=utf-8
+--   application/json
 --   
-- |
---   application/json; charset=utf-8
+--   GET /user/{username}
 --   
+-- +-- Get user by user name +getUserByName :: Accept accept -> Username -> SwaggerPetstoreRequest GetUserByName MimeNoContent User accept +data GetUserByName -- |
---   application/xml; charset=utf-8
+--   application/xml
 --   
-- |
---   application/json; charset=utf-8
+--   application/json
 --   
-- |
---   GET /fake
+--   GET /user/login
 --   
-- --- To test enum parameters --- --- To test enum parameters --- --- Note: Has Produces instances, but no response schema -testEnumParameters :: (Consumes TestEnumParameters contentType) => ContentType contentType -> Accept accept -> SwaggerPetstoreRequest TestEnumParameters contentType res accept -data TestEnumParameters - --- | Optional Param "enum_form_string_array" - Form parameter enum --- test (string array) +-- Logs user into the system +loginUser :: Accept accept -> Username -> Password -> SwaggerPetstoreRequest LoginUser MimeNoContent Text accept +data LoginUser --- | Optional Param "enum_form_string" - Form parameter enum test --- (string) +-- |
+--   application/xml
+--   
--- | Optional Param "enum_header_string_array" - Header parameter --- enum test (string array) +-- |
+--   application/json
+--   
--- | Optional Param "enum_header_string" - Header parameter enum --- test (string) +-- |
+--   GET /user/logout
+--   
+-- +-- Logs out current logged in user session +-- +-- Note: Has Produces instances, but no response schema +logoutUser :: Accept accept -> SwaggerPetstoreRequest LogoutUser MimeNoContent res accept +data LogoutUser --- | Optional Param "enum_query_string_array" - Query parameter enum --- test (string array) +-- |
+--   application/xml
+--   
--- | Optional Param "enum_query_string" - Query parameter enum test --- (string) +-- |
+--   application/json
+--   
--- | Optional Param "enum_query_integer" - Query parameter enum test --- (double) +-- |
+--   PUT /user/{username}
+--   
+-- +-- Updated user +-- +-- This can only be done by the logged in user. +-- +-- Note: Has Produces instances, but no response schema +updateUser :: (Consumes UpdateUser contentType, MimeRender contentType User) => ContentType contentType -> Accept accept -> Username -> User -> SwaggerPetstoreRequest UpdateUser contentType res accept +data UpdateUser --- | Optional Param "enum_query_double" - Query parameter enum test --- (double) +-- | Body Param "body" - Updated user object -- |
---   */*
+--   application/xml
 --   
-- |
---   */*
+--   application/json
 --   
+instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.User.UpdateUser SwaggerPetstore.Model.User +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.User.UpdateUser SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.User.UpdateUser SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.User.LogoutUser SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.User.LogoutUser SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.User.LoginUser SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.User.LoginUser SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.User.GetUserByName SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.User.GetUserByName SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.User.DeleteUser SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.User.DeleteUser SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.User.CreateUsersWithListInput SwaggerPetstore.Model.Body +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.User.CreateUsersWithListInput SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.User.CreateUsersWithListInput SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.User.CreateUsersWithArrayInput SwaggerPetstore.Model.Body +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.User.CreateUsersWithArrayInput SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.User.CreateUsersWithArrayInput SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.User.CreateUser SwaggerPetstore.Model.User +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.User.CreateUser SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.User.CreateUser SwaggerPetstore.MimeTypes.MimeJSON + + +module SwaggerPetstore.API.Store -- |
---   POST /fake/inline-additionalProperties
+--   DELETE /store/order/{order_id}
 --   
-- --- test inline additionalProperties -testInlineAdditionalProperties :: (Consumes TestInlineAdditionalProperties contentType, MimeRender contentType Value) => ContentType contentType -> Value -> SwaggerPetstoreRequest TestInlineAdditionalProperties contentType NoContent MimeNoContent -data TestInlineAdditionalProperties +-- Delete purchase order by ID +-- +-- For valid response try integer IDs with value < 1000. Anything +-- above 1000 or nonintegers will generate API errors +-- +-- Note: Has Produces instances, but no response schema +deleteOrder :: Accept accept -> OrderIdText -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res accept +data DeleteOrder --- | Body Param "param" - request body +-- |
+--   application/xml
+--   
-- |
 --   application/json
 --   
-- |
---   GET /fake/jsonFormData
+--   GET /store/inventory
 --   
-- --- test json serialization of form data -testJsonFormData :: (Consumes TestJsonFormData contentType) => ContentType contentType -> Param -> Param2 -> SwaggerPetstoreRequest TestJsonFormData contentType NoContent MimeNoContent -data TestJsonFormData +-- Returns pet inventories by status +-- +-- Returns a map of status codes to quantities +-- +-- AuthMethod: AuthApiKeyApiKey +getInventory :: Accept accept -> SwaggerPetstoreRequest GetInventory MimeNoContent ((Map String Int)) accept +data GetInventory -- |
 --   application/json
 --   
-- |
---   PATCH /fake_classname_test
+--   GET /store/order/{order_id}
 --   
-- --- To test class name in snake case +-- Find purchase order by ID -- --- AuthMethod: AuthApiKeyApiKeyQuery -testClassname :: (Consumes TestClassname contentType, MimeRender contentType Client) => ContentType contentType -> Accept accept -> Client -> SwaggerPetstoreRequest TestClassname contentType Client accept -data TestClassname +-- For valid response try integer IDs with value 5 or 10. Other +-- values will generated exceptions +getOrderById :: Accept accept -> OrderId -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order accept +data GetOrderById --- | Body Param "body" - client model +-- |
+--   application/xml
+--   
-- |
 --   application/json
 --   
+-- |
+--   POST /store/order
+--   
+-- +-- Place an order for a pet +placeOrder :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => ContentType contentType -> Accept accept -> Order -> SwaggerPetstoreRequest PlaceOrder contentType Order accept +data PlaceOrder + +-- | Body Param "body" - order placed for purchasing the pet + +-- |
+--   application/xml
+--   
+ -- |
 --   application/json
 --   
+instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.Store.PlaceOrder SwaggerPetstore.Model.Order +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Store.PlaceOrder SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Store.PlaceOrder SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Store.GetOrderById SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Store.GetOrderById SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Store.GetInventory SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Store.DeleteOrder SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Store.DeleteOrder SwaggerPetstore.MimeTypes.MimeJSON + + +module SwaggerPetstore.API.Pet -- |
 --   POST /pet
@@ -2242,97 +2509,118 @@ data UploadFile
 -- | 
 --   application/json
 --   
+instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Pet.UploadFile SwaggerPetstore.Model.AdditionalMetadata +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Pet.UploadFile SwaggerPetstore.Model.File +instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.Pet.UploadFile SwaggerPetstore.MimeTypes.MimeMultipartFormData +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Pet.UploadFile SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Pet.UpdatePetWithForm SwaggerPetstore.Model.Name2 +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Pet.UpdatePetWithForm SwaggerPetstore.Model.StatusText +instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.Pet.UpdatePetWithForm SwaggerPetstore.MimeTypes.MimeFormUrlEncoded +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Pet.UpdatePetWithForm SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Pet.UpdatePetWithForm SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.Pet.UpdatePet SwaggerPetstore.Model.Pet +instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.Pet.UpdatePet SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.Pet.UpdatePet SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Pet.UpdatePet SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Pet.UpdatePet SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Pet.GetPetById SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Pet.GetPetById SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Pet.FindPetsByTags SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Pet.FindPetsByTags SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Pet.FindPetsByStatus SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Pet.FindPetsByStatus SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Pet.DeletePet SwaggerPetstore.Model.ApiKey +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Pet.DeletePet SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Pet.DeletePet SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.Pet.AddPet SwaggerPetstore.Model.Pet +instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.Pet.AddPet SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.Pet.AddPet SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Pet.AddPet SwaggerPetstore.MimeTypes.MimeXML +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Pet.AddPet SwaggerPetstore.MimeTypes.MimeJSON + + +module SwaggerPetstore.API.FakeClassnameTags123 -- |
---   DELETE /store/order/{order_id}
+--   PATCH /fake_classname_test
 --   
-- --- Delete purchase order by ID --- --- For valid response try integer IDs with value < 1000. Anything --- above 1000 or nonintegers will generate API errors +-- To test class name in snake case -- --- Note: Has Produces instances, but no response schema -deleteOrder :: Accept accept -> OrderIdText -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res accept -data DeleteOrder +-- AuthMethod: AuthApiKeyApiKeyQuery +testClassname :: (Consumes TestClassname contentType, MimeRender contentType Client) => ContentType contentType -> Accept accept -> Client -> SwaggerPetstoreRequest TestClassname contentType Client accept +data TestClassname --- |
---   application/xml
---   
+-- | Body Param "body" - client model -- |
 --   application/json
 --   
--- |
---   GET /store/inventory
---   
--- --- Returns pet inventories by status --- --- Returns a map of status codes to quantities --- --- AuthMethod: AuthApiKeyApiKey -getInventory :: Accept accept -> SwaggerPetstoreRequest GetInventory MimeNoContent ((Map String Int)) accept -data GetInventory - -- |
 --   application/json
 --   
+instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.FakeClassnameTags123.TestClassname SwaggerPetstore.Model.Client +instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.FakeClassnameTags123.TestClassname SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.FakeClassnameTags123.TestClassname SwaggerPetstore.MimeTypes.MimeJSON + + +module SwaggerPetstore.API.Fake -- |
---   GET /store/order/{order_id}
+--   POST /fake/outer/boolean
 --   
-- --- Find purchase order by ID --- --- For valid response try integer IDs with value 5 or 10. Other --- values will generated exceptions -getOrderById :: Accept accept -> OrderId -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order accept -data GetOrderById +-- Test serialization of outer boolean types +fakeOuterBooleanSerialize :: (Consumes FakeOuterBooleanSerialize contentType) => ContentType contentType -> Accept accept -> SwaggerPetstoreRequest FakeOuterBooleanSerialize contentType OuterBoolean accept +data FakeOuterBooleanSerialize --- |
---   application/xml
---   
+-- | Body Param "body" - Input boolean as post body -- |
---   application/json
+--   POST /fake/outer/composite
 --   
+-- +-- Test serialization of object with outer number type +fakeOuterCompositeSerialize :: (Consumes FakeOuterCompositeSerialize contentType) => ContentType contentType -> Accept accept -> SwaggerPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite accept +data FakeOuterCompositeSerialize + +-- | Body Param "body" - Input composite as post body -- |
---   POST /store/order
+--   POST /fake/outer/number
 --   
-- --- Place an order for a pet -placeOrder :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => ContentType contentType -> Accept accept -> Order -> SwaggerPetstoreRequest PlaceOrder contentType Order accept -data PlaceOrder +-- Test serialization of outer number types +fakeOuterNumberSerialize :: (Consumes FakeOuterNumberSerialize contentType) => ContentType contentType -> Accept accept -> SwaggerPetstoreRequest FakeOuterNumberSerialize contentType OuterNumber accept +data FakeOuterNumberSerialize --- | Body Param "body" - order placed for purchasing the pet +-- | Body Param "body" - Input number as post body -- |
---   application/xml
+--   POST /fake/outer/string
 --   
+-- +-- Test serialization of outer string types +fakeOuterStringSerialize :: (Consumes FakeOuterStringSerialize contentType) => ContentType contentType -> Accept accept -> SwaggerPetstoreRequest FakeOuterStringSerialize contentType OuterString accept +data FakeOuterStringSerialize --- |
---   application/json
---   
+-- | Body Param "body" - Input string as post body -- |
---   POST /user
+--   PATCH /fake
 --   
-- --- Create user --- --- This can only be done by the logged in user. +-- To test "client" model -- --- Note: Has Produces instances, but no response schema -createUser :: (Consumes CreateUser contentType, MimeRender contentType User) => ContentType contentType -> Accept accept -> User -> SwaggerPetstoreRequest CreateUser contentType res accept -data CreateUser +-- To test "client" model +testClientModel :: (Consumes TestClientModel contentType, MimeRender contentType Client) => ContentType contentType -> Accept accept -> Client -> SwaggerPetstoreRequest TestClientModel contentType Client accept +data TestClientModel --- | Body Param "body" - Created user object +-- | Body Param "body" - client model -- |
---   application/xml
+--   application/json
 --   
-- |
@@ -2340,457 +2628,187 @@ data CreateUser
 --   
-- |
---   POST /user/createWithArray
+--   POST /fake
 --   
-- --- Creates list of users with given input array +-- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +-- +-- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +-- +-- AuthMethod: AuthBasicHttpBasicTest -- -- Note: Has Produces instances, but no response schema -createUsersWithArrayInput :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body) => ContentType contentType -> Accept accept -> Body -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res accept -data CreateUsersWithArrayInput +testEndpointParameters :: (Consumes TestEndpointParameters contentType) => ContentType contentType -> Accept accept -> Number -> ParamDouble -> PatternWithoutDelimiter -> Byte -> SwaggerPetstoreRequest TestEndpointParameters contentType res accept +data TestEndpointParameters --- | Body Param "body" - List of user object +-- | Optional Param "integer" - None --- |
---   application/xml
---   
+-- | Optional Param "int32" - None + +-- | Optional Param "int64" - None + +-- | Optional Param "float" - None + +-- | Optional Param "string" - None + +-- | Optional Param "binary" - None + +-- | Optional Param "date" - None + +-- | Optional Param "dateTime" - None + +-- | Optional Param "password" - None + +-- | Optional Param "callback" - None -- |
---   application/json
+--   application/xml; charset=utf-8
 --   
-- |
---   POST /user/createWithList
+--   application/json; charset=utf-8
 --   
--- --- Creates list of users with given input array --- --- Note: Has Produces instances, but no response schema -createUsersWithListInput :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body) => ContentType contentType -> Accept accept -> Body -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res accept -data CreateUsersWithListInput - --- | Body Param "body" - List of user object -- |
---   application/xml
+--   application/xml; charset=utf-8
 --   
-- |
---   application/json
+--   application/json; charset=utf-8
 --   
-- |
---   DELETE /user/{username}
+--   GET /fake
 --   
-- --- Delete user +-- To test enum parameters -- --- This can only be done by the logged in user. +-- To test enum parameters -- -- Note: Has Produces instances, but no response schema -deleteUser :: Accept accept -> Username -> SwaggerPetstoreRequest DeleteUser MimeNoContent res accept -data DeleteUser +testEnumParameters :: (Consumes TestEnumParameters contentType) => ContentType contentType -> Accept accept -> SwaggerPetstoreRequest TestEnumParameters contentType res accept +data TestEnumParameters --- |
---   application/xml
---   
+-- | Optional Param "enum_form_string_array" - Form parameter enum +-- test (string array) --- |
---   application/json
---   
+-- | Optional Param "enum_form_string" - Form parameter enum test +-- (string) --- |
---   GET /user/{username}
---   
--- --- Get user by user name -getUserByName :: Accept accept -> Username -> SwaggerPetstoreRequest GetUserByName MimeNoContent User accept -data GetUserByName +-- | Optional Param "enum_header_string_array" - Header parameter +-- enum test (string array) + +-- | Optional Param "enum_header_string" - Header parameter enum +-- test (string) + +-- | Optional Param "enum_query_string_array" - Query parameter enum +-- test (string array) + +-- | Optional Param "enum_query_string" - Query parameter enum test +-- (string) + +-- | Optional Param "enum_query_integer" - Query parameter enum test +-- (double) + +-- | Optional Param "enum_query_double" - Query parameter enum test +-- (double) -- |
---   application/xml
+--   */*
 --   
-- |
---   application/json
+--   */*
 --   
-- |
---   GET /user/login
+--   POST /fake/inline-additionalProperties
 --   
-- --- Logs user into the system -loginUser :: Accept accept -> Username -> Password -> SwaggerPetstoreRequest LoginUser MimeNoContent Text accept -data LoginUser +-- test inline additionalProperties +testInlineAdditionalProperties :: (Consumes TestInlineAdditionalProperties contentType, MimeRender contentType Value) => ContentType contentType -> Value -> SwaggerPetstoreRequest TestInlineAdditionalProperties contentType NoContent MimeNoContent +data TestInlineAdditionalProperties --- |
---   application/xml
---   
+-- | Body Param "param" - request body -- |
 --   application/json
 --   
-- |
---   GET /user/logout
+--   GET /fake/jsonFormData
 --   
-- --- Logs out current logged in user session --- --- Note: Has Produces instances, but no response schema -logoutUser :: Accept accept -> SwaggerPetstoreRequest LogoutUser MimeNoContent res accept -data LogoutUser - --- |
---   application/xml
---   
+-- test json serialization of form data +testJsonFormData :: (Consumes TestJsonFormData contentType) => ContentType contentType -> Param -> Param2 -> SwaggerPetstoreRequest TestJsonFormData contentType NoContent MimeNoContent +data TestJsonFormData -- |
 --   application/json
 --   
+instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.Fake.TestJsonFormData SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.Fake.TestInlineAdditionalProperties Data.Aeson.Types.Internal.Value +instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.Fake.TestInlineAdditionalProperties SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEnumParameters SwaggerPetstore.Model.EnumFormStringArray +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEnumParameters SwaggerPetstore.Model.EnumFormString +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEnumParameters SwaggerPetstore.Model.EnumHeaderStringArray +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEnumParameters SwaggerPetstore.Model.EnumHeaderString +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEnumParameters SwaggerPetstore.Model.EnumQueryStringArray +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEnumParameters SwaggerPetstore.Model.EnumQueryString +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEnumParameters SwaggerPetstore.Model.EnumQueryInteger +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEnumParameters SwaggerPetstore.Model.EnumQueryDouble +instance SwaggerPetstore.MimeTypes.MimeType mtype => SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.Fake.TestEnumParameters mtype +instance SwaggerPetstore.MimeTypes.MimeType mtype => SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Fake.TestEnumParameters mtype +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEndpointParameters SwaggerPetstore.Model.ParamInteger +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEndpointParameters SwaggerPetstore.Model.Int32 +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEndpointParameters SwaggerPetstore.Model.Int64 +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEndpointParameters SwaggerPetstore.Model.ParamFloat +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEndpointParameters SwaggerPetstore.Model.ParamString +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEndpointParameters SwaggerPetstore.Model.ParamBinary +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEndpointParameters SwaggerPetstore.Model.ParamDate +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEndpointParameters SwaggerPetstore.Model.ParamDateTime +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEndpointParameters SwaggerPetstore.Model.Password +instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.Fake.TestEndpointParameters SwaggerPetstore.Model.Callback +instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.Fake.TestEndpointParameters SwaggerPetstore.MimeTypes.MimeXmlCharsetutf8 +instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.Fake.TestEndpointParameters SwaggerPetstore.MimeTypes.MimeJsonCharsetutf8 +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Fake.TestEndpointParameters SwaggerPetstore.MimeTypes.MimeXmlCharsetutf8 +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Fake.TestEndpointParameters SwaggerPetstore.MimeTypes.MimeJsonCharsetutf8 +instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.Fake.TestClientModel SwaggerPetstore.Model.Client +instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.Fake.TestClientModel SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.Fake.TestClientModel SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.Fake.FakeOuterStringSerialize SwaggerPetstore.Model.OuterString +instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.Fake.FakeOuterNumberSerialize SwaggerPetstore.Model.OuterNumber +instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.Fake.FakeOuterCompositeSerialize SwaggerPetstore.Model.OuterComposite +instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.Fake.FakeOuterBooleanSerialize SwaggerPetstore.Model.OuterBoolean + + +module SwaggerPetstore.API.AnotherFake -- |
---   PUT /user/{username}
+--   PATCH /another-fake/dummy
 --   
-- --- Updated user --- --- This can only be done by the logged in user. +-- To test special tags -- --- Note: Has Produces instances, but no response schema -updateUser :: (Consumes UpdateUser contentType, MimeRender contentType User) => ContentType contentType -> Accept accept -> Username -> User -> SwaggerPetstoreRequest UpdateUser contentType res accept -data UpdateUser +-- To test special tags +testSpecialTags :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) => ContentType contentType -> Accept accept -> Client -> SwaggerPetstoreRequest TestSpecialTags contentType Client accept +data TestSpecialTags --- | Body Param "body" - Updated user object +-- | Body Param "body" - client model -- |
---   application/xml
+--   application/json
 --   
-- |
 --   application/json
 --   
-newtype AdditionalMetadata -AdditionalMetadata :: Text -> AdditionalMetadata -[unAdditionalMetadata] :: AdditionalMetadata -> Text -newtype ApiKey -ApiKey :: Text -> ApiKey -[unApiKey] :: ApiKey -> Text -newtype Body -Body :: [User] -> Body -[unBody] :: Body -> [User] -newtype Byte -Byte :: ByteArray -> Byte -[unByte] :: Byte -> ByteArray -newtype Callback -Callback :: Text -> Callback -[unCallback] :: Callback -> Text -newtype EnumFormString -EnumFormString :: E'EnumFormString -> EnumFormString -[unEnumFormString] :: EnumFormString -> E'EnumFormString -newtype EnumFormStringArray -EnumFormStringArray :: [E'Inner2] -> EnumFormStringArray -[unEnumFormStringArray] :: EnumFormStringArray -> [E'Inner2] -newtype EnumHeaderString -EnumHeaderString :: E'EnumFormString -> EnumHeaderString -[unEnumHeaderString] :: EnumHeaderString -> E'EnumFormString -newtype EnumHeaderStringArray -EnumHeaderStringArray :: [E'Inner2] -> EnumHeaderStringArray -[unEnumHeaderStringArray] :: EnumHeaderStringArray -> [E'Inner2] -newtype EnumQueryDouble -EnumQueryDouble :: E'EnumNumber -> EnumQueryDouble -[unEnumQueryDouble] :: EnumQueryDouble -> E'EnumNumber -newtype EnumQueryInteger -EnumQueryInteger :: E'EnumQueryInteger -> EnumQueryInteger -[unEnumQueryInteger] :: EnumQueryInteger -> E'EnumQueryInteger -newtype EnumQueryString -EnumQueryString :: E'EnumFormString -> EnumQueryString -[unEnumQueryString] :: EnumQueryString -> E'EnumFormString -newtype EnumQueryStringArray -EnumQueryStringArray :: [E'Inner2] -> EnumQueryStringArray -[unEnumQueryStringArray] :: EnumQueryStringArray -> [E'Inner2] -newtype File -File :: FilePath -> File -[unFile] :: File -> FilePath -newtype Int32 -Int32 :: Int -> Int32 -[unInt32] :: Int32 -> Int -newtype Int64 -Int64 :: Integer -> Int64 -[unInt64] :: Int64 -> Integer -newtype Name2 -Name2 :: Text -> Name2 -[unName2] :: Name2 -> Text -newtype Number -Number :: Double -> Number -[unNumber] :: Number -> Double -newtype OrderId -OrderId :: Integer -> OrderId -[unOrderId] :: OrderId -> Integer -newtype OrderIdText -OrderIdText :: Text -> OrderIdText -[unOrderIdText] :: OrderIdText -> Text -newtype Param -Param :: Text -> Param -[unParam] :: Param -> Text -newtype Param2 -Param2 :: Text -> Param2 -[unParam2] :: Param2 -> Text -newtype ParamBinary -ParamBinary :: Binary -> ParamBinary -[unParamBinary] :: ParamBinary -> Binary -newtype ParamDate -ParamDate :: Date -> ParamDate -[unParamDate] :: ParamDate -> Date -newtype ParamDateTime -ParamDateTime :: DateTime -> ParamDateTime -[unParamDateTime] :: ParamDateTime -> DateTime -newtype ParamDouble -ParamDouble :: Double -> ParamDouble -[unParamDouble] :: ParamDouble -> Double -newtype ParamFloat -ParamFloat :: Float -> ParamFloat -[unParamFloat] :: ParamFloat -> Float -newtype ParamInteger -ParamInteger :: Int -> ParamInteger -[unParamInteger] :: ParamInteger -> Int -newtype ParamString -ParamString :: Text -> ParamString -[unParamString] :: ParamString -> Text -newtype Password -Password :: Text -> Password -[unPassword] :: Password -> Text -newtype PatternWithoutDelimiter -PatternWithoutDelimiter :: Text -> PatternWithoutDelimiter -[unPatternWithoutDelimiter] :: PatternWithoutDelimiter -> Text -newtype PetId -PetId :: Integer -> PetId -[unPetId] :: PetId -> Integer -newtype Status -Status :: [E'Status2] -> Status -[unStatus] :: Status -> [E'Status2] -newtype StatusText -StatusText :: Text -> StatusText -[unStatusText] :: StatusText -> Text -newtype Tags -Tags :: [Text] -> Tags -[unTags] :: Tags -> [Text] -newtype Username -Username :: Text -> Username -[unUsername] :: Username -> Text -data AuthApiKeyApiKey - --- | secret -AuthApiKeyApiKey :: Text -> AuthApiKeyApiKey -data AuthApiKeyApiKeyQuery - --- | secret -AuthApiKeyApiKeyQuery :: Text -> AuthApiKeyApiKeyQuery -data AuthBasicHttpBasicTest - --- | username password -AuthBasicHttpBasicTest :: ByteString -> ByteString -> AuthBasicHttpBasicTest -data AuthOAuthPetstoreAuth +instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.AnotherFake.TestSpecialTags SwaggerPetstore.Model.Client +instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.AnotherFake.TestSpecialTags SwaggerPetstore.MimeTypes.MimeJSON +instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.AnotherFake.TestSpecialTags SwaggerPetstore.MimeTypes.MimeJSON --- | secret -AuthOAuthPetstoreAuth :: Text -> AuthOAuthPetstoreAuth -data MimeJsonCharsetutf8 -MimeJsonCharsetutf8 :: MimeJsonCharsetutf8 --- |
---   application/json; charset=utf-8
---   
-data MimeXmlCharsetutf8 -MimeXmlCharsetutf8 :: MimeXmlCharsetutf8 - --- |
---   application/xml; charset=utf-8
---   
-instance GHC.Show.Show SwaggerPetstore.API.AuthOAuthPetstoreAuth -instance GHC.Classes.Eq SwaggerPetstore.API.AuthOAuthPetstoreAuth -instance GHC.Show.Show SwaggerPetstore.API.AuthBasicHttpBasicTest -instance GHC.Classes.Eq SwaggerPetstore.API.AuthBasicHttpBasicTest -instance GHC.Show.Show SwaggerPetstore.API.AuthApiKeyApiKeyQuery -instance GHC.Classes.Eq SwaggerPetstore.API.AuthApiKeyApiKeyQuery -instance GHC.Show.Show SwaggerPetstore.API.AuthApiKeyApiKey -instance GHC.Classes.Eq SwaggerPetstore.API.AuthApiKeyApiKey -instance GHC.Show.Show SwaggerPetstore.API.Username -instance GHC.Classes.Eq SwaggerPetstore.API.Username -instance GHC.Show.Show SwaggerPetstore.API.Tags -instance GHC.Classes.Eq SwaggerPetstore.API.Tags -instance GHC.Show.Show SwaggerPetstore.API.StatusText -instance GHC.Classes.Eq SwaggerPetstore.API.StatusText -instance GHC.Show.Show SwaggerPetstore.API.Status -instance GHC.Classes.Eq SwaggerPetstore.API.Status -instance GHC.Show.Show SwaggerPetstore.API.PetId -instance GHC.Classes.Eq SwaggerPetstore.API.PetId -instance GHC.Show.Show SwaggerPetstore.API.PatternWithoutDelimiter -instance GHC.Classes.Eq SwaggerPetstore.API.PatternWithoutDelimiter -instance GHC.Show.Show SwaggerPetstore.API.Password -instance GHC.Classes.Eq SwaggerPetstore.API.Password -instance GHC.Show.Show SwaggerPetstore.API.ParamString -instance GHC.Classes.Eq SwaggerPetstore.API.ParamString -instance GHC.Show.Show SwaggerPetstore.API.ParamInteger -instance GHC.Classes.Eq SwaggerPetstore.API.ParamInteger -instance GHC.Show.Show SwaggerPetstore.API.ParamFloat -instance GHC.Classes.Eq SwaggerPetstore.API.ParamFloat -instance GHC.Show.Show SwaggerPetstore.API.ParamDouble -instance GHC.Classes.Eq SwaggerPetstore.API.ParamDouble -instance GHC.Show.Show SwaggerPetstore.API.ParamDateTime -instance GHC.Classes.Eq SwaggerPetstore.API.ParamDateTime -instance GHC.Show.Show SwaggerPetstore.API.ParamDate -instance GHC.Classes.Eq SwaggerPetstore.API.ParamDate -instance GHC.Show.Show SwaggerPetstore.API.ParamBinary -instance GHC.Classes.Eq SwaggerPetstore.API.ParamBinary -instance GHC.Show.Show SwaggerPetstore.API.Param2 -instance GHC.Classes.Eq SwaggerPetstore.API.Param2 -instance GHC.Show.Show SwaggerPetstore.API.Param -instance GHC.Classes.Eq SwaggerPetstore.API.Param -instance GHC.Show.Show SwaggerPetstore.API.OrderIdText -instance GHC.Classes.Eq SwaggerPetstore.API.OrderIdText -instance GHC.Show.Show SwaggerPetstore.API.OrderId -instance GHC.Classes.Eq SwaggerPetstore.API.OrderId -instance GHC.Show.Show SwaggerPetstore.API.Number -instance GHC.Classes.Eq SwaggerPetstore.API.Number -instance GHC.Show.Show SwaggerPetstore.API.Name2 -instance GHC.Classes.Eq SwaggerPetstore.API.Name2 -instance GHC.Show.Show SwaggerPetstore.API.Int64 -instance GHC.Classes.Eq SwaggerPetstore.API.Int64 -instance GHC.Show.Show SwaggerPetstore.API.Int32 -instance GHC.Classes.Eq SwaggerPetstore.API.Int32 -instance GHC.Show.Show SwaggerPetstore.API.File -instance GHC.Classes.Eq SwaggerPetstore.API.File -instance GHC.Show.Show SwaggerPetstore.API.EnumQueryStringArray -instance GHC.Classes.Eq SwaggerPetstore.API.EnumQueryStringArray -instance GHC.Show.Show SwaggerPetstore.API.EnumQueryString -instance GHC.Classes.Eq SwaggerPetstore.API.EnumQueryString -instance GHC.Show.Show SwaggerPetstore.API.EnumQueryInteger -instance GHC.Classes.Eq SwaggerPetstore.API.EnumQueryInteger -instance GHC.Show.Show SwaggerPetstore.API.EnumQueryDouble -instance GHC.Classes.Eq SwaggerPetstore.API.EnumQueryDouble -instance GHC.Show.Show SwaggerPetstore.API.EnumHeaderStringArray -instance GHC.Classes.Eq SwaggerPetstore.API.EnumHeaderStringArray -instance GHC.Show.Show SwaggerPetstore.API.EnumHeaderString -instance GHC.Classes.Eq SwaggerPetstore.API.EnumHeaderString -instance GHC.Show.Show SwaggerPetstore.API.EnumFormStringArray -instance GHC.Classes.Eq SwaggerPetstore.API.EnumFormStringArray -instance GHC.Show.Show SwaggerPetstore.API.EnumFormString -instance GHC.Classes.Eq SwaggerPetstore.API.EnumFormString -instance GHC.Show.Show SwaggerPetstore.API.Callback -instance GHC.Classes.Eq SwaggerPetstore.API.Callback -instance GHC.Show.Show SwaggerPetstore.API.Byte -instance GHC.Classes.Eq SwaggerPetstore.API.Byte -instance Data.Aeson.Types.ToJSON.ToJSON SwaggerPetstore.API.Body -instance GHC.Show.Show SwaggerPetstore.API.Body -instance GHC.Classes.Eq SwaggerPetstore.API.Body -instance GHC.Show.Show SwaggerPetstore.API.ApiKey -instance GHC.Classes.Eq SwaggerPetstore.API.ApiKey -instance GHC.Show.Show SwaggerPetstore.API.AdditionalMetadata -instance GHC.Classes.Eq SwaggerPetstore.API.AdditionalMetadata -instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.TestEndpointParameters SwaggerPetstore.API.MimeXmlCharsetutf8 -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.TestEndpointParameters SwaggerPetstore.API.MimeXmlCharsetutf8 -instance SwaggerPetstore.MimeTypes.MimeType SwaggerPetstore.API.MimeXmlCharsetutf8 -instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.TestEndpointParameters SwaggerPetstore.API.MimeJsonCharsetutf8 -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.TestEndpointParameters SwaggerPetstore.API.MimeJsonCharsetutf8 -instance SwaggerPetstore.MimeTypes.MimeType SwaggerPetstore.API.MimeJsonCharsetutf8 -instance Data.Aeson.Types.ToJSON.ToJSON a => SwaggerPetstore.MimeTypes.MimeRender SwaggerPetstore.API.MimeJsonCharsetutf8 a -instance Data.Aeson.Types.FromJSON.FromJSON a => SwaggerPetstore.MimeTypes.MimeUnrender SwaggerPetstore.API.MimeJsonCharsetutf8 a -instance SwaggerPetstore.Core.AuthMethod SwaggerPetstore.API.AuthOAuthPetstoreAuth -instance SwaggerPetstore.Core.AuthMethod SwaggerPetstore.API.AuthBasicHttpBasicTest -instance SwaggerPetstore.Core.AuthMethod SwaggerPetstore.API.AuthApiKeyApiKeyQuery -instance SwaggerPetstore.Core.AuthMethod SwaggerPetstore.API.AuthApiKeyApiKey -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.UpdatePetWithForm SwaggerPetstore.API.StatusText -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEndpointParameters SwaggerPetstore.API.Password -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEndpointParameters SwaggerPetstore.API.ParamString -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEndpointParameters SwaggerPetstore.API.ParamInteger -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEndpointParameters SwaggerPetstore.API.ParamFloat -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEndpointParameters SwaggerPetstore.API.ParamDateTime -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEndpointParameters SwaggerPetstore.API.ParamDate -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEndpointParameters SwaggerPetstore.API.ParamBinary -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.UpdatePetWithForm SwaggerPetstore.API.Name2 -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEndpointParameters SwaggerPetstore.API.Int64 -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEndpointParameters SwaggerPetstore.API.Int32 -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.UploadFile SwaggerPetstore.API.File -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEnumParameters SwaggerPetstore.API.EnumQueryStringArray -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEnumParameters SwaggerPetstore.API.EnumQueryString -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEnumParameters SwaggerPetstore.API.EnumQueryInteger -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEnumParameters SwaggerPetstore.API.EnumQueryDouble -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEnumParameters SwaggerPetstore.API.EnumHeaderStringArray -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEnumParameters SwaggerPetstore.API.EnumHeaderString -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEnumParameters SwaggerPetstore.API.EnumFormStringArray -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEnumParameters SwaggerPetstore.API.EnumFormString -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.TestEndpointParameters SwaggerPetstore.API.Callback -instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.CreateUsersWithArrayInput SwaggerPetstore.API.Body -instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.CreateUsersWithListInput SwaggerPetstore.API.Body -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.DeletePet SwaggerPetstore.API.ApiKey -instance SwaggerPetstore.Core.HasOptionalParam SwaggerPetstore.API.UploadFile SwaggerPetstore.API.AdditionalMetadata -instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.UpdateUser SwaggerPetstore.Model.User -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.UpdateUser SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.UpdateUser SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.LogoutUser SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.LogoutUser SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.LoginUser SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.LoginUser SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.GetUserByName SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.GetUserByName SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.DeleteUser SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.DeleteUser SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.CreateUsersWithListInput SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.CreateUsersWithListInput SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.CreateUsersWithArrayInput SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.CreateUsersWithArrayInput SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.CreateUser SwaggerPetstore.Model.User -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.CreateUser SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.CreateUser SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.PlaceOrder SwaggerPetstore.Model.Order -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.PlaceOrder SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.PlaceOrder SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.GetOrderById SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.GetOrderById SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.GetInventory SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.DeleteOrder SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.DeleteOrder SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.UploadFile SwaggerPetstore.MimeTypes.MimeMultipartFormData -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.UploadFile SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.UpdatePetWithForm SwaggerPetstore.MimeTypes.MimeFormUrlEncoded -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.UpdatePetWithForm SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.UpdatePetWithForm SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.UpdatePet SwaggerPetstore.Model.Pet -instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.UpdatePet SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.UpdatePet SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.UpdatePet SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.UpdatePet SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.GetPetById SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.GetPetById SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.FindPetsByTags SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.FindPetsByTags SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.FindPetsByStatus SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.FindPetsByStatus SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.DeletePet SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.DeletePet SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.AddPet SwaggerPetstore.Model.Pet -instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.AddPet SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.AddPet SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.AddPet SwaggerPetstore.MimeTypes.MimeXML -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.AddPet SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.TestClassname SwaggerPetstore.Model.Client -instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.TestClassname SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.TestClassname SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.TestJsonFormData SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.TestInlineAdditionalProperties Data.Aeson.Types.Internal.Value -instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.TestInlineAdditionalProperties SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.TestEnumParameters SwaggerPetstore.MimeTypes.MimeAny -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.TestEnumParameters SwaggerPetstore.MimeTypes.MimeAny -instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.TestClientModel SwaggerPetstore.Model.Client -instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.TestClientModel SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.TestClientModel SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.FakeOuterStringSerialize SwaggerPetstore.Model.OuterString -instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.FakeOuterNumberSerialize SwaggerPetstore.Model.OuterNumber -instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.FakeOuterCompositeSerialize SwaggerPetstore.Model.OuterComposite -instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.FakeOuterBooleanSerialize SwaggerPetstore.Model.OuterBoolean -instance SwaggerPetstore.Core.HasBodyParam SwaggerPetstore.API.TestSpecialTags SwaggerPetstore.Model.Client -instance SwaggerPetstore.MimeTypes.Consumes SwaggerPetstore.API.TestSpecialTags SwaggerPetstore.MimeTypes.MimeJSON -instance SwaggerPetstore.MimeTypes.Produces SwaggerPetstore.API.TestSpecialTags SwaggerPetstore.MimeTypes.MimeJSON +module SwaggerPetstore.API module SwaggerPetstore.ModelLens diff --git a/samples/client/petstore/haskell-http-client/example-app/package.yaml b/samples/client/petstore/haskell-http-client/example-app/package.yaml index d77a45b3178..5ab89ba3df9 100644 --- a/samples/client/petstore/haskell-http-client/example-app/package.yaml +++ b/samples/client/petstore/haskell-http-client/example-app/package.yaml @@ -21,7 +21,7 @@ dependencies: - containers >=0.5.0.0 && <0.6 - aeson >=1.0 && <2.0 - bytestring >=0.10.0 && <0.11 -- http-types >=0.8 && <0.10 +- http-types >=0.8 && <0.12 - http-client >=0.5 && <0.6 - http-client-tls - http-api-data >= 0.3.4 && <0.4 diff --git a/samples/client/petstore/haskell-http-client/example-app/swagger-petstore-app.cabal b/samples/client/petstore/haskell-http-client/example-app/swagger-petstore-app.cabal index 4e2e35b8625..a48e61b735f 100644 --- a/samples/client/petstore/haskell-http-client/example-app/swagger-petstore-app.cabal +++ b/samples/client/petstore/haskell-http-client/example-app/swagger-petstore-app.cabal @@ -2,7 +2,7 @@ -- -- see: https://github.com/sol/hpack -- --- hash: 6233ad93037d69c4bbb5f6f8e45ea1d080dbbe33175102b471d19e5b32691ca2 +-- hash: 0a40afd0e6e2b593c40ae1588479e70d4f35af6ece13bf83bdf3c166c5ea4e7b name: swagger-petstore-app version: 0.1.0.0 @@ -33,7 +33,7 @@ executable swagger-petstore-app , http-client >=0.5 && <0.6 , http-client-tls , http-media >=0.4 && <0.8 - , http-types >=0.8 && <0.10 + , http-types >=0.8 && <0.12 , microlens >=0.4.3 && <0.5 , mtl >=2.2.1 , swagger-petstore diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs index 432badda01d..884fce66859 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs @@ -14,7 +14,7 @@ Module : SwaggerPetstore -} module SwaggerPetstore - ( module SwaggerPetstore.API + ( module SwaggerPetstore.API , module SwaggerPetstore.Client , module SwaggerPetstore.Core , module SwaggerPetstore.Logging @@ -29,4 +29,4 @@ import SwaggerPetstore.Core import SwaggerPetstore.Logging import SwaggerPetstore.MimeTypes import SwaggerPetstore.Model -import SwaggerPetstore.ModelLens +import SwaggerPetstore.ModelLens \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API.hs index 72cacd2ab60..6b7f0759dec 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API.hs @@ -13,1149 +13,18 @@ Module : SwaggerPetstore.API -} -{-# LANGUAGE ConstraintKinds #-} -{-# LANGUAGE ExistentialQuantification #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE InstanceSigs #-} -{-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} - -module SwaggerPetstore.API where - -import SwaggerPetstore.Core -import SwaggerPetstore.MimeTypes -import SwaggerPetstore.Model as M - -import qualified Data.Aeson as A -import qualified Data.ByteString as B -import qualified Data.ByteString.Base64 as B64 -import qualified Data.ByteString.Char8 as BC -import qualified Data.ByteString.Lazy as BL -import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) -import qualified Data.Foldable as P -import qualified Data.Map as Map -import qualified Data.Maybe as P -import qualified Data.Proxy as P (Proxy(..)) -import qualified Data.Set as Set -import qualified Data.String as P -import qualified Data.Text as T -import qualified Data.Text.Encoding as T -import qualified Data.Text.Lazy as TL -import qualified Data.Text.Lazy.Encoding as TL -import qualified Data.Time as TI -import qualified GHC.Base as P (Alternative) -import qualified Lens.Micro as L -import qualified Network.HTTP.Client.MultipartFormData as NH -import qualified Network.HTTP.Media as ME -import qualified Network.HTTP.Types as NH -import qualified Web.FormUrlEncoded as WH -import qualified Web.HttpApiData as WH - -import Data.Monoid ((<>)) -import Data.Function ((&)) -import Data.Text (Text) -import GHC.Base ((<|>)) - -import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) -import qualified Prelude as P - --- * Operations - - --- ** AnotherFake - --- *** testSpecialTags - --- | @PATCH \/another-fake\/dummy@ --- --- To test special tags --- --- To test special tags --- -testSpecialTags - :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Client -- ^ "body" - client model - -> SwaggerPetstoreRequest TestSpecialTags contentType Client accept -testSpecialTags _ _ body = - _mkRequest "PATCH" ["/another-fake/dummy"] - `setBodyParam` body - -data TestSpecialTags - --- | /Body Param/ "body" - client model -instance HasBodyParam TestSpecialTags Client - --- | @application/json@ -instance Consumes TestSpecialTags MimeJSON - --- | @application/json@ -instance Produces TestSpecialTags MimeJSON - - --- ** Fake - --- *** fakeOuterBooleanSerialize - --- | @POST \/fake\/outer\/boolean@ --- --- Test serialization of outer boolean types --- -fakeOuterBooleanSerialize - :: (Consumes FakeOuterBooleanSerialize contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> SwaggerPetstoreRequest FakeOuterBooleanSerialize contentType OuterBoolean accept -fakeOuterBooleanSerialize _ _ = - _mkRequest "POST" ["/fake/outer/boolean"] - -data FakeOuterBooleanSerialize - --- | /Body Param/ "body" - Input boolean as post body -instance HasBodyParam FakeOuterBooleanSerialize OuterBoolean - --- *** fakeOuterCompositeSerialize - --- | @POST \/fake\/outer\/composite@ --- --- Test serialization of object with outer number type --- -fakeOuterCompositeSerialize - :: (Consumes FakeOuterCompositeSerialize contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> SwaggerPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite accept -fakeOuterCompositeSerialize _ _ = - _mkRequest "POST" ["/fake/outer/composite"] - -data FakeOuterCompositeSerialize - --- | /Body Param/ "body" - Input composite as post body -instance HasBodyParam FakeOuterCompositeSerialize OuterComposite - --- *** fakeOuterNumberSerialize - --- | @POST \/fake\/outer\/number@ --- --- Test serialization of outer number types --- -fakeOuterNumberSerialize - :: (Consumes FakeOuterNumberSerialize contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> SwaggerPetstoreRequest FakeOuterNumberSerialize contentType OuterNumber accept -fakeOuterNumberSerialize _ _ = - _mkRequest "POST" ["/fake/outer/number"] - -data FakeOuterNumberSerialize - --- | /Body Param/ "body" - Input number as post body -instance HasBodyParam FakeOuterNumberSerialize OuterNumber - --- *** fakeOuterStringSerialize - --- | @POST \/fake\/outer\/string@ --- --- Test serialization of outer string types --- -fakeOuterStringSerialize - :: (Consumes FakeOuterStringSerialize contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> SwaggerPetstoreRequest FakeOuterStringSerialize contentType OuterString accept -fakeOuterStringSerialize _ _ = - _mkRequest "POST" ["/fake/outer/string"] - -data FakeOuterStringSerialize - --- | /Body Param/ "body" - Input string as post body -instance HasBodyParam FakeOuterStringSerialize OuterString - --- *** testClientModel - --- | @PATCH \/fake@ --- --- To test \"client\" model --- --- To test \"client\" model --- -testClientModel - :: (Consumes TestClientModel contentType, MimeRender contentType Client) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Client -- ^ "body" - client model - -> SwaggerPetstoreRequest TestClientModel contentType Client accept -testClientModel _ _ body = - _mkRequest "PATCH" ["/fake"] - `setBodyParam` body - -data TestClientModel - --- | /Body Param/ "body" - client model -instance HasBodyParam TestClientModel Client - --- | @application/json@ -instance Consumes TestClientModel MimeJSON - --- | @application/json@ -instance Produces TestClientModel MimeJSON - - --- *** testEndpointParameters - --- | @POST \/fake@ --- --- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 --- --- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 --- --- AuthMethod: 'AuthBasicHttpBasicTest' --- --- Note: Has 'Produces' instances, but no response schema --- -testEndpointParameters - :: (Consumes TestEndpointParameters contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Number -- ^ "number" - None - -> ParamDouble -- ^ "double" - None - -> PatternWithoutDelimiter -- ^ "patternWithoutDelimiter" - None - -> Byte -- ^ "byte" - None - -> SwaggerPetstoreRequest TestEndpointParameters contentType res accept -testEndpointParameters _ _ (Number number) (ParamDouble double) (PatternWithoutDelimiter patternWithoutDelimiter) (Byte byte) = - _mkRequest "POST" ["/fake"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicHttpBasicTest) - `addForm` toForm ("number", number) - `addForm` toForm ("double", double) - `addForm` toForm ("pattern_without_delimiter", patternWithoutDelimiter) - `addForm` toForm ("byte", byte) - -data TestEndpointParameters - --- | /Optional Param/ "integer" - None -instance HasOptionalParam TestEndpointParameters ParamInteger where - applyOptionalParam req (ParamInteger xs) = - req `addForm` toForm ("integer", xs) - --- | /Optional Param/ "int32" - None -instance HasOptionalParam TestEndpointParameters Int32 where - applyOptionalParam req (Int32 xs) = - req `addForm` toForm ("int32", xs) - --- | /Optional Param/ "int64" - None -instance HasOptionalParam TestEndpointParameters Int64 where - applyOptionalParam req (Int64 xs) = - req `addForm` toForm ("int64", xs) - --- | /Optional Param/ "float" - None -instance HasOptionalParam TestEndpointParameters ParamFloat where - applyOptionalParam req (ParamFloat xs) = - req `addForm` toForm ("float", xs) - --- | /Optional Param/ "string" - None -instance HasOptionalParam TestEndpointParameters ParamString where - applyOptionalParam req (ParamString xs) = - req `addForm` toForm ("string", xs) - --- | /Optional Param/ "binary" - None -instance HasOptionalParam TestEndpointParameters ParamBinary where - applyOptionalParam req (ParamBinary xs) = - req `addForm` toForm ("binary", xs) - --- | /Optional Param/ "date" - None -instance HasOptionalParam TestEndpointParameters ParamDate where - applyOptionalParam req (ParamDate xs) = - req `addForm` toForm ("date", xs) - --- | /Optional Param/ "dateTime" - None -instance HasOptionalParam TestEndpointParameters ParamDateTime where - applyOptionalParam req (ParamDateTime xs) = - req `addForm` toForm ("dateTime", xs) - --- | /Optional Param/ "password" - None -instance HasOptionalParam TestEndpointParameters Password where - applyOptionalParam req (Password xs) = - req `addForm` toForm ("password", xs) - --- | /Optional Param/ "callback" - None -instance HasOptionalParam TestEndpointParameters Callback where - applyOptionalParam req (Callback xs) = - req `addForm` toForm ("callback", xs) - --- | @application/xml; charset=utf-8@ -instance Consumes TestEndpointParameters MimeXmlCharsetutf8 --- | @application/json; charset=utf-8@ -instance Consumes TestEndpointParameters MimeJsonCharsetutf8 - --- | @application/xml; charset=utf-8@ -instance Produces TestEndpointParameters MimeXmlCharsetutf8 --- | @application/json; charset=utf-8@ -instance Produces TestEndpointParameters MimeJsonCharsetutf8 - - --- *** testEnumParameters - --- | @GET \/fake@ --- --- To test enum parameters --- --- To test enum parameters --- --- Note: Has 'Produces' instances, but no response schema --- -testEnumParameters - :: (Consumes TestEnumParameters contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> SwaggerPetstoreRequest TestEnumParameters contentType res accept -testEnumParameters _ _ = - _mkRequest "GET" ["/fake"] - -data TestEnumParameters - --- | /Optional Param/ "enum_form_string_array" - Form parameter enum test (string array) -instance HasOptionalParam TestEnumParameters EnumFormStringArray where - applyOptionalParam req (EnumFormStringArray xs) = - req `addForm` toFormColl CommaSeparated ("enum_form_string_array", xs) - --- | /Optional Param/ "enum_form_string" - Form parameter enum test (string) -instance HasOptionalParam TestEnumParameters EnumFormString where - applyOptionalParam req (EnumFormString xs) = - req `addForm` toForm ("enum_form_string", xs) - --- | /Optional Param/ "enum_header_string_array" - Header parameter enum test (string array) -instance HasOptionalParam TestEnumParameters EnumHeaderStringArray where - applyOptionalParam req (EnumHeaderStringArray xs) = - req `setHeader` toHeaderColl CommaSeparated ("enum_header_string_array", xs) - --- | /Optional Param/ "enum_header_string" - Header parameter enum test (string) -instance HasOptionalParam TestEnumParameters EnumHeaderString where - applyOptionalParam req (EnumHeaderString xs) = - req `setHeader` toHeader ("enum_header_string", xs) - --- | /Optional Param/ "enum_query_string_array" - Query parameter enum test (string array) -instance HasOptionalParam TestEnumParameters EnumQueryStringArray where - applyOptionalParam req (EnumQueryStringArray xs) = - req `setQuery` toQueryColl CommaSeparated ("enum_query_string_array", Just xs) - --- | /Optional Param/ "enum_query_string" - Query parameter enum test (string) -instance HasOptionalParam TestEnumParameters EnumQueryString where - applyOptionalParam req (EnumQueryString xs) = - req `setQuery` toQuery ("enum_query_string", Just xs) - --- | /Optional Param/ "enum_query_integer" - Query parameter enum test (double) -instance HasOptionalParam TestEnumParameters EnumQueryInteger where - applyOptionalParam req (EnumQueryInteger xs) = - req `setQuery` toQuery ("enum_query_integer", Just xs) - --- | /Optional Param/ "enum_query_double" - Query parameter enum test (double) -instance HasOptionalParam TestEnumParameters EnumQueryDouble where - applyOptionalParam req (EnumQueryDouble xs) = - req `addForm` toForm ("enum_query_double", xs) - --- | @*/*@ -instance Consumes TestEnumParameters MimeAny - --- | @*/*@ -instance Produces TestEnumParameters MimeAny - - --- *** testInlineAdditionalProperties - --- | @POST \/fake\/inline-additionalProperties@ --- --- test inline additionalProperties --- --- --- -testInlineAdditionalProperties - :: (Consumes TestInlineAdditionalProperties contentType, MimeRender contentType A.Value) - => ContentType contentType -- ^ request content-type ('MimeType') - -> A.Value -- ^ "param" - request body - -> SwaggerPetstoreRequest TestInlineAdditionalProperties contentType NoContent MimeNoContent -testInlineAdditionalProperties _ param = - _mkRequest "POST" ["/fake/inline-additionalProperties"] - `setBodyParam` param - -data TestInlineAdditionalProperties - --- | /Body Param/ "param" - request body -instance HasBodyParam TestInlineAdditionalProperties A.Value - --- | @application/json@ -instance Consumes TestInlineAdditionalProperties MimeJSON - - --- *** testJsonFormData - --- | @GET \/fake\/jsonFormData@ --- --- test json serialization of form data --- --- --- -testJsonFormData - :: (Consumes TestJsonFormData contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Param -- ^ "param" - field1 - -> Param2 -- ^ "param2" - field2 - -> SwaggerPetstoreRequest TestJsonFormData contentType NoContent MimeNoContent -testJsonFormData _ (Param param) (Param2 param2) = - _mkRequest "GET" ["/fake/jsonFormData"] - `addForm` toForm ("param", param) - `addForm` toForm ("param2", param2) - -data TestJsonFormData - --- | @application/json@ -instance Consumes TestJsonFormData MimeJSON - - --- ** FakeClassnameTags123 - --- *** testClassname - --- | @PATCH \/fake_classname_test@ --- --- To test class name in snake case --- --- AuthMethod: 'AuthApiKeyApiKeyQuery' --- -testClassname - :: (Consumes TestClassname contentType, MimeRender contentType Client) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Client -- ^ "body" - client model - -> SwaggerPetstoreRequest TestClassname contentType Client accept -testClassname _ _ body = - _mkRequest "PATCH" ["/fake_classname_test"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKeyQuery) - `setBodyParam` body - -data TestClassname - --- | /Body Param/ "body" - client model -instance HasBodyParam TestClassname Client - --- | @application/json@ -instance Consumes TestClassname MimeJSON - --- | @application/json@ -instance Produces TestClassname MimeJSON - - --- ** Pet - --- *** addPet - --- | @POST \/pet@ --- --- Add a new pet to the store --- --- --- --- AuthMethod: 'AuthOAuthPetstoreAuth' --- --- Note: Has 'Produces' instances, but no response schema --- -addPet - :: (Consumes AddPet contentType, MimeRender contentType Pet) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest AddPet contentType res accept -addPet _ _ body = - _mkRequest "POST" ["/pet"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setBodyParam` body - -data AddPet - --- | /Body Param/ "body" - Pet object that needs to be added to the store -instance HasBodyParam AddPet Pet - --- | @application/json@ -instance Consumes AddPet MimeJSON --- | @application/xml@ -instance Consumes AddPet MimeXML - --- | @application/xml@ -instance Produces AddPet MimeXML --- | @application/json@ -instance Produces AddPet MimeJSON - - --- *** deletePet - --- | @DELETE \/pet\/{petId}@ --- --- Deletes a pet --- --- --- --- AuthMethod: 'AuthOAuthPetstoreAuth' --- --- Note: Has 'Produces' instances, but no response schema --- -deletePet - :: Accept accept -- ^ request accept ('MimeType') - -> PetId -- ^ "petId" - Pet id to delete - -> SwaggerPetstoreRequest DeletePet MimeNoContent res accept -deletePet _ (PetId petId) = - _mkRequest "DELETE" ["/pet/",toPath petId] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - -data DeletePet -instance HasOptionalParam DeletePet ApiKey where - applyOptionalParam req (ApiKey xs) = - req `setHeader` toHeader ("api_key", xs) --- | @application/xml@ -instance Produces DeletePet MimeXML --- | @application/json@ -instance Produces DeletePet MimeJSON - - --- *** findPetsByStatus - --- | @GET \/pet\/findByStatus@ --- --- Finds Pets by status --- --- Multiple status values can be provided with comma separated strings --- --- AuthMethod: 'AuthOAuthPetstoreAuth' --- -findPetsByStatus - :: Accept accept -- ^ request accept ('MimeType') - -> Status -- ^ "status" - Status values that need to be considered for filter - -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] accept -findPetsByStatus _ (Status status) = - _mkRequest "GET" ["/pet/findByStatus"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setQuery` toQueryColl CommaSeparated ("status", Just status) - -data FindPetsByStatus --- | @application/xml@ -instance Produces FindPetsByStatus MimeXML --- | @application/json@ -instance Produces FindPetsByStatus MimeJSON - - --- *** findPetsByTags - --- | @GET \/pet\/findByTags@ --- --- Finds Pets by tags --- --- Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. --- --- AuthMethod: 'AuthOAuthPetstoreAuth' --- -findPetsByTags - :: Accept accept -- ^ request accept ('MimeType') - -> Tags -- ^ "tags" - Tags to filter by - -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept -findPetsByTags _ (Tags tags) = - _mkRequest "GET" ["/pet/findByTags"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setQuery` toQueryColl CommaSeparated ("tags", Just tags) - -{-# DEPRECATED findPetsByTags "" #-} - -data FindPetsByTags --- | @application/xml@ -instance Produces FindPetsByTags MimeXML --- | @application/json@ -instance Produces FindPetsByTags MimeJSON - - --- *** getPetById - --- | @GET \/pet\/{petId}@ --- --- Find pet by ID --- --- Returns a single pet --- --- AuthMethod: 'AuthApiKeyApiKey' --- -getPetById - :: Accept accept -- ^ request accept ('MimeType') - -> PetId -- ^ "petId" - ID of pet to return - -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet accept -getPetById _ (PetId petId) = - _mkRequest "GET" ["/pet/",toPath petId] - `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey) - -data GetPetById --- | @application/xml@ -instance Produces GetPetById MimeXML --- | @application/json@ -instance Produces GetPetById MimeJSON - - --- *** updatePet - --- | @PUT \/pet@ --- --- Update an existing pet --- --- --- --- AuthMethod: 'AuthOAuthPetstoreAuth' --- --- Note: Has 'Produces' instances, but no response schema --- -updatePet - :: (Consumes UpdatePet contentType, MimeRender contentType Pet) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Pet -- ^ "body" - Pet object that needs to be added to the store - -> SwaggerPetstoreRequest UpdatePet contentType res accept -updatePet _ _ body = - _mkRequest "PUT" ["/pet"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setBodyParam` body - -data UpdatePet - --- | /Body Param/ "body" - Pet object that needs to be added to the store -instance HasBodyParam UpdatePet Pet - --- | @application/json@ -instance Consumes UpdatePet MimeJSON --- | @application/xml@ -instance Consumes UpdatePet MimeXML - --- | @application/xml@ -instance Produces UpdatePet MimeXML --- | @application/json@ -instance Produces UpdatePet MimeJSON - - --- *** updatePetWithForm - --- | @POST \/pet\/{petId}@ --- --- Updates a pet in the store with form data --- --- --- --- AuthMethod: 'AuthOAuthPetstoreAuth' --- --- Note: Has 'Produces' instances, but no response schema --- -updatePetWithForm - :: (Consumes UpdatePetWithForm contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> PetId -- ^ "petId" - ID of pet that needs to be updated - -> SwaggerPetstoreRequest UpdatePetWithForm contentType res accept -updatePetWithForm _ _ (PetId petId) = - _mkRequest "POST" ["/pet/",toPath petId] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - -data UpdatePetWithForm - --- | /Optional Param/ "name" - Updated name of the pet -instance HasOptionalParam UpdatePetWithForm Name2 where - applyOptionalParam req (Name2 xs) = - req `addForm` toForm ("name", xs) - --- | /Optional Param/ "status" - Updated status of the pet -instance HasOptionalParam UpdatePetWithForm StatusText where - applyOptionalParam req (StatusText xs) = - req `addForm` toForm ("status", xs) - --- | @application/x-www-form-urlencoded@ -instance Consumes UpdatePetWithForm MimeFormUrlEncoded - --- | @application/xml@ -instance Produces UpdatePetWithForm MimeXML --- | @application/json@ -instance Produces UpdatePetWithForm MimeJSON - - --- *** uploadFile - --- | @POST \/pet\/{petId}\/uploadImage@ --- --- uploads an image --- --- --- --- AuthMethod: 'AuthOAuthPetstoreAuth' --- -uploadFile - :: (Consumes UploadFile contentType) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> PetId -- ^ "petId" - ID of pet to update - -> SwaggerPetstoreRequest UploadFile contentType ApiResponse accept -uploadFile _ _ (PetId petId) = - _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - -data UploadFile - --- | /Optional Param/ "additionalMetadata" - Additional data to pass to server -instance HasOptionalParam UploadFile AdditionalMetadata where - applyOptionalParam req (AdditionalMetadata xs) = - req `_addMultiFormPart` NH.partLBS "additionalMetadata" (mimeRender' MimeMultipartFormData xs) - --- | /Optional Param/ "file" - file to upload -instance HasOptionalParam UploadFile File where - applyOptionalParam req (File xs) = - req `_addMultiFormPart` NH.partFileSource "file" xs - --- | @multipart/form-data@ -instance Consumes UploadFile MimeMultipartFormData - --- | @application/json@ -instance Produces UploadFile MimeJSON - - --- ** Store - --- *** deleteOrder - --- | @DELETE \/store\/order\/{order_id}@ --- --- Delete purchase order by ID --- --- For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors --- --- Note: Has 'Produces' instances, but no response schema --- -deleteOrder - :: Accept accept -- ^ request accept ('MimeType') - -> OrderIdText -- ^ "orderId" - ID of the order that needs to be deleted - -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res accept -deleteOrder _ (OrderIdText orderId) = - _mkRequest "DELETE" ["/store/order/",toPath orderId] - -data DeleteOrder --- | @application/xml@ -instance Produces DeleteOrder MimeXML --- | @application/json@ -instance Produces DeleteOrder MimeJSON - - --- *** getInventory - --- | @GET \/store\/inventory@ --- --- Returns pet inventories by status --- --- Returns a map of status codes to quantities --- --- AuthMethod: 'AuthApiKeyApiKey' --- -getInventory - :: Accept accept -- ^ request accept ('MimeType') - -> SwaggerPetstoreRequest GetInventory MimeNoContent ((Map.Map String Int)) accept -getInventory _ = - _mkRequest "GET" ["/store/inventory"] - `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey) - -data GetInventory --- | @application/json@ -instance Produces GetInventory MimeJSON - - --- *** getOrderById - --- | @GET \/store\/order\/{order_id}@ --- --- Find purchase order by ID --- --- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions --- -getOrderById - :: Accept accept -- ^ request accept ('MimeType') - -> OrderId -- ^ "orderId" - ID of pet that needs to be fetched - -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order accept -getOrderById _ (OrderId orderId) = - _mkRequest "GET" ["/store/order/",toPath orderId] - -data GetOrderById --- | @application/xml@ -instance Produces GetOrderById MimeXML --- | @application/json@ -instance Produces GetOrderById MimeJSON - - --- *** placeOrder - --- | @POST \/store\/order@ --- --- Place an order for a pet --- --- --- -placeOrder - :: (Consumes PlaceOrder contentType, MimeRender contentType Order) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Order -- ^ "body" - order placed for purchasing the pet - -> SwaggerPetstoreRequest PlaceOrder contentType Order accept -placeOrder _ _ body = - _mkRequest "POST" ["/store/order"] - `setBodyParam` body - -data PlaceOrder - --- | /Body Param/ "body" - order placed for purchasing the pet -instance HasBodyParam PlaceOrder Order --- | @application/xml@ -instance Produces PlaceOrder MimeXML --- | @application/json@ -instance Produces PlaceOrder MimeJSON - - --- ** User - --- *** createUser - --- | @POST \/user@ --- --- Create user --- --- This can only be done by the logged in user. --- --- Note: Has 'Produces' instances, but no response schema --- -createUser - :: (Consumes CreateUser contentType, MimeRender contentType User) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> User -- ^ "body" - Created user object - -> SwaggerPetstoreRequest CreateUser contentType res accept -createUser _ _ body = - _mkRequest "POST" ["/user"] - `setBodyParam` body - -data CreateUser - --- | /Body Param/ "body" - Created user object -instance HasBodyParam CreateUser User --- | @application/xml@ -instance Produces CreateUser MimeXML --- | @application/json@ -instance Produces CreateUser MimeJSON - - --- *** createUsersWithArrayInput - --- | @POST \/user\/createWithArray@ --- --- Creates list of users with given input array --- --- --- --- Note: Has 'Produces' instances, but no response schema --- -createUsersWithArrayInput - :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Body -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res accept -createUsersWithArrayInput _ _ body = - _mkRequest "POST" ["/user/createWithArray"] - `setBodyParam` body - -data CreateUsersWithArrayInput - --- | /Body Param/ "body" - List of user object -instance HasBodyParam CreateUsersWithArrayInput Body --- | @application/xml@ -instance Produces CreateUsersWithArrayInput MimeXML --- | @application/json@ -instance Produces CreateUsersWithArrayInput MimeJSON - - --- *** createUsersWithListInput - --- | @POST \/user\/createWithList@ --- --- Creates list of users with given input array --- --- --- --- Note: Has 'Produces' instances, but no response schema --- -createUsersWithListInput - :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Body -- ^ "body" - List of user object - -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res accept -createUsersWithListInput _ _ body = - _mkRequest "POST" ["/user/createWithList"] - `setBodyParam` body - -data CreateUsersWithListInput - --- | /Body Param/ "body" - List of user object -instance HasBodyParam CreateUsersWithListInput Body --- | @application/xml@ -instance Produces CreateUsersWithListInput MimeXML --- | @application/json@ -instance Produces CreateUsersWithListInput MimeJSON - - --- *** deleteUser - --- | @DELETE \/user\/{username}@ --- --- Delete user --- --- This can only be done by the logged in user. --- --- Note: Has 'Produces' instances, but no response schema --- -deleteUser - :: Accept accept -- ^ request accept ('MimeType') - -> Username -- ^ "username" - The name that needs to be deleted - -> SwaggerPetstoreRequest DeleteUser MimeNoContent res accept -deleteUser _ (Username username) = - _mkRequest "DELETE" ["/user/",toPath username] - -data DeleteUser --- | @application/xml@ -instance Produces DeleteUser MimeXML --- | @application/json@ -instance Produces DeleteUser MimeJSON - - --- *** getUserByName - --- | @GET \/user\/{username}@ --- --- Get user by user name --- --- --- -getUserByName - :: Accept accept -- ^ request accept ('MimeType') - -> Username -- ^ "username" - The name that needs to be fetched. Use user1 for testing. - -> SwaggerPetstoreRequest GetUserByName MimeNoContent User accept -getUserByName _ (Username username) = - _mkRequest "GET" ["/user/",toPath username] - -data GetUserByName --- | @application/xml@ -instance Produces GetUserByName MimeXML --- | @application/json@ -instance Produces GetUserByName MimeJSON - - --- *** loginUser - --- | @GET \/user\/login@ --- --- Logs user into the system --- --- --- -loginUser - :: Accept accept -- ^ request accept ('MimeType') - -> Username -- ^ "username" - The user name for login - -> Password -- ^ "password" - The password for login in clear text - -> SwaggerPetstoreRequest LoginUser MimeNoContent Text accept -loginUser _ (Username username) (Password password) = - _mkRequest "GET" ["/user/login"] - `setQuery` toQuery ("username", Just username) - `setQuery` toQuery ("password", Just password) - -data LoginUser --- | @application/xml@ -instance Produces LoginUser MimeXML --- | @application/json@ -instance Produces LoginUser MimeJSON - - --- *** logoutUser - --- | @GET \/user\/logout@ --- --- Logs out current logged in user session --- --- --- --- Note: Has 'Produces' instances, but no response schema --- -logoutUser - :: Accept accept -- ^ request accept ('MimeType') - -> SwaggerPetstoreRequest LogoutUser MimeNoContent res accept -logoutUser _ = - _mkRequest "GET" ["/user/logout"] - -data LogoutUser --- | @application/xml@ -instance Produces LogoutUser MimeXML --- | @application/json@ -instance Produces LogoutUser MimeJSON - - --- *** updateUser - --- | @PUT \/user\/{username}@ --- --- Updated user --- --- This can only be done by the logged in user. --- --- Note: Has 'Produces' instances, but no response schema --- -updateUser - :: (Consumes UpdateUser contentType, MimeRender contentType User) - => ContentType contentType -- ^ request content-type ('MimeType') - -> Accept accept -- ^ request accept ('MimeType') - -> Username -- ^ "username" - name that need to be deleted - -> User -- ^ "body" - Updated user object - -> SwaggerPetstoreRequest UpdateUser contentType res accept -updateUser _ _ (Username username) body = - _mkRequest "PUT" ["/user/",toPath username] - `setBodyParam` body - -data UpdateUser - --- | /Body Param/ "body" - Updated user object -instance HasBodyParam UpdateUser User --- | @application/xml@ -instance Produces UpdateUser MimeXML --- | @application/json@ -instance Produces UpdateUser MimeJSON - - - --- * Parameter newtypes - -newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } deriving (P.Eq, P.Show) -newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show) -newtype Body = Body { unBody :: [User] } deriving (P.Eq, P.Show, A.ToJSON) -newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show) -newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show) -newtype EnumFormString = EnumFormString { unEnumFormString :: E'EnumFormString } deriving (P.Eq, P.Show) -newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [E'Inner2] } deriving (P.Eq, P.Show) -newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: E'EnumFormString } deriving (P.Eq, P.Show) -newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [E'Inner2] } deriving (P.Eq, P.Show) -newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: E'EnumNumber } deriving (P.Eq, P.Show) -newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: E'EnumQueryInteger } deriving (P.Eq, P.Show) -newtype EnumQueryString = EnumQueryString { unEnumQueryString :: E'EnumFormString } deriving (P.Eq, P.Show) -newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [E'Inner2] } deriving (P.Eq, P.Show) -newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show) -newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show) -newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show) -newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show) -newtype Number = Number { unNumber :: Double } deriving (P.Eq, P.Show) -newtype OrderId = OrderId { unOrderId :: Integer } deriving (P.Eq, P.Show) -newtype OrderIdText = OrderIdText { unOrderIdText :: Text } deriving (P.Eq, P.Show) -newtype Param = Param { unParam :: Text } deriving (P.Eq, P.Show) -newtype Param2 = Param2 { unParam2 :: Text } deriving (P.Eq, P.Show) -newtype ParamBinary = ParamBinary { unParamBinary :: Binary } deriving (P.Eq, P.Show) -newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show) -newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show) -newtype ParamDouble = ParamDouble { unParamDouble :: Double } deriving (P.Eq, P.Show) -newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show) -newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show) -newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show) -newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show) -newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDelimiter :: Text } deriving (P.Eq, P.Show) -newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show) -newtype Status = Status { unStatus :: [E'Status2] } deriving (P.Eq, P.Show) -newtype StatusText = StatusText { unStatusText :: Text } deriving (P.Eq, P.Show) -newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show) -newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show) - --- * Auth Methods - --- ** AuthApiKeyApiKey -data AuthApiKeyApiKey = - AuthApiKeyApiKey Text -- ^ secret - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthApiKeyApiKey where - applyAuthMethod _ a@(AuthApiKeyApiKey secret) req = - P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("api_key", secret) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - --- ** AuthApiKeyApiKeyQuery -data AuthApiKeyApiKeyQuery = - AuthApiKeyApiKeyQuery Text -- ^ secret - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthApiKeyApiKeyQuery where - applyAuthMethod _ a@(AuthApiKeyApiKeyQuery secret) req = - P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setQuery` toQuery ("api_key_query", Just secret) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - --- ** AuthBasicHttpBasicTest -data AuthBasicHttpBasicTest = - AuthBasicHttpBasicTest B.ByteString B.ByteString -- ^ username password - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthBasicHttpBasicTest where - applyAuthMethod _ a@(AuthBasicHttpBasicTest user pw) req = - P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ]) - --- ** AuthOAuthPetstoreAuth -data AuthOAuthPetstoreAuth = - AuthOAuthPetstoreAuth Text -- ^ secret - deriving (P.Eq, P.Show, P.Typeable) - -instance AuthMethod AuthOAuthPetstoreAuth where - applyAuthMethod _ a@(AuthOAuthPetstoreAuth secret) req = - P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - - - --- * Custom Mime Types - --- ** MimeJsonCharsetutf8 - -data MimeJsonCharsetutf8 = MimeJsonCharsetutf8 deriving (P.Typeable) - --- | @application/json; charset=utf-8@ -instance MimeType MimeJsonCharsetutf8 where - mimeType _ = Just $ P.fromString "application/json; charset=utf-8" -instance A.ToJSON a => MimeRender MimeJsonCharsetutf8 a where mimeRender _ = A.encode -instance A.FromJSON a => MimeUnrender MimeJsonCharsetutf8 a where mimeUnrender _ = A.eitherDecode --- instance MimeRender MimeJsonCharsetutf8 T.Text where mimeRender _ = undefined --- instance MimeUnrender MimeJsonCharsetutf8 T.Text where mimeUnrender _ = undefined - --- ** MimeXmlCharsetutf8 - -data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable) - --- | @application/xml; charset=utf-8@ -instance MimeType MimeXmlCharsetutf8 where - mimeType _ = Just $ P.fromString "application/xml; charset=utf-8" --- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined --- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined - - +module SwaggerPetstore.API + ( module SwaggerPetstore.API.AnotherFake + , module SwaggerPetstore.API.Fake + , module SwaggerPetstore.API.FakeClassnameTags123 + , module SwaggerPetstore.API.Pet + , module SwaggerPetstore.API.Store + , module SwaggerPetstore.API.User + ) where + +import SwaggerPetstore.API.AnotherFake +import SwaggerPetstore.API.Fake +import SwaggerPetstore.API.FakeClassnameTags123 +import SwaggerPetstore.API.Pet +import SwaggerPetstore.API.Store +import SwaggerPetstore.API.User \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/AnotherFake.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/AnotherFake.hs new file mode 100644 index 00000000000..987a70b318d --- /dev/null +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/AnotherFake.hs @@ -0,0 +1,89 @@ +{- + 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: \" \\ + + OpenAPI spec version: 2.0 + Swagger Petstore API version: 1.0.0 + Contact: apiteam@swagger.io + Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) +-} + +{-| +Module : SwaggerPetstore.API.AnotherFake +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module SwaggerPetstore.API.AnotherFake where + +import SwaggerPetstore.Core +import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** AnotherFake + +-- *** testSpecialTags + +-- | @PATCH \/another-fake\/dummy@ +-- +-- To test special tags +-- +-- To test special tags +-- +testSpecialTags + :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> Client -- ^ "body" - client model + -> SwaggerPetstoreRequest TestSpecialTags contentType Client accept +testSpecialTags _ _ body = + _mkRequest "PATCH" ["/another-fake/dummy"] + `setBodyParam` body + +data TestSpecialTags + +-- | /Body Param/ "body" - client model +instance HasBodyParam TestSpecialTags Client + +-- | @application/json@ +instance Consumes TestSpecialTags MimeJSON + +-- | @application/json@ +instance Produces TestSpecialTags MimeJSON + diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/Fake.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/Fake.hs new file mode 100644 index 00000000000..939c7f35dea --- /dev/null +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/Fake.hs @@ -0,0 +1,375 @@ +{- + 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: \" \\ + + OpenAPI spec version: 2.0 + Swagger Petstore API version: 1.0.0 + Contact: apiteam@swagger.io + Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) +-} + +{-| +Module : SwaggerPetstore.API.Fake +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module SwaggerPetstore.API.Fake where + +import SwaggerPetstore.Core +import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Fake + +-- *** fakeOuterBooleanSerialize + +-- | @POST \/fake\/outer\/boolean@ +-- +-- Test serialization of outer boolean types +-- +fakeOuterBooleanSerialize + :: (Consumes FakeOuterBooleanSerialize contentType) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> SwaggerPetstoreRequest FakeOuterBooleanSerialize contentType OuterBoolean accept +fakeOuterBooleanSerialize _ _ = + _mkRequest "POST" ["/fake/outer/boolean"] + +data FakeOuterBooleanSerialize + +-- | /Body Param/ "body" - Input boolean as post body +instance HasBodyParam FakeOuterBooleanSerialize OuterBoolean + +-- *** fakeOuterCompositeSerialize + +-- | @POST \/fake\/outer\/composite@ +-- +-- Test serialization of object with outer number type +-- +fakeOuterCompositeSerialize + :: (Consumes FakeOuterCompositeSerialize contentType) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> SwaggerPetstoreRequest FakeOuterCompositeSerialize contentType OuterComposite accept +fakeOuterCompositeSerialize _ _ = + _mkRequest "POST" ["/fake/outer/composite"] + +data FakeOuterCompositeSerialize + +-- | /Body Param/ "body" - Input composite as post body +instance HasBodyParam FakeOuterCompositeSerialize OuterComposite + +-- *** fakeOuterNumberSerialize + +-- | @POST \/fake\/outer\/number@ +-- +-- Test serialization of outer number types +-- +fakeOuterNumberSerialize + :: (Consumes FakeOuterNumberSerialize contentType) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> SwaggerPetstoreRequest FakeOuterNumberSerialize contentType OuterNumber accept +fakeOuterNumberSerialize _ _ = + _mkRequest "POST" ["/fake/outer/number"] + +data FakeOuterNumberSerialize + +-- | /Body Param/ "body" - Input number as post body +instance HasBodyParam FakeOuterNumberSerialize OuterNumber + +-- *** fakeOuterStringSerialize + +-- | @POST \/fake\/outer\/string@ +-- +-- Test serialization of outer string types +-- +fakeOuterStringSerialize + :: (Consumes FakeOuterStringSerialize contentType) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> SwaggerPetstoreRequest FakeOuterStringSerialize contentType OuterString accept +fakeOuterStringSerialize _ _ = + _mkRequest "POST" ["/fake/outer/string"] + +data FakeOuterStringSerialize + +-- | /Body Param/ "body" - Input string as post body +instance HasBodyParam FakeOuterStringSerialize OuterString + +-- *** testClientModel + +-- | @PATCH \/fake@ +-- +-- To test \"client\" model +-- +-- To test \"client\" model +-- +testClientModel + :: (Consumes TestClientModel contentType, MimeRender contentType Client) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> Client -- ^ "body" - client model + -> SwaggerPetstoreRequest TestClientModel contentType Client accept +testClientModel _ _ body = + _mkRequest "PATCH" ["/fake"] + `setBodyParam` body + +data TestClientModel + +-- | /Body Param/ "body" - client model +instance HasBodyParam TestClientModel Client + +-- | @application/json@ +instance Consumes TestClientModel MimeJSON + +-- | @application/json@ +instance Produces TestClientModel MimeJSON + + +-- *** testEndpointParameters + +-- | @POST \/fake@ +-- +-- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +-- +-- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +-- +-- AuthMethod: 'AuthBasicHttpBasicTest' +-- +-- Note: Has 'Produces' instances, but no response schema +-- +testEndpointParameters + :: (Consumes TestEndpointParameters contentType) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> Number -- ^ "number" - None + -> ParamDouble -- ^ "double" - None + -> PatternWithoutDelimiter -- ^ "patternWithoutDelimiter" - None + -> Byte -- ^ "byte" - None + -> SwaggerPetstoreRequest TestEndpointParameters contentType res accept +testEndpointParameters _ _ (Number number) (ParamDouble double) (PatternWithoutDelimiter patternWithoutDelimiter) (Byte byte) = + _mkRequest "POST" ["/fake"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicHttpBasicTest) + `addForm` toForm ("number", number) + `addForm` toForm ("double", double) + `addForm` toForm ("pattern_without_delimiter", patternWithoutDelimiter) + `addForm` toForm ("byte", byte) + +data TestEndpointParameters + +-- | /Optional Param/ "integer" - None +instance HasOptionalParam TestEndpointParameters ParamInteger where + applyOptionalParam req (ParamInteger xs) = + req `addForm` toForm ("integer", xs) + +-- | /Optional Param/ "int32" - None +instance HasOptionalParam TestEndpointParameters Int32 where + applyOptionalParam req (Int32 xs) = + req `addForm` toForm ("int32", xs) + +-- | /Optional Param/ "int64" - None +instance HasOptionalParam TestEndpointParameters Int64 where + applyOptionalParam req (Int64 xs) = + req `addForm` toForm ("int64", xs) + +-- | /Optional Param/ "float" - None +instance HasOptionalParam TestEndpointParameters ParamFloat where + applyOptionalParam req (ParamFloat xs) = + req `addForm` toForm ("float", xs) + +-- | /Optional Param/ "string" - None +instance HasOptionalParam TestEndpointParameters ParamString where + applyOptionalParam req (ParamString xs) = + req `addForm` toForm ("string", xs) + +-- | /Optional Param/ "binary" - None +instance HasOptionalParam TestEndpointParameters ParamBinary where + applyOptionalParam req (ParamBinary xs) = + req `addForm` toForm ("binary", xs) + +-- | /Optional Param/ "date" - None +instance HasOptionalParam TestEndpointParameters ParamDate where + applyOptionalParam req (ParamDate xs) = + req `addForm` toForm ("date", xs) + +-- | /Optional Param/ "dateTime" - None +instance HasOptionalParam TestEndpointParameters ParamDateTime where + applyOptionalParam req (ParamDateTime xs) = + req `addForm` toForm ("dateTime", xs) + +-- | /Optional Param/ "password" - None +instance HasOptionalParam TestEndpointParameters Password where + applyOptionalParam req (Password xs) = + req `addForm` toForm ("password", xs) + +-- | /Optional Param/ "callback" - None +instance HasOptionalParam TestEndpointParameters Callback where + applyOptionalParam req (Callback xs) = + req `addForm` toForm ("callback", xs) + +-- | @application/xml; charset=utf-8@ +instance Consumes TestEndpointParameters MimeXmlCharsetutf8 +-- | @application/json; charset=utf-8@ +instance Consumes TestEndpointParameters MimeJsonCharsetutf8 + +-- | @application/xml; charset=utf-8@ +instance Produces TestEndpointParameters MimeXmlCharsetutf8 +-- | @application/json; charset=utf-8@ +instance Produces TestEndpointParameters MimeJsonCharsetutf8 + + +-- *** testEnumParameters + +-- | @GET \/fake@ +-- +-- To test enum parameters +-- +-- To test enum parameters +-- +-- Note: Has 'Produces' instances, but no response schema +-- +testEnumParameters + :: (Consumes TestEnumParameters contentType) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> SwaggerPetstoreRequest TestEnumParameters contentType res accept +testEnumParameters _ _ = + _mkRequest "GET" ["/fake"] + +data TestEnumParameters + +-- | /Optional Param/ "enum_form_string_array" - Form parameter enum test (string array) +instance HasOptionalParam TestEnumParameters EnumFormStringArray where + applyOptionalParam req (EnumFormStringArray xs) = + req `addForm` toFormColl CommaSeparated ("enum_form_string_array", xs) + +-- | /Optional Param/ "enum_form_string" - Form parameter enum test (string) +instance HasOptionalParam TestEnumParameters EnumFormString where + applyOptionalParam req (EnumFormString xs) = + req `addForm` toForm ("enum_form_string", xs) + +-- | /Optional Param/ "enum_header_string_array" - Header parameter enum test (string array) +instance HasOptionalParam TestEnumParameters EnumHeaderStringArray where + applyOptionalParam req (EnumHeaderStringArray xs) = + req `setHeader` toHeaderColl CommaSeparated ("enum_header_string_array", xs) + +-- | /Optional Param/ "enum_header_string" - Header parameter enum test (string) +instance HasOptionalParam TestEnumParameters EnumHeaderString where + applyOptionalParam req (EnumHeaderString xs) = + req `setHeader` toHeader ("enum_header_string", xs) + +-- | /Optional Param/ "enum_query_string_array" - Query parameter enum test (string array) +instance HasOptionalParam TestEnumParameters EnumQueryStringArray where + applyOptionalParam req (EnumQueryStringArray xs) = + req `setQuery` toQueryColl CommaSeparated ("enum_query_string_array", Just xs) + +-- | /Optional Param/ "enum_query_string" - Query parameter enum test (string) +instance HasOptionalParam TestEnumParameters EnumQueryString where + applyOptionalParam req (EnumQueryString xs) = + req `setQuery` toQuery ("enum_query_string", Just xs) + +-- | /Optional Param/ "enum_query_integer" - Query parameter enum test (double) +instance HasOptionalParam TestEnumParameters EnumQueryInteger where + applyOptionalParam req (EnumQueryInteger xs) = + req `setQuery` toQuery ("enum_query_integer", Just xs) + +-- | /Optional Param/ "enum_query_double" - Query parameter enum test (double) +instance HasOptionalParam TestEnumParameters EnumQueryDouble where + applyOptionalParam req (EnumQueryDouble xs) = + req `addForm` toForm ("enum_query_double", xs) + +-- | @*/*@ +instance MimeType mtype => Consumes TestEnumParameters mtype + +-- | @*/*@ +instance MimeType mtype => Produces TestEnumParameters mtype + + +-- *** testInlineAdditionalProperties + +-- | @POST \/fake\/inline-additionalProperties@ +-- +-- test inline additionalProperties +-- +-- +-- +testInlineAdditionalProperties + :: (Consumes TestInlineAdditionalProperties contentType, MimeRender contentType A.Value) + => ContentType contentType -- ^ request content-type ('MimeType') + -> A.Value -- ^ "param" - request body + -> SwaggerPetstoreRequest TestInlineAdditionalProperties contentType NoContent MimeNoContent +testInlineAdditionalProperties _ param = + _mkRequest "POST" ["/fake/inline-additionalProperties"] + `setBodyParam` param + +data TestInlineAdditionalProperties + +-- | /Body Param/ "param" - request body +instance HasBodyParam TestInlineAdditionalProperties A.Value + +-- | @application/json@ +instance Consumes TestInlineAdditionalProperties MimeJSON + + +-- *** testJsonFormData + +-- | @GET \/fake\/jsonFormData@ +-- +-- test json serialization of form data +-- +-- +-- +testJsonFormData + :: (Consumes TestJsonFormData contentType) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Param -- ^ "param" - field1 + -> Param2 -- ^ "param2" - field2 + -> SwaggerPetstoreRequest TestJsonFormData contentType NoContent MimeNoContent +testJsonFormData _ (Param param) (Param2 param2) = + _mkRequest "GET" ["/fake/jsonFormData"] + `addForm` toForm ("param", param) + `addForm` toForm ("param2", param2) + +data TestJsonFormData + +-- | @application/json@ +instance Consumes TestJsonFormData MimeJSON + diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/FakeClassnameTags123.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/FakeClassnameTags123.hs new file mode 100644 index 00000000000..c5cf335cf98 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/FakeClassnameTags123.hs @@ -0,0 +1,90 @@ +{- + 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: \" \\ + + OpenAPI spec version: 2.0 + Swagger Petstore API version: 1.0.0 + Contact: apiteam@swagger.io + Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) +-} + +{-| +Module : SwaggerPetstore.API.FakeClassnameTags123 +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module SwaggerPetstore.API.FakeClassnameTags123 where + +import SwaggerPetstore.Core +import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** FakeClassnameTags123 + +-- *** testClassname + +-- | @PATCH \/fake_classname_test@ +-- +-- To test class name in snake case +-- +-- AuthMethod: 'AuthApiKeyApiKeyQuery' +-- +testClassname + :: (Consumes TestClassname contentType, MimeRender contentType Client) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> Client -- ^ "body" - client model + -> SwaggerPetstoreRequest TestClassname contentType Client accept +testClassname _ _ body = + _mkRequest "PATCH" ["/fake_classname_test"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKeyQuery) + `setBodyParam` body + +data TestClassname + +-- | /Body Param/ "body" - client model +instance HasBodyParam TestClassname Client + +-- | @application/json@ +instance Consumes TestClassname MimeJSON + +-- | @application/json@ +instance Produces TestClassname MimeJSON + diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/Pet.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/Pet.hs new file mode 100644 index 00000000000..5491c9b26c3 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/Pet.hs @@ -0,0 +1,328 @@ +{- + 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: \" \\ + + OpenAPI spec version: 2.0 + Swagger Petstore API version: 1.0.0 + Contact: apiteam@swagger.io + Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) +-} + +{-| +Module : SwaggerPetstore.API.Pet +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module SwaggerPetstore.API.Pet where + +import SwaggerPetstore.Core +import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Pet + +-- *** addPet + +-- | @POST \/pet@ +-- +-- Add a new pet to the store +-- +-- +-- +-- AuthMethod: 'AuthOAuthPetstoreAuth' +-- +-- Note: Has 'Produces' instances, but no response schema +-- +addPet + :: (Consumes AddPet contentType, MimeRender contentType Pet) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> Pet -- ^ "body" - Pet object that needs to be added to the store + -> SwaggerPetstoreRequest AddPet contentType res accept +addPet _ _ body = + _mkRequest "POST" ["/pet"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + `setBodyParam` body + +data AddPet + +-- | /Body Param/ "body" - Pet object that needs to be added to the store +instance HasBodyParam AddPet Pet + +-- | @application/json@ +instance Consumes AddPet MimeJSON +-- | @application/xml@ +instance Consumes AddPet MimeXML + +-- | @application/xml@ +instance Produces AddPet MimeXML +-- | @application/json@ +instance Produces AddPet MimeJSON + + +-- *** deletePet + +-- | @DELETE \/pet\/{petId}@ +-- +-- Deletes a pet +-- +-- +-- +-- AuthMethod: 'AuthOAuthPetstoreAuth' +-- +-- Note: Has 'Produces' instances, but no response schema +-- +deletePet + :: Accept accept -- ^ request accept ('MimeType') + -> PetId -- ^ "petId" - Pet id to delete + -> SwaggerPetstoreRequest DeletePet MimeNoContent res accept +deletePet _ (PetId petId) = + _mkRequest "DELETE" ["/pet/",toPath petId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + +data DeletePet +instance HasOptionalParam DeletePet ApiKey where + applyOptionalParam req (ApiKey xs) = + req `setHeader` toHeader ("api_key", xs) +-- | @application/xml@ +instance Produces DeletePet MimeXML +-- | @application/json@ +instance Produces DeletePet MimeJSON + + +-- *** findPetsByStatus + +-- | @GET \/pet\/findByStatus@ +-- +-- Finds Pets by status +-- +-- Multiple status values can be provided with comma separated strings +-- +-- AuthMethod: 'AuthOAuthPetstoreAuth' +-- +findPetsByStatus + :: Accept accept -- ^ request accept ('MimeType') + -> Status -- ^ "status" - Status values that need to be considered for filter + -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] accept +findPetsByStatus _ (Status status) = + _mkRequest "GET" ["/pet/findByStatus"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + `setQuery` toQueryColl CommaSeparated ("status", Just status) + +data FindPetsByStatus +-- | @application/xml@ +instance Produces FindPetsByStatus MimeXML +-- | @application/json@ +instance Produces FindPetsByStatus MimeJSON + + +-- *** findPetsByTags + +-- | @GET \/pet\/findByTags@ +-- +-- Finds Pets by tags +-- +-- Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. +-- +-- AuthMethod: 'AuthOAuthPetstoreAuth' +-- +findPetsByTags + :: Accept accept -- ^ request accept ('MimeType') + -> Tags -- ^ "tags" - Tags to filter by + -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept +findPetsByTags _ (Tags tags) = + _mkRequest "GET" ["/pet/findByTags"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + `setQuery` toQueryColl CommaSeparated ("tags", Just tags) + +{-# DEPRECATED findPetsByTags "" #-} + +data FindPetsByTags +-- | @application/xml@ +instance Produces FindPetsByTags MimeXML +-- | @application/json@ +instance Produces FindPetsByTags MimeJSON + + +-- *** getPetById + +-- | @GET \/pet\/{petId}@ +-- +-- Find pet by ID +-- +-- Returns a single pet +-- +-- AuthMethod: 'AuthApiKeyApiKey' +-- +getPetById + :: Accept accept -- ^ request accept ('MimeType') + -> PetId -- ^ "petId" - ID of pet to return + -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet accept +getPetById _ (PetId petId) = + _mkRequest "GET" ["/pet/",toPath petId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey) + +data GetPetById +-- | @application/xml@ +instance Produces GetPetById MimeXML +-- | @application/json@ +instance Produces GetPetById MimeJSON + + +-- *** updatePet + +-- | @PUT \/pet@ +-- +-- Update an existing pet +-- +-- +-- +-- AuthMethod: 'AuthOAuthPetstoreAuth' +-- +-- Note: Has 'Produces' instances, but no response schema +-- +updatePet + :: (Consumes UpdatePet contentType, MimeRender contentType Pet) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> Pet -- ^ "body" - Pet object that needs to be added to the store + -> SwaggerPetstoreRequest UpdatePet contentType res accept +updatePet _ _ body = + _mkRequest "PUT" ["/pet"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + `setBodyParam` body + +data UpdatePet + +-- | /Body Param/ "body" - Pet object that needs to be added to the store +instance HasBodyParam UpdatePet Pet + +-- | @application/json@ +instance Consumes UpdatePet MimeJSON +-- | @application/xml@ +instance Consumes UpdatePet MimeXML + +-- | @application/xml@ +instance Produces UpdatePet MimeXML +-- | @application/json@ +instance Produces UpdatePet MimeJSON + + +-- *** updatePetWithForm + +-- | @POST \/pet\/{petId}@ +-- +-- Updates a pet in the store with form data +-- +-- +-- +-- AuthMethod: 'AuthOAuthPetstoreAuth' +-- +-- Note: Has 'Produces' instances, but no response schema +-- +updatePetWithForm + :: (Consumes UpdatePetWithForm contentType) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> PetId -- ^ "petId" - ID of pet that needs to be updated + -> SwaggerPetstoreRequest UpdatePetWithForm contentType res accept +updatePetWithForm _ _ (PetId petId) = + _mkRequest "POST" ["/pet/",toPath petId] + `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + +data UpdatePetWithForm + +-- | /Optional Param/ "name" - Updated name of the pet +instance HasOptionalParam UpdatePetWithForm Name2 where + applyOptionalParam req (Name2 xs) = + req `addForm` toForm ("name", xs) + +-- | /Optional Param/ "status" - Updated status of the pet +instance HasOptionalParam UpdatePetWithForm StatusText where + applyOptionalParam req (StatusText xs) = + req `addForm` toForm ("status", xs) + +-- | @application/x-www-form-urlencoded@ +instance Consumes UpdatePetWithForm MimeFormUrlEncoded + +-- | @application/xml@ +instance Produces UpdatePetWithForm MimeXML +-- | @application/json@ +instance Produces UpdatePetWithForm MimeJSON + + +-- *** uploadFile + +-- | @POST \/pet\/{petId}\/uploadImage@ +-- +-- uploads an image +-- +-- +-- +-- AuthMethod: 'AuthOAuthPetstoreAuth' +-- +uploadFile + :: (Consumes UploadFile contentType) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> PetId -- ^ "petId" - ID of pet to update + -> SwaggerPetstoreRequest UploadFile contentType ApiResponse accept +uploadFile _ _ (PetId petId) = + _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) + +data UploadFile + +-- | /Optional Param/ "additionalMetadata" - Additional data to pass to server +instance HasOptionalParam UploadFile AdditionalMetadata where + applyOptionalParam req (AdditionalMetadata xs) = + req `_addMultiFormPart` NH.partLBS "additionalMetadata" (mimeRender' MimeMultipartFormData xs) + +-- | /Optional Param/ "file" - file to upload +instance HasOptionalParam UploadFile File where + applyOptionalParam req (File xs) = + req `_addMultiFormPart` NH.partFileSource "file" xs + +-- | @multipart/form-data@ +instance Consumes UploadFile MimeMultipartFormData + +-- | @application/json@ +instance Produces UploadFile MimeJSON + diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/Store.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/Store.hs new file mode 100644 index 00000000000..3a05e8fc802 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/Store.hs @@ -0,0 +1,155 @@ +{- + 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: \" \\ + + OpenAPI spec version: 2.0 + Swagger Petstore API version: 1.0.0 + Contact: apiteam@swagger.io + Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) +-} + +{-| +Module : SwaggerPetstore.API.Store +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module SwaggerPetstore.API.Store where + +import SwaggerPetstore.Core +import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** Store + +-- *** deleteOrder + +-- | @DELETE \/store\/order\/{order_id}@ +-- +-- Delete purchase order by ID +-- +-- For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors +-- +-- Note: Has 'Produces' instances, but no response schema +-- +deleteOrder + :: Accept accept -- ^ request accept ('MimeType') + -> OrderIdText -- ^ "orderId" - ID of the order that needs to be deleted + -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res accept +deleteOrder _ (OrderIdText orderId) = + _mkRequest "DELETE" ["/store/order/",toPath orderId] + +data DeleteOrder +-- | @application/xml@ +instance Produces DeleteOrder MimeXML +-- | @application/json@ +instance Produces DeleteOrder MimeJSON + + +-- *** getInventory + +-- | @GET \/store\/inventory@ +-- +-- Returns pet inventories by status +-- +-- Returns a map of status codes to quantities +-- +-- AuthMethod: 'AuthApiKeyApiKey' +-- +getInventory + :: Accept accept -- ^ request accept ('MimeType') + -> SwaggerPetstoreRequest GetInventory MimeNoContent ((Map.Map String Int)) accept +getInventory _ = + _mkRequest "GET" ["/store/inventory"] + `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey) + +data GetInventory +-- | @application/json@ +instance Produces GetInventory MimeJSON + + +-- *** getOrderById + +-- | @GET \/store\/order\/{order_id}@ +-- +-- Find purchase order by ID +-- +-- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions +-- +getOrderById + :: Accept accept -- ^ request accept ('MimeType') + -> OrderId -- ^ "orderId" - ID of pet that needs to be fetched + -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order accept +getOrderById _ (OrderId orderId) = + _mkRequest "GET" ["/store/order/",toPath orderId] + +data GetOrderById +-- | @application/xml@ +instance Produces GetOrderById MimeXML +-- | @application/json@ +instance Produces GetOrderById MimeJSON + + +-- *** placeOrder + +-- | @POST \/store\/order@ +-- +-- Place an order for a pet +-- +-- +-- +placeOrder + :: (Consumes PlaceOrder contentType, MimeRender contentType Order) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> Order -- ^ "body" - order placed for purchasing the pet + -> SwaggerPetstoreRequest PlaceOrder contentType Order accept +placeOrder _ _ body = + _mkRequest "POST" ["/store/order"] + `setBodyParam` body + +data PlaceOrder + +-- | /Body Param/ "body" - order placed for purchasing the pet +instance HasBodyParam PlaceOrder Order +-- | @application/xml@ +instance Produces PlaceOrder MimeXML +-- | @application/json@ +instance Produces PlaceOrder MimeJSON + diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/User.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/User.hs new file mode 100644 index 00000000000..b4c706bd202 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/API/User.hs @@ -0,0 +1,274 @@ +{- + 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: \" \\ + + OpenAPI spec version: 2.0 + Swagger Petstore API version: 1.0.0 + Contact: apiteam@swagger.io + Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) +-} + +{-| +Module : SwaggerPetstore.API.User +-} + +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MonoLocalBinds #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-} + +module SwaggerPetstore.API.User where + +import SwaggerPetstore.Core +import SwaggerPetstore.MimeTypes +import SwaggerPetstore.Model as M + +import qualified Data.Aeson as A +import qualified Data.ByteString as B +import qualified Data.ByteString.Lazy as BL +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) +import qualified Data.Foldable as P +import qualified Data.Map as Map +import qualified Data.Maybe as P +import qualified Data.Proxy as P (Proxy(..)) +import qualified Data.Set as Set +import qualified Data.String as P +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Encoding as TL +import qualified Data.Time as TI +import qualified Network.HTTP.Client.MultipartFormData as NH +import qualified Network.HTTP.Media as ME +import qualified Network.HTTP.Types as NH +import qualified Web.FormUrlEncoded as WH +import qualified Web.HttpApiData as WH + +import Data.Text (Text) +import GHC.Base ((<|>)) + +import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import qualified Prelude as P + +-- * Operations + + +-- ** User + +-- *** createUser + +-- | @POST \/user@ +-- +-- Create user +-- +-- This can only be done by the logged in user. +-- +-- Note: Has 'Produces' instances, but no response schema +-- +createUser + :: (Consumes CreateUser contentType, MimeRender contentType User) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> User -- ^ "body" - Created user object + -> SwaggerPetstoreRequest CreateUser contentType res accept +createUser _ _ body = + _mkRequest "POST" ["/user"] + `setBodyParam` body + +data CreateUser + +-- | /Body Param/ "body" - Created user object +instance HasBodyParam CreateUser User +-- | @application/xml@ +instance Produces CreateUser MimeXML +-- | @application/json@ +instance Produces CreateUser MimeJSON + + +-- *** createUsersWithArrayInput + +-- | @POST \/user\/createWithArray@ +-- +-- Creates list of users with given input array +-- +-- +-- +-- Note: Has 'Produces' instances, but no response schema +-- +createUsersWithArrayInput + :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> Body -- ^ "body" - List of user object + -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res accept +createUsersWithArrayInput _ _ body = + _mkRequest "POST" ["/user/createWithArray"] + `setBodyParam` body + +data CreateUsersWithArrayInput + +-- | /Body Param/ "body" - List of user object +instance HasBodyParam CreateUsersWithArrayInput Body +-- | @application/xml@ +instance Produces CreateUsersWithArrayInput MimeXML +-- | @application/json@ +instance Produces CreateUsersWithArrayInput MimeJSON + + +-- *** createUsersWithListInput + +-- | @POST \/user\/createWithList@ +-- +-- Creates list of users with given input array +-- +-- +-- +-- Note: Has 'Produces' instances, but no response schema +-- +createUsersWithListInput + :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> Body -- ^ "body" - List of user object + -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res accept +createUsersWithListInput _ _ body = + _mkRequest "POST" ["/user/createWithList"] + `setBodyParam` body + +data CreateUsersWithListInput + +-- | /Body Param/ "body" - List of user object +instance HasBodyParam CreateUsersWithListInput Body +-- | @application/xml@ +instance Produces CreateUsersWithListInput MimeXML +-- | @application/json@ +instance Produces CreateUsersWithListInput MimeJSON + + +-- *** deleteUser + +-- | @DELETE \/user\/{username}@ +-- +-- Delete user +-- +-- This can only be done by the logged in user. +-- +-- Note: Has 'Produces' instances, but no response schema +-- +deleteUser + :: Accept accept -- ^ request accept ('MimeType') + -> Username -- ^ "username" - The name that needs to be deleted + -> SwaggerPetstoreRequest DeleteUser MimeNoContent res accept +deleteUser _ (Username username) = + _mkRequest "DELETE" ["/user/",toPath username] + +data DeleteUser +-- | @application/xml@ +instance Produces DeleteUser MimeXML +-- | @application/json@ +instance Produces DeleteUser MimeJSON + + +-- *** getUserByName + +-- | @GET \/user\/{username}@ +-- +-- Get user by user name +-- +-- +-- +getUserByName + :: Accept accept -- ^ request accept ('MimeType') + -> Username -- ^ "username" - The name that needs to be fetched. Use user1 for testing. + -> SwaggerPetstoreRequest GetUserByName MimeNoContent User accept +getUserByName _ (Username username) = + _mkRequest "GET" ["/user/",toPath username] + +data GetUserByName +-- | @application/xml@ +instance Produces GetUserByName MimeXML +-- | @application/json@ +instance Produces GetUserByName MimeJSON + + +-- *** loginUser + +-- | @GET \/user\/login@ +-- +-- Logs user into the system +-- +-- +-- +loginUser + :: Accept accept -- ^ request accept ('MimeType') + -> Username -- ^ "username" - The user name for login + -> Password -- ^ "password" - The password for login in clear text + -> SwaggerPetstoreRequest LoginUser MimeNoContent Text accept +loginUser _ (Username username) (Password password) = + _mkRequest "GET" ["/user/login"] + `setQuery` toQuery ("username", Just username) + `setQuery` toQuery ("password", Just password) + +data LoginUser +-- | @application/xml@ +instance Produces LoginUser MimeXML +-- | @application/json@ +instance Produces LoginUser MimeJSON + + +-- *** logoutUser + +-- | @GET \/user\/logout@ +-- +-- Logs out current logged in user session +-- +-- +-- +-- Note: Has 'Produces' instances, but no response schema +-- +logoutUser + :: Accept accept -- ^ request accept ('MimeType') + -> SwaggerPetstoreRequest LogoutUser MimeNoContent res accept +logoutUser _ = + _mkRequest "GET" ["/user/logout"] + +data LogoutUser +-- | @application/xml@ +instance Produces LogoutUser MimeXML +-- | @application/json@ +instance Produces LogoutUser MimeJSON + + +-- *** updateUser + +-- | @PUT \/user\/{username}@ +-- +-- Updated user +-- +-- This can only be done by the logged in user. +-- +-- Note: Has 'Produces' instances, but no response schema +-- +updateUser + :: (Consumes UpdateUser contentType, MimeRender contentType User) + => ContentType contentType -- ^ request content-type ('MimeType') + -> Accept accept -- ^ request accept ('MimeType') + -> Username -- ^ "username" - name that need to be deleted + -> User -- ^ "body" - Updated user object + -> SwaggerPetstoreRequest UpdateUser contentType res accept +updateUser _ _ (Username username) body = + _mkRequest "PUT" ["/user/",toPath username] + `setBodyParam` body + +data UpdateUser + +-- | /Body Param/ "body" - Updated user object +instance HasBodyParam UpdateUser User +-- | @application/xml@ +instance Produces UpdateUser MimeXML +-- | @application/json@ +instance Produces UpdateUser MimeJSON + diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/MimeTypes.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/MimeTypes.hs index 31b402efad4..ce470f723f8 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/MimeTypes.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/MimeTypes.hs @@ -200,3 +200,29 @@ instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BC -- | @P.Right . P.const NoContent@ instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent + + +-- * Custom Mime Types + +-- ** MimeJsonCharsetutf8 + +data MimeJsonCharsetutf8 = MimeJsonCharsetutf8 deriving (P.Typeable) + +-- | @application/json; charset=utf-8@ +instance MimeType MimeJsonCharsetutf8 where + mimeType _ = Just $ P.fromString "application/json; charset=utf-8" +instance A.ToJSON a => MimeRender MimeJsonCharsetutf8 a where mimeRender _ = A.encode +instance A.FromJSON a => MimeUnrender MimeJsonCharsetutf8 a where mimeUnrender _ = A.eitherDecode +-- instance MimeRender MimeJsonCharsetutf8 T.Text where mimeRender _ = undefined +-- instance MimeUnrender MimeJsonCharsetutf8 T.Text where mimeUnrender _ = undefined + +-- ** MimeXmlCharsetutf8 + +data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable) + +-- | @application/xml; charset=utf-8@ +instance MimeType MimeXmlCharsetutf8 where + mimeType _ = Just $ P.fromString "application/xml; charset=utf-8" +-- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined +-- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined + diff --git a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs index 588f92a2390..2e17d159e99 100644 --- a/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/SwaggerPetstore/Model.hs @@ -37,8 +37,10 @@ import Data.Aeson ((.:),(.:!),(.:?),(.=)) import qualified Control.Arrow as P (left) import qualified Data.Aeson as A import qualified Data.ByteString as B +import qualified Data.ByteString.Base64 as B64 +import qualified Data.ByteString.Char8 as BC import qualified Data.ByteString.Lazy as BL -import qualified Data.Data as P (Data, Typeable) +import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep) import qualified Data.Foldable as P import qualified Data.HashMap.Lazy as HM import qualified Data.Map as Map @@ -47,18 +49,132 @@ import qualified Data.Set as Set import qualified Data.Text as T import qualified Data.Text.Encoding as T import qualified Data.Time as TI +import qualified Lens.Micro as L import qualified Web.FormUrlEncoded as WH import qualified Web.HttpApiData as WH import Control.Applicative ((<|>)) import Control.Applicative (Alternative) +import Data.Function ((&)) +import Data.Monoid ((<>)) import Data.Text (Text) -import Prelude (($), (.),(<$>),(<*>),(>>=),(=<<),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) +import Prelude (($),(/=),(.),(<$>),(<*>),(>>=),(=<<),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor) import qualified Prelude as P +-- * Parameter newtypes + + +-- ** AdditionalMetadata +newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } deriving (P.Eq, P.Show) + +-- ** ApiKey +newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show) + +-- ** Body +newtype Body = Body { unBody :: [User] } deriving (P.Eq, P.Show, A.ToJSON) + +-- ** Byte +newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show) + +-- ** Callback +newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show) + +-- ** EnumFormString +newtype EnumFormString = EnumFormString { unEnumFormString :: E'EnumFormString } deriving (P.Eq, P.Show) + +-- ** EnumFormStringArray +newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [E'Inner2] } deriving (P.Eq, P.Show) + +-- ** EnumHeaderString +newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: E'EnumFormString } deriving (P.Eq, P.Show) + +-- ** EnumHeaderStringArray +newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [E'Inner2] } deriving (P.Eq, P.Show) + +-- ** EnumQueryDouble +newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: E'EnumNumber } deriving (P.Eq, P.Show) + +-- ** EnumQueryInteger +newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: E'EnumQueryInteger } deriving (P.Eq, P.Show) + +-- ** EnumQueryString +newtype EnumQueryString = EnumQueryString { unEnumQueryString :: E'EnumFormString } deriving (P.Eq, P.Show) + +-- ** EnumQueryStringArray +newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [E'Inner2] } deriving (P.Eq, P.Show) + +-- ** File +newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show) + +-- ** Int32 +newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show) + +-- ** Int64 +newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show) + +-- ** Name2 +newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show) + +-- ** Number +newtype Number = Number { unNumber :: Double } deriving (P.Eq, P.Show) + +-- ** OrderId +newtype OrderId = OrderId { unOrderId :: Integer } deriving (P.Eq, P.Show) + +-- ** OrderIdText +newtype OrderIdText = OrderIdText { unOrderIdText :: Text } deriving (P.Eq, P.Show) + +-- ** Param +newtype Param = Param { unParam :: Text } deriving (P.Eq, P.Show) + +-- ** Param2 +newtype Param2 = Param2 { unParam2 :: Text } deriving (P.Eq, P.Show) + +-- ** ParamBinary +newtype ParamBinary = ParamBinary { unParamBinary :: Binary } deriving (P.Eq, P.Show) + +-- ** ParamDate +newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show) + +-- ** ParamDateTime +newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show) + +-- ** ParamDouble +newtype ParamDouble = ParamDouble { unParamDouble :: Double } deriving (P.Eq, P.Show) + +-- ** ParamFloat +newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show) + +-- ** ParamInteger +newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show) + +-- ** ParamString +newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show) + +-- ** Password +newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show) + +-- ** PatternWithoutDelimiter +newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDelimiter :: Text } deriving (P.Eq, P.Show) + +-- ** PetId +newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show) + +-- ** Status +newtype Status = Status { unStatus :: [E'Status2] } deriving (P.Eq, P.Show) + +-- ** StatusText +newtype StatusText = StatusText { unStatusText :: Text } deriving (P.Eq, P.Show) + +-- ** Tags +newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show) + +-- ** Username +newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show) + -- * Models @@ -1595,3 +1711,60 @@ toOuterEnum = \case "approved" -> P.Right OuterEnum'Approved "delivered" -> P.Right OuterEnum'Delivered s -> P.Left $ "toOuterEnum: enum parse failure: " P.++ P.show s + + +-- * Auth Methods + +-- ** AuthApiKeyApiKey +data AuthApiKeyApiKey = + AuthApiKeyApiKey Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthApiKeyApiKey where + applyAuthMethod _ a@(AuthApiKeyApiKey secret) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("api_key", secret) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + +-- ** AuthApiKeyApiKeyQuery +data AuthApiKeyApiKeyQuery = + AuthApiKeyApiKeyQuery Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthApiKeyApiKeyQuery where + applyAuthMethod _ a@(AuthApiKeyApiKeyQuery secret) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setQuery` toQuery ("api_key_query", Just secret) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + +-- ** AuthBasicHttpBasicTest +data AuthBasicHttpBasicTest = + AuthBasicHttpBasicTest B.ByteString B.ByteString -- ^ username password + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthBasicHttpBasicTest where + applyAuthMethod _ a@(AuthBasicHttpBasicTest user pw) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ]) + +-- ** AuthOAuthPetstoreAuth +data AuthOAuthPetstoreAuth = + AuthOAuthPetstoreAuth Text -- ^ secret + deriving (P.Eq, P.Show, P.Typeable) + +instance AuthMethod AuthOAuthPetstoreAuth where + applyAuthMethod _ a@(AuthOAuthPetstoreAuth secret) req = + P.pure $ + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + diff --git a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal index e5a712598f8..dc7a34382b9 100644 --- a/samples/client/petstore/haskell-http-client/swagger-petstore.cabal +++ b/samples/client/petstore/haskell-http-client/swagger-petstore.cabal @@ -32,34 +32,40 @@ library lib ghc-options: -Wall -funbox-strict-fields build-depends: - base >=4.7 && <5.0 - , transformers >=0.4.0.0 - , mtl >=2.2.1 - , unordered-containers - , aeson >=1.0 && <2.0 - , bytestring >=0.10.0 && <0.11 + aeson >=1.0 && <2.0 + , base >=4.7 && <5.0 , base64-bytestring >1.0 && <2.0 + , bytestring >=0.10.0 && <0.11 + , case-insensitive , containers >=0.5.0.0 && <0.6 - , http-types >=0.8 && <0.11 + , deepseq >= 1.4 && <1.6 + , exceptions >= 0.4 + , http-api-data >= 0.3.4 && <0.4 , http-client >=0.5 && <0.6 , http-client-tls - , http-api-data >= 0.3.4 && <0.4 , http-media >= 0.4 && < 0.8 - , text >=0.11 && <1.3 - , time >=1.5 && <1.9 + , http-types >=0.8 && <0.12 , iso8601-time >=0.1.3 && <0.2.0 - , vector >=0.10.9 && <0.13 + , microlens >= 0.4.3 && <0.5 + , mtl >=2.2.1 , network >=2.6.2 && <2.7 , random >=1.1 - , exceptions >= 0.4 - , katip >=0.4 && < 0.6 , safe-exceptions <0.2 - , case-insensitive - , microlens >= 0.4.3 && <0.5 - , deepseq >= 1.4 && <1.6 + , text >=0.11 && <1.3 + , time >=1.5 && <1.9 + , transformers >=0.4.0.0 + , unordered-containers + , vector >=0.10.9 && <0.13 + , katip >=0.4 && < 0.6 exposed-modules: SwaggerPetstore SwaggerPetstore.API + SwaggerPetstore.API.AnotherFake + SwaggerPetstore.API.Fake + SwaggerPetstore.API.FakeClassnameTags123 + SwaggerPetstore.API.Pet + SwaggerPetstore.API.Store + SwaggerPetstore.API.User SwaggerPetstore.Client SwaggerPetstore.Core SwaggerPetstore.Logging @@ -77,21 +83,21 @@ test-suite tests tests ghc-options: -Wall -fno-warn-orphans build-depends: - base >=4.7 && <5.0 - , transformers >=0.4.0.0 - , mtl >=2.2.1 - , unordered-containers - , swagger-petstore + swagger-petstore + , QuickCheck + , aeson + , base >=4.7 && <5.0 , bytestring >=0.10.0 && <0.11 , containers , hspec >=1.8 + , iso8601-time + , mtl >=2.2.1 + , semigroups , text , time - , iso8601-time - , aeson + , transformers >=0.4.0.0 + , unordered-containers , vector - , semigroups - , QuickCheck other-modules: ApproxEq Instances diff --git a/samples/client/petstore/haskell-http-client/tests/Test.hs b/samples/client/petstore/haskell-http-client/tests/Test.hs index d717ddde856..c453598840c 100644 --- a/samples/client/petstore/haskell-http-client/tests/Test.hs +++ b/samples/client/petstore/haskell-http-client/tests/Test.hs @@ -17,7 +17,7 @@ import SwaggerPetstore.MimeTypes main :: IO () main = - hspec $ modifyMaxSize (const 10) $ do + hspec $ modifyMaxSize (const 5) $ do describe "JSON instances" $ do pure () propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesClass) From 97ad90578de4535a3da3296bffba7fa4a1175ff1 Mon Sep 17 00:00:00 2001 From: ehyche Date: Sun, 7 Jan 2018 03:57:58 -0500 Subject: [PATCH 17/65] Split up model template into partials (#7297) --- .../src/main/resources/swift4/model.mustache | 94 +------------------ .../main/resources/swift4/modelArray.mustache | 1 + .../main/resources/swift4/modelEnum.mustache | 4 + .../modelInlineEnumDeclaration.mustache | 3 + .../resources/swift4/modelObject.mustache | 83 ++++++++++++++++ 5 files changed, 94 insertions(+), 91 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/swift4/modelArray.mustache create mode 100644 modules/swagger-codegen/src/main/resources/swift4/modelEnum.mustache create mode 100644 modules/swagger-codegen/src/main/resources/swift4/modelInlineEnumDeclaration.mustache create mode 100644 modules/swagger-codegen/src/main/resources/swift4/modelObject.mustache diff --git a/modules/swagger-codegen/src/main/resources/swift4/model.mustache b/modules/swagger-codegen/src/main/resources/swift4/model.mustache index eb51bc23d09..189acedc53d 100644 --- a/modules/swagger-codegen/src/main/resources/swift4/model.mustache +++ b/modules/swagger-codegen/src/main/resources/swift4/model.mustache @@ -11,102 +11,14 @@ import Foundation /** {{description}} */{{/description}} {{#isArrayModel}} -public typealias {{classname}} = {{parent}} +{{> modelArray}} {{/isArrayModel}} {{^isArrayModel}} {{#isEnum}} -public enum {{classname}}: {{dataType}}, Codable { -{{#allowableValues}}{{#enumVars}} case {{name}} = "{{{value}}}" -{{/enumVars}}{{/allowableValues}} -} +{{> modelEnum}} {{/isEnum}} {{^isEnum}} - -open class {{classname}}: {{#parent}}{{{parent}}}{{/parent}}{{^parent}}Codable{{/parent}} { - -{{#vars}} -{{#isEnum}} - public enum {{enumName}}: {{^isContainer}}{{datatype}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, Codable { {{#allowableValues}}{{#enumVars}} - case {{name}} = {{#isContainer}}"{{/isContainer}}{{#isString}}"{{/isString}}{{{value}}}{{#isString}}"{{/isString}}{{#isContainer}}"{{/isContainer}}{{/enumVars}}{{/allowableValues}} - } -{{/isEnum}} -{{/vars}} -{{#vars}} -{{#isEnum}} - {{#description}}/** {{description}} */ - {{/description}}public var {{name}}: {{{datatypeWithEnum}}}{{^required}}?{{/required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} -{{/isEnum}} -{{^isEnum}} - {{#description}}/** {{description}} */ - {{/description}}public var {{name}}: {{{datatype}}}{{^required}}?{{/required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#objcCompatible}}{{#vendorExtensions.x-swift-optional-scalar}} - public var {{name}}Num: NSNumber? { - get { - return {{name}}.map({ return NSNumber(value: $0) }) - } - }{{/vendorExtensions.x-swift-optional-scalar}}{{/objcCompatible}} -{{/isEnum}} -{{/vars}} - -{{#additionalPropertiesType}} - public var additionalProperties: [String:{{{additionalPropertiesType}}}] = [:] - - public subscript(key: String) -> {{{additionalPropertiesType}}}? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } -{{/additionalPropertiesType}} - - {{^parent}}{{#hasVars}} - public init({{#vars}}{{name}}: {{{datatypeWithEnum}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/vars}}) { - {{#vars}} - self.{{name}} = {{name}} - {{/vars}} - } - {{/hasVars}}{{/parent}} - - // Encodable protocol methods - - public {{#parent}}override {{/parent}}func encode(to encoder: Encoder) throws { - - var container = encoder.container(keyedBy: String.self) - - {{#vars}} - try container.encode{{^required}}IfPresent{{/required}}({{{name}}}, forKey: "{{{baseName}}}") - {{/vars}} - {{#additionalPropertiesType}} - try container.encodeMap(additionalProperties) - {{/additionalPropertiesType}} - } - - // Decodable protocol methods - - public required init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - {{#vars}} - {{name}} = try container.decode{{^required}}IfPresent{{/required}}({{{datatypeWithEnum}}}.self, forKey: "{{{baseName}}}") - {{/vars}} - {{#additionalPropertiesType}} - var nonAdditionalPropertyKeys = Set() - {{#vars}} - nonAdditionalPropertyKeys.insert("{{{baseName}}}") - {{/vars}} - additionalProperties = try container.decodeMap({{{additionalPropertiesType}}}.self, excludedKeys: nonAdditionalPropertyKeys) - {{/additionalPropertiesType}} - {{#parent}} - try super.init(from: decoder) - {{/parent}} - } -} - +{{> modelObject}} {{/isEnum}} {{/isArrayModel}} {{/model}} diff --git a/modules/swagger-codegen/src/main/resources/swift4/modelArray.mustache b/modules/swagger-codegen/src/main/resources/swift4/modelArray.mustache new file mode 100644 index 00000000000..843626158cd --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift4/modelArray.mustache @@ -0,0 +1 @@ +public typealias {{classname}} = {{parent}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/swift4/modelEnum.mustache b/modules/swagger-codegen/src/main/resources/swift4/modelEnum.mustache new file mode 100644 index 00000000000..0b5bebe0ebd --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift4/modelEnum.mustache @@ -0,0 +1,4 @@ +public enum {{classname}}: {{dataType}}, Codable { +{{#allowableValues}}{{#enumVars}} case {{name}} = "{{{value}}}" +{{/enumVars}}{{/allowableValues}} +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/swift4/modelInlineEnumDeclaration.mustache b/modules/swagger-codegen/src/main/resources/swift4/modelInlineEnumDeclaration.mustache new file mode 100644 index 00000000000..c713edb31e2 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift4/modelInlineEnumDeclaration.mustache @@ -0,0 +1,3 @@ + public enum {{enumName}}: {{^isContainer}}{{datatype}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, Codable { {{#allowableValues}}{{#enumVars}} + case {{name}} = {{#isContainer}}"{{/isContainer}}{{#isString}}"{{/isString}}{{{value}}}{{#isString}}"{{/isString}}{{#isContainer}}"{{/isContainer}}{{/enumVars}}{{/allowableValues}} + } \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/swift4/modelObject.mustache b/modules/swagger-codegen/src/main/resources/swift4/modelObject.mustache new file mode 100644 index 00000000000..b0c33368164 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift4/modelObject.mustache @@ -0,0 +1,83 @@ + +open class {{classname}}: {{#parent}}{{{parent}}}{{/parent}}{{^parent}}Codable{{/parent}} { + +{{#vars}} +{{#isEnum}} +{{> modelInlineEnumDeclaration}} +{{/isEnum}} +{{/vars}} +{{#vars}} +{{#isEnum}} + {{#description}}/** {{description}} */ + {{/description}}public var {{name}}: {{{datatypeWithEnum}}}{{^required}}?{{/required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} +{{/isEnum}} +{{^isEnum}} + {{#description}}/** {{description}} */ + {{/description}}public var {{name}}: {{{datatype}}}{{^required}}?{{/required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#objcCompatible}}{{#vendorExtensions.x-swift-optional-scalar}} + public var {{name}}Num: NSNumber? { + get { + return {{name}}.map({ return NSNumber(value: $0) }) + } + }{{/vendorExtensions.x-swift-optional-scalar}}{{/objcCompatible}} +{{/isEnum}} +{{/vars}} + +{{#additionalPropertiesType}} + public var additionalProperties: [String:{{{additionalPropertiesType}}}] = [:] + + public subscript(key: String) -> {{{additionalPropertiesType}}}? { + get { + if let value = additionalProperties[key] { + return value + } + return nil + } + + set { + additionalProperties[key] = newValue + } + } +{{/additionalPropertiesType}} + + {{^parent}}{{#hasVars}} + public init({{#vars}}{{name}}: {{{datatypeWithEnum}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/vars}}) { + {{#vars}} + self.{{name}} = {{name}} + {{/vars}} + } + {{/hasVars}}{{/parent}} + + // Encodable protocol methods + + public {{#parent}}override {{/parent}}func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + {{#vars}} + try container.encode{{^required}}IfPresent{{/required}}({{{name}}}, forKey: "{{{baseName}}}") + {{/vars}} + {{#additionalPropertiesType}} + try container.encodeMap(additionalProperties) + {{/additionalPropertiesType}} + } + + // Decodable protocol methods + + public required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + {{#vars}} + {{name}} = try container.decode{{^required}}IfPresent{{/required}}({{{datatypeWithEnum}}}.self, forKey: "{{{baseName}}}") + {{/vars}} + {{#additionalPropertiesType}} + var nonAdditionalPropertyKeys = Set() + {{#vars}} + nonAdditionalPropertyKeys.insert("{{{baseName}}}") + {{/vars}} + additionalProperties = try container.decodeMap({{{additionalPropertiesType}}}.self, excludedKeys: nonAdditionalPropertyKeys) + {{/additionalPropertiesType}} + {{#parent}} + try super.init(from: decoder) + {{/parent}} + } +} From 6d2d4298df16796c95faa5c95efdf35c67ec1be0 Mon Sep 17 00:00:00 2001 From: ryandavis84 Date: Sun, 7 Jan 2018 04:18:36 -0500 Subject: [PATCH 18/65] Gatling generator2 issue #6927 (#6934) * Initial commit, Generates everything necessary to run a performnace test against a swagger api. Just have to fill out the CSV feeder files with your data. * adding samples and gatling-petstore.sh file * Extending the AbstractScalaCodeGen * Checking in the CodegenConfig file as it is needed to generate * removing escaped reserved words * Changed model to be able to make all variables utilize an underscore while json fields are still just the variable name * Changing underscore to var as interpolation can not start with a _ in scala * Fixing path params * allow you to pass in a system property to define which config to use as a workload profile, use rate and instance multipliers to scale up and down your test, added ramp down after the test is completed, added global assertions. * Addressing PR feedback * missed semi-colon * Bringing everything up to date with the renames that were suggested --- bin/scala-gatling-petstore.sh | 31 ++ .../languages/ScalaGatlingCodegen.java | 345 ++++++++++++++++++ .../services/io.swagger.codegen.CodegenConfig | 1 + .../main/resources/ScalaGatling/api.mustache | 147 ++++++++ .../main/resources/ScalaGatling/build.gradle | 29 ++ .../ScalaGatling/default.conf.mustache | 51 +++ .../main/resources/ScalaGatling/gatling.conf | 132 +++++++ .../ScalaGatling/licenseInfo.mustache | 0 .../main/resources/ScalaGatling/logback.xml | 22 ++ .../resources/ScalaGatling/model.mustache | 26 ++ .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../gen/io/swagger/client/BuildConfig.java | 8 + .../main/gen/io/swagger/client/Manifest.java | 7 + .../src/main/gen/io/swagger/client/R.java | 7 + .../scala-gatling/.swagger-codegen-ignore | 23 ++ .../scala-gatling/.swagger-codegen/VERSION | 1 + .../petstore/scala-gatling/build.gradle | 29 ++ .../src/gatling/resources/conf/CD.conf | 62 ++++ .../src/gatling/resources/conf/CI.conf | 62 ++++ .../src/gatling/resources/conf/baseline.conf | 62 ++++ .../src/gatling/resources/conf/default.conf | 62 ++++ .../src/gatling/resources/conf/logback.xml | 22 ++ .../src/gatling/resources/conf/longevity.conf | 62 ++++ .../src/gatling/resources/conf/stress.conf | 62 ++++ .../resources/data/addPet-BodyParams.csv | 1 + .../resources/data/createUser-BodyParams.csv | 1 + .../resources/data/deleteOrder-pathParams.csv | 1 + .../resources/data/deletePet-headerParams.csv | 1 + .../resources/data/deletePet-pathParams.csv | 1 + .../resources/data/deleteUser-pathParams.csv | 1 + .../data/findPetsByStatus-queryParams.csv | 1 + .../data/findPetsByTags-queryParams.csv | 1 + .../data/getOrderById-pathParams.csv | 1 + .../resources/data/getPetById-pathParams.csv | 1 + .../data/getUserByName-pathParams.csv | 1 + .../resources/data/loginUser-queryParams.csv | 1 + .../resources/data/placeOrder-BodyParams.csv | 1 + .../resources/data/updatePet-BodyParams.csv | 1 + .../data/updatePetWithForm-formParams.csv | 1 + .../data/updatePetWithForm-pathParams.csv | 1 + .../resources/data/updateUser-BodyParams.csv | 1 + .../resources/data/updateUser-pathParams.csv | 1 + .../resources/data/uploadFile-formParams.csv | 1 + .../resources/data/uploadFile-pathParams.csv | 1 + .../swagger/client/api/PetApiSimulation.scala | 223 +++++++++++ .../client/api/StoreApiSimulation.scala | 143 ++++++++ .../client/api/UserApiSimulation.scala | 210 +++++++++++ .../io/swagger/client/model/ApiResponse.scala | 17 + .../io/swagger/client/model/Category.scala | 16 + .../scala/io/swagger/client/model/Order.scala | 22 ++ .../scala/io/swagger/client/model/Pet.scala | 21 ++ .../scala/io/swagger/client/model/Tag.scala | 16 + .../scala/io/swagger/client/model/User.scala | 23 ++ 103 files changed, 2338 insertions(+) create mode 100755 bin/scala-gatling-petstore.sh create mode 100644 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaGatlingCodegen.java create mode 100644 modules/swagger-codegen/src/main/resources/ScalaGatling/api.mustache create mode 100644 modules/swagger-codegen/src/main/resources/ScalaGatling/build.gradle create mode 100644 modules/swagger-codegen/src/main/resources/ScalaGatling/default.conf.mustache create mode 100644 modules/swagger-codegen/src/main/resources/ScalaGatling/gatling.conf create mode 100644 modules/swagger-codegen/src/main/resources/ScalaGatling/licenseInfo.mustache create mode 100644 modules/swagger-codegen/src/main/resources/ScalaGatling/logback.xml create mode 100644 modules/swagger-codegen/src/main/resources/ScalaGatling/model.mustache create mode 100644 samples/client/petstore-security-test/java/okhttp-gson/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore-security-test/java/okhttp-gson/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore-security-test/java/okhttp-gson/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/java/feign/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore/java/feign/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore/java/feign/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/java/google-api-client/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore/java/google-api-client/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore/java/google-api-client/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/java/jersey1/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore/java/jersey1/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore/java/jersey1/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/java/jersey2-java6/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore/java/jersey2-java6/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore/java/jersey2-java6/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/java/jersey2/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore/java/jersey2/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore/java/jersey2/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/java/resteasy/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore/java/resteasy/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore/java/resteasy/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/java/resttemplate/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore/java/resttemplate/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore/java/resttemplate/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/java/retrofit/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore/java/retrofit/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore/java/retrofit/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/java/retrofit2-play24/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore/java/retrofit2-play24/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore/java/retrofit2-play24/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/java/retrofit2/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore/java/retrofit2/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore/java/retrofit2/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/java/retrofit2rx/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore/java/retrofit2rx/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore/java/retrofit2rx/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/java/retrofit2rx2/src/main/gen/io/swagger/client/BuildConfig.java create mode 100644 samples/client/petstore/java/retrofit2rx2/src/main/gen/io/swagger/client/Manifest.java create mode 100644 samples/client/petstore/java/retrofit2rx2/src/main/gen/io/swagger/client/R.java create mode 100644 samples/client/petstore/scala-gatling/.swagger-codegen-ignore create mode 100644 samples/client/petstore/scala-gatling/.swagger-codegen/VERSION create mode 100644 samples/client/petstore/scala-gatling/build.gradle create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/conf/CD.conf create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/conf/CI.conf create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/conf/baseline.conf create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/conf/default.conf create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/conf/logback.xml create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/conf/longevity.conf create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/conf/stress.conf create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/addPet-BodyParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/createUser-BodyParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/deleteOrder-pathParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/deletePet-headerParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/deletePet-pathParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/deleteUser-pathParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/findPetsByStatus-queryParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/findPetsByTags-queryParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/getOrderById-pathParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/getPetById-pathParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/getUserByName-pathParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/loginUser-queryParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/placeOrder-BodyParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/updatePet-BodyParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/updatePetWithForm-formParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/updatePetWithForm-pathParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/updateUser-BodyParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/updateUser-pathParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/uploadFile-formParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/resources/data/uploadFile-pathParams.csv create mode 100644 samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/PetApiSimulation.scala create mode 100644 samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/StoreApiSimulation.scala create mode 100644 samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/UserApiSimulation.scala create mode 100644 samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/ApiResponse.scala create mode 100644 samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/Category.scala create mode 100644 samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/Order.scala create mode 100644 samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/Pet.scala create mode 100644 samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/Tag.scala create mode 100644 samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/User.scala diff --git a/bin/scala-gatling-petstore.sh b/bin/scala-gatling-petstore.sh new file mode 100755 index 00000000000..87495a5213f --- /dev/null +++ b/bin/scala-gatling-petstore.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/ScalaGatling -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l scala-gatling -o samples/client/petstore/scala-gatling" + +java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaGatlingCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaGatlingCodegen.java new file mode 100644 index 00000000000..6c578875f89 --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaGatlingCodegen.java @@ -0,0 +1,345 @@ +package io.swagger.codegen.languages; + +import io.swagger.codegen.*; +import io.swagger.models.*; +import io.swagger.models.parameters.*; +import io.swagger.models.properties.*; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.StringUtils; + +import java.io.IOException; +import java.util.*; +import java.io.File; + +public class ScalaGatlingCodegen extends AbstractScalaCodegen implements CodegenConfig { + + // source folder where to write the files + protected String sourceFolder = "src" + File.separator + "gatling" + File.separator + "scala"; + protected String resourceFolder = "src" + File.separator + "gatling" + File.separator + "resources"; + protected String confFolder = resourceFolder + File.separator + "conf"; + protected String dataFolder = resourceFolder + File.separator + "data"; + protected String apiVersion = "1.0.0"; + + /** + * Configures the type of generator. + * + * @return the CodegenType for this generator + * @see io.swagger.codegen.CodegenType + */ + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + /** + * Configures a friendly name for the generator. This will be used by the generator + * to select the library with the -l flag. + * + * @return the friendly name for the generator + */ + public String getName() { + return "scala-gatling"; + } + + /** + * Returns human-friendly help for the generator. Provide the consumer with help + * tips, parameters here + * + * @return A string value for the help message + */ + public String getHelp() { + return "Generates a gatling simulation library."; + } + + public ScalaGatlingCodegen() { + super(); + + // set the output folder here + outputFolder = "generated-code/gatling"; + + /** + * Api classes. You can write classes for each Api file with the apiTemplateFiles map. + * as with models, add multiple entries with different extensions for multiple files per + * class + */ + apiTemplateFiles.put( + "api.mustache", // the template to use + "Simulation.scala"); // the extension for each file to write + + modelTemplateFiles.put("model.mustache", ".scala"); + + /** + * Template Location. This is the location which templates will be read from. The generator + * will use the resource stream to attempt to read the templates. + */ + templateDir = "ScalaGatling"; + + /** + * Api Package. Optional, if needed, this can be used in templates + */ + apiPackage = "io.swagger.client.api"; + + /** + * Model Package. Optional, if needed, this can be used in templates + */ + modelPackage = "io.swagger.client.model"; + + /** + * Additional Properties. These values can be passed to the templates and + * are available in models, apis, and supporting files + */ + additionalProperties.put("apiVersion", apiVersion); + + /** + * Supporting Files. You can write single files for the generator with the + * entire object tree available. If the input file has a suffix of `.mustache + * it will be processed by the template engine. Otherwise, it will be copied + */ + supportingFiles.add(new SupportingFile("build.gradle", + "", + "build.gradle")); + supportingFiles.add(new SupportingFile("logback.xml", + confFolder, + "logback.xml")); + supportingFiles.add(new SupportingFile("default.conf.mustache", + confFolder, + "default.conf")); + supportingFiles.add(new SupportingFile("default.conf.mustache", + confFolder, + "CI.conf")); + supportingFiles.add(new SupportingFile("default.conf.mustache", + confFolder, + "CD.conf")); + supportingFiles.add(new SupportingFile("default.conf.mustache", + confFolder, + "stress.conf")); + supportingFiles.add(new SupportingFile("default.conf.mustache", + confFolder, + "baseline.conf")); + supportingFiles.add(new SupportingFile("default.conf.mustache", + confFolder, + "longevity.conf")); + + + importMapping.remove("List"); + importMapping.remove("Set"); + importMapping.remove("Map"); + + importMapping.put("Date", "java.util.Date"); + importMapping.put("ListBuffer", "scala.collection.mutable.ListBuffer"); + + typeMapping = new HashMap(); + typeMapping.put("enum", "NSString"); + typeMapping.put("array", "List"); + typeMapping.put("set", "Set"); + typeMapping.put("boolean", "Boolean"); + typeMapping.put("string", "String"); + typeMapping.put("int", "Int"); + typeMapping.put("long", "Long"); + typeMapping.put("float", "Float"); + typeMapping.put("byte", "Byte"); + typeMapping.put("short", "Short"); + typeMapping.put("char", "Char"); + typeMapping.put("double", "Double"); + typeMapping.put("object", "Any"); + typeMapping.put("file", "File"); + typeMapping.put("binary", "String"); + typeMapping.put("ByteArray", "String"); + typeMapping.put("date-time", "Date"); + typeMapping.put("DateTime", "Date"); + + instantiationTypes.put("array", "ListBuffer"); + instantiationTypes.put("map", "HashMap"); + + setReservedWordsLowerCase( + Arrays.asList( + // local variable names used in API methods (endpoints) + "path", "contentTypes", "contentType", "queryParams", "headerParams", + "formParams", "postBody", "mp", "basePath", "apiInvoker", + + // scala reserved words + "abstract", "case", "catch", "class", "def", "do", "else", "extends", + "false", "final", "finally", "for", "forSome", "if", "implicit", + "import", "lazy", "match", "new", "null", "object", "override", "package", + "private", "protected", "return", "sealed", "super", "this", "throw", + "trait", "try", "true", "type", "val", "var", "while", "with", "yield") + ); + } + + /** + * Gatling does not need the models to have escaped words as it builds models dynamically instead of through + * an instance of the object. + * + * @return the escaped term + */ + @Override + public String escapeReservedWord(String name) { + return name; + } + + /** + * Location to write model files. You can use the modelPackage() as defined when the class is + * instantiated + */ + public String modelFileFolder() { + return outputFolder + "/" + sourceFolder + "/" + modelPackage().replace('.', File.separatorChar); + } + + /** + * Location to write api files. You can use the apiPackage() as defined when the class is + * instantiated + */ + @Override + public String apiFileFolder() { + return outputFolder + "/" + sourceFolder + "/" + apiPackage().replace('.', File.separatorChar); + } + + /** + * Modifies the swagger doc to make mustache easier to use + * + * @param swagger + */ + @Override + public void preprocessSwagger(Swagger swagger) { + for (String pathname : swagger.getPaths().keySet()) { + Path path = swagger.getPath(pathname); + if (path.getOperations() == null) { + continue; + } + for (Operation operation : path.getOperations()) { + if (!operation.getVendorExtensions().keySet().contains("x-gatling-path")) { + if (pathname.contains("{")) { + String gatlingPath = pathname.replaceAll("\\{", "\\$\\{"); + operation.setVendorExtension("x-gatling-path", gatlingPath); + } else { + operation.setVendorExtension("x-gatling-path", pathname); + } + } + + Set headerParameters = new HashSet<>(); + Set formParameters = new HashSet<>(); + Set queryParameters = new HashSet<>(); + Set pathParameters = new HashSet<>(); + + for (Parameter parameter : operation.getParameters()) { + if (parameter.getIn().equalsIgnoreCase("header")) { + headerParameters.add(parameter); + } + if (parameter.getIn().equalsIgnoreCase("formData")) { + formParameters.add(parameter); + } + if (parameter.getIn().equalsIgnoreCase("query")) { + queryParameters.add(parameter); + } + if (parameter.getIn().equalsIgnoreCase("path")) { + pathParameters.add(parameter); + } + if (parameter.getIn().equalsIgnoreCase("body")) { + BodyParameter bodyParameter = (BodyParameter) parameter; + Model model = bodyParameter.getSchema(); + if (model instanceof RefModel) { + String[] refArray = model.getReference().split("\\/"); + operation.setVendorExtension("x-gatling-body-object", refArray[refArray.length - 1] + ".toStringBody"); + Set bodyFeederParams = new HashSet<>(); + Set sessionBodyVars = new HashSet<>(); + for (Map.Entry modelEntry : swagger.getDefinitions().entrySet()) { + if (refArray[refArray.length - 1].equalsIgnoreCase(modelEntry.getKey())) { + for (Map.Entry propertyEntry : modelEntry.getValue().getProperties().entrySet()) { + bodyFeederParams.add(propertyEntry.getKey()); + sessionBodyVars.add("\"${" + propertyEntry.getKey() + "}\""); + } + } + } + operation.setVendorExtension("x-gatling-body-feeder", operation.getOperationId() + "BodyFeeder"); + operation.setVendorExtension("x-gatling-body-feeder-params", StringUtils.join(sessionBodyVars, ",")); + try { + FileUtils.writeStringToFile(new File(outputFolder + File.separator + dataFolder + File.separator + operation.getOperationId() + "-" + "BodyParams.csv"), StringUtils.join(bodyFeederParams, ",")); + } catch (IOException ioe) { + LOGGER.error("Could not create feeder file for operationId" + operation.getOperationId(), ioe); + } + + } else if (model instanceof ArrayModel) { + operation.setVendorExtension("x-gatling-body-object", "StringBody(\"[]\")"); + } else { + operation.setVendorExtension("x-gatling-body-object", "StringBody(\"{}\")"); + } + + } + } + + prepareGatlingData(operation, headerParameters, "header"); + prepareGatlingData(operation, formParameters, "form"); + prepareGatlingData(operation, queryParameters, "query"); + prepareGatlingData(operation, pathParameters, "path"); + } + } + + } + + /** + * Creates all the necessary swagger vendor extensions and feeder files for gatling + * + * @param operation Swagger Operation + * @param parameters Swagger Parameters + * @param parameterType Swagger Parameter Type + */ + private void prepareGatlingData(Operation operation, Set parameters, String parameterType) { + if (parameters.size() > 0) { + List parameterNames = new ArrayList<>(); + List vendorList = new ArrayList<>(); + for (Parameter parameter : parameters) { + Map extensionMap = new HashMap<>(); + extensionMap.put("gatlingParamName", parameter.getName()); + extensionMap.put("gatlingParamValue", "${" + parameter.getName() + "}"); + vendorList.add(extensionMap); + parameterNames.add(parameter.getName()); + } + operation.setVendorExtension("x-gatling-" + parameterType.toLowerCase() + "-params", vendorList); + operation.setVendorExtension("x-gatling-" + parameterType.toLowerCase() + "-feeder", operation.getOperationId() + parameterType.toUpperCase() + "Feeder"); + try { + FileUtils.writeStringToFile(new File(outputFolder + File.separator + dataFolder + File.separator + operation.getOperationId() + "-" + parameterType.toLowerCase() + "Params.csv"), StringUtils.join(parameterNames, ",")); + } catch (IOException ioe) { + LOGGER.error("Could not create feeder file for operationId" + operation.getOperationId(), ioe); + } + } + } + + /** + * Optional - type declaration. This is a String which is used by the templates to instantiate your + * types. There is typically special handling for different property types + * + * @return a string value used as the `dataType` field for model templates, `returnType` for api templates + */ + @Override + public String getTypeDeclaration(Property p) { + if (p instanceof ArrayProperty) { + ArrayProperty ap = (ArrayProperty) p; + Property inner = ap.getItems(); + return getSwaggerType(p) + "[" + getTypeDeclaration(inner) + "]"; + } else if (p instanceof MapProperty) { + MapProperty mp = (MapProperty) p; + Property inner = mp.getAdditionalProperties(); + return getSwaggerType(p) + "[String, " + getTypeDeclaration(inner) + "]"; + } + return super.getTypeDeclaration(p); + } + + /** + * Optional - swagger type conversion. This is used to map swagger types in a `Property` into + * either language specific types via `typeMapping` or into complex models if there is not a mapping. + * + * @return a string value of the type or complex model for this property + * @see io.swagger.models.properties.Property + */ + @Override + public String getSwaggerType(Property p) { + String swaggerType = super.getSwaggerType(p); + String type = null; + if (typeMapping.containsKey(swaggerType)) { + type = typeMapping.get(swaggerType); + if (languageSpecificPrimitives.contains(type)) + return toModelName(type); + } else + type = swaggerType; + return toModelName(type); + } +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig b/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig index 97724a5d0e4..b787a7b6a3a 100644 --- a/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig +++ b/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig @@ -19,6 +19,7 @@ io.swagger.codegen.languages.ErlangServerCodegen io.swagger.codegen.languages.FinchServerCodegen io.swagger.codegen.languages.FlashClientCodegen io.swagger.codegen.languages.FlaskConnexionCodegen +io.swagger.codegen.languages.ScalaGatlingCodegen io.swagger.codegen.languages.GoClientCodegen io.swagger.codegen.languages.GoServerCodegen io.swagger.codegen.languages.GroovyClientCodegen diff --git a/modules/swagger-codegen/src/main/resources/ScalaGatling/api.mustache b/modules/swagger-codegen/src/main/resources/ScalaGatling/api.mustache new file mode 100644 index 00000000000..09ca1261324 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ScalaGatling/api.mustache @@ -0,0 +1,147 @@ +package {{package}} + +import {{modelPackage}}._ +import com.typesafe.config.ConfigFactory + +import io.gatling.core.Predef._ +import io.gatling.http.Predef._ +import io.gatling.core.structure.PopulationBuilder + +import java.io.File + +import scala.collection.mutable + +class {{classname}}Simulation extends Simulation { + + def getCurrentDirectory = new File("").getAbsolutePath + def userDataDirectory = getCurrentDirectory + "/src/gatling/resources/data" + + // basic test setup + val configName = System.getProperty("testConfig", "baseline") + val config = ConfigFactory.load(configName).withFallback(ConfigFactory.load("default")) + val durationSeconds = config.getInt("performance.durationSeconds") + val rampUpSeconds = config.getInt("performance.rampUpSeconds") + val rampDownSeconds = config.getInt("performance.rampDownSeconds") + val authentication = config.getString("performance.authorizationHeader") + val acceptHeader = config.getString("performance.acceptType") + val contentTypeHeader = config.getString("performance.contentType") + val rateMultiplier = config.getDouble("performance.rateMultiplier") + val instanceMultiplier = config.getDouble("performance.instanceMultiplier") + + // global assertion data + val globalResponseTimeMinLTE = config.getInt("performance.global.assertions.responseTime.min.lte") + val globalResponseTimeMinGTE = config.getInt("performance.global.assertions.responseTime.min.gte") + val globalResponseTimeMaxLTE = config.getInt("performance.global.assertions.responseTime.max.lte") + val globalResponseTimeMaxGTE = config.getInt("performance.global.assertions.responseTime.max.gte") + val globalResponseTimeMeanLTE = config.getInt("performance.global.assertions.responseTime.mean.lte") + val globalResponseTimeMeanGTE = config.getInt("performance.global.assertions.responseTime.mean.gte") + val globalResponseTimeFailedRequestsPercentLTE = config.getDouble("performance.global.assertions.failedRequests.percent.lte") + val globalResponseTimeFailedRequestsPercentGTE = config.getDouble("performance.global.assertions.failedRequests.percent.gte") + val globalResponseTimeSuccessfulRequestsPercentLTE = config.getDouble("performance.global.assertions.successfulRequests.percent.lte") + val globalResponseTimeSuccessfulRequestsPercentGTE = config.getDouble("performance.global.assertions.successfulRequests.percent.gte") + +// Setup http protocol configuration + val httpConf = http + .baseURL("{{basePath}}") + .doNotTrackHeader("1") + .acceptLanguageHeader("en-US,en;q=0.5") + .acceptEncodingHeader("gzip, deflate") + .userAgentHeader("Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0") + .acceptHeader(acceptHeader) + .contentTypeHeader(contentTypeHeader) + + // set authorization header if it has been modified from config + if(!authentication.equals("~MANUAL_ENTRY")){ + httpConf.authorizationHeader(authentication) + } + + // Setup all the operations per second for the test to ultimately be generated from configs +{{#operations}} +{{#operation}} + val {{operationId}}PerSecond = config.getDouble("performance.operationsPerSecond.{{operationId}}") * rateMultiplier * instanceMultiplier +{{/operation}} +{{/operations}} + + val scenarioBuilders: mutable.MutableList[PopulationBuilder] = new mutable.MutableList[PopulationBuilder]() + + // Set up CSV feeders +{{#operations}} +{{#operation}} + {{#vendorExtensions.x-gatling-query-feeder}} + val {{vendorExtensions.x-gatling-query-feeder}} = csv(userDataDirectory + File.separator + "{{operationId}}-queryParams.csv").random + {{/vendorExtensions.x-gatling-query-feeder}} + {{#vendorExtensions.x-gatling-header-feeder}} + val {{vendorExtensions.x-gatling-header-feeder}} = csv(userDataDirectory + File.separator + "{{operationId}}-headerParams.csv").random + {{/vendorExtensions.x-gatling-header-feeder}} + {{#vendorExtensions.x-gatling-form-feeder}} + val {{vendorExtensions.x-gatling-form-feeder}} = csv(userDataDirectory + File.separator + "{{operationId}}-formParams.csv").random + {{/vendorExtensions.x-gatling-form-feeder}} + {{#vendorExtensions.x-gatling-path-feeder}} + val {{vendorExtensions.x-gatling-path-feeder}} = csv(userDataDirectory + File.separator + "{{operationId}}-pathParams.csv").random + {{/vendorExtensions.x-gatling-path-feeder}} + {{#vendorExtensions.x-gatling-body-feeder}} + val {{vendorExtensions.x-gatling-body-feeder}} = csv(userDataDirectory + File.separator + "{{operationId}}-bodyParams.csv", escapeChar = '\\').random + {{/vendorExtensions.x-gatling-body-feeder}} +{{/operation}} +{{/operations}} + + // Setup all scenarios + +{{#operations}} +{{#operation}} + {{#description}}/* {{{description}}} */{{/description}} + val scn{{operationId}} = scenario("{{operationId}}Simulation") + {{#vendorExtensions.x-gatling-query-feeder}} + .feed({{vendorExtensions.x-gatling-query-feeder}}) + {{/vendorExtensions.x-gatling-query-feeder}} + {{#vendorExtensions.x-gatling-header-feeder}} + .feed({{vendorExtensions.x-gatling-header-feeder}}) + {{/vendorExtensions.x-gatling-header-feeder}} + {{#vendorExtensions.x-gatling-form-feeder}} + .feed({{vendorExtensions.x-gatling-form-feeder}}) + {{/vendorExtensions.x-gatling-form-feeder}} + {{#vendorExtensions.x-gatling-body-feeder}} + .feed({{vendorExtensions.x-gatling-body-feeder}}) + {{/vendorExtensions.x-gatling-body-feeder}} + {{#vendorExtensions.x-gatling-path-feeder}} + .feed({{vendorExtensions.x-gatling-path-feeder}}) + {{/vendorExtensions.x-gatling-path-feeder}} + .exec(http("{{operationId}}") + .httpRequest("{{httpMethod}}","{{{vendorExtensions.x-gatling-path}}}") + {{#vendorExtensions.x-gatling-query-params}} + .queryParam("{{gatlingParamName}}","{{gatlingParamValue}}") + {{/vendorExtensions.x-gatling-query-params}} + {{#vendorExtensions.x-gatling-header-params}} + .header("{{gatlingParamName}}","{{gatlingParamValue}}") + {{/vendorExtensions.x-gatling-header-params}} + {{#vendorExtensions.x-gatling-form-params}} + .formParam("{{gatlingParamName}}","{{gatlingParamValue}}") + {{/vendorExtensions.x-gatling-form-params}} + {{#vendorExtensions.x-gatling-body-object}} + .body(StringBody({{{vendorExtensions.x-gatling-body-object}}}{{#vendorExtensions.x-gatling-body-feeder-params}}({{{vendorExtensions.x-gatling-body-feeder-params}}}){{/vendorExtensions.x-gatling-body-feeder-params}})) + {{/vendorExtensions.x-gatling-body-object}}) + + // Run scn{{operationId}} with warm up and reach a constant rate for entire duration + scenarioBuilders += scn{{operationId}}.inject( + rampUsersPerSec(1) to({{operationId}}PerSecond) during(rampUpSeconds), + constantUsersPerSec({{operationId}}PerSecond) during(durationSeconds), + rampUsersPerSec({{operationId}}PerSecond) to(1) during(rampDownSeconds) + ) + +{{/operation}} +{{/operations}} + setUp( + scenarioBuilders.toList + ).protocols(httpConf).assertions( + global.responseTime.min.lte(globalResponseTimeMinLTE), + global.responseTime.min.gte(globalResponseTimeMinGTE), + global.responseTime.max.lte(globalResponseTimeMaxLTE), + global.responseTime.max.gte(globalResponseTimeMaxGTE), + global.responseTime.mean.lte(globalResponseTimeMeanLTE), + global.responseTime.mean.gte(globalResponseTimeMeanGTE), + global.failedRequests.percent.lte(globalResponseTimeFailedRequestsPercentLTE), + global.failedRequests.percent.gte(globalResponseTimeFailedRequestsPercentGTE), + global.successfulRequests.percent.lte(globalResponseTimeSuccessfulRequestsPercentLTE), + global.successfulRequests.percent.gte(globalResponseTimeSuccessfulRequestsPercentGTE) + ) +} diff --git a/modules/swagger-codegen/src/main/resources/ScalaGatling/build.gradle b/modules/swagger-codegen/src/main/resources/ScalaGatling/build.gradle new file mode 100644 index 00000000000..6671c428cbf --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ScalaGatling/build.gradle @@ -0,0 +1,29 @@ +plugins { + id 'com.github.lkishalmi.gatling' version '0.4.1' +} + +repositories { + mavenCentral() +} + +dependencies { + +} + +apply plugin: "com.github.lkishalmi.gatling" + +gatling { + toolVersion = '2.3.0' + jvmArgs = ['-server', '-XX:+UseThreadPriorities', + '-XX:ThreadPriorityPolicy=42', + '-Xms2048M', '-Xmx2048M', '-Xmn500M', + '-XX:+HeapDumpOnOutOfMemoryError', + '-XX:+AggressiveOpts', + '-XX:+OptimizeStringConcat', + '-XX:+UseFastAccessorMethods', + '-XX:+UseParNewGC', + '-XX:+UseConcMarkSweepGC', + '-XX:+CMSParallelRemarkEnabled', + '-Djava.net.preferIPv4Stack=true', + '-Djava.net.preferIPv6Addresses=false'] +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/ScalaGatling/default.conf.mustache b/modules/swagger-codegen/src/main/resources/ScalaGatling/default.conf.mustache new file mode 100644 index 00000000000..2f1f05d3c69 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ScalaGatling/default.conf.mustache @@ -0,0 +1,51 @@ +performance { + authorizationHeader = "~MANUAL_ENTRY~" + rampUpSeconds = 60 + rampDownSeconds = 60 + durationSeconds = 360 + contentType = "application/json" + acceptType = "application/json" + rateMultiplier = 1 + instanceMultiplier = 1 + operationsPerSecond { + {{#apiInfo}} + {{#apis}} + {{#operations}} + {{#operation}} + {{operationId}} = 1 + {{/operation}} + {{/operations}} + {{/apis}} + {{/apiInfo}} + } + global { + assertions { + responseTime { + min { + lte = 30000 + gte = 0 + } + max { + lte = 30000 + gte = 0 + } + mean { + lte = 30000 + gte = 0 + } + } + failedRequests { + percent { + lte = 5 + gte = 0 + } + } + successfulRequests { + percent { + lte = 100 + gte = 0 + } + } + } + } +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/ScalaGatling/gatling.conf b/modules/swagger-codegen/src/main/resources/ScalaGatling/gatling.conf new file mode 100644 index 00000000000..c12ecee00f3 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ScalaGatling/gatling.conf @@ -0,0 +1,132 @@ +######################### +# Gatling Configuration # +######################### + +# This file contains all the settings configurable for Gatling with their default values + +gatling { + core { + outputDirectoryBaseName = "" # The prefix for each simulation result folder (then suffixed by the report generation timestamp) + runDescription = "" # The description for this simulation run, displayed in each report + encoding = "utf-8" # Encoding to use throughout Gatling for file and string manipulation + simulationClass = "" # The FQCN of the simulation to run (when used in conjunction with noReports, the simulation for which assertions will be validated) + mute = false # When set to true, don't ask for simulation name nor run description (currently only used by Gatling SBT plugin) + elFileBodiesCacheMaxCapacity = 200 # Cache size for request body EL templates, set to 0 to disable + rawFileBodiesCacheMaxCapacity = 200 # Cache size for request body Raw templates, set to 0 to disable + rawFileBodiesInMemoryMaxSize = 1000 # Below this limit, raw file bodies will be cached in memory + pebbleFileBodiesCacheMaxCapacity = 200 # Cache size for request body Peeble templates, set to 0 to disable + + extract { + regex { + cacheMaxCapacity = 200 # Cache size for the compiled regexes, set to 0 to disable caching + } + xpath { + cacheMaxCapacity = 200 # Cache size for the compiled XPath queries, set to 0 to disable caching + } + jsonPath { + cacheMaxCapacity = 200 # Cache size for the compiled jsonPath queries, set to 0 to disable caching + preferJackson = false # When set to true, prefer Jackson over Boon for JSON-related operations + } + css { + cacheMaxCapacity = 200 # Cache size for the compiled CSS selectors queries, set to 0 to disable caching + } + } + + directory { + data = user-files/data # Folder where user's data (e.g. files used by Feeders) is located + bodies = user-files/bodies # Folder where bodies are located + simulations = user-files/simulations # Folder where the bundle's simulations are located + reportsOnly = "" # If set, name of report folder to look for in order to generate its report + binaries = "" # If set, name of the folder where compiles classes are located: Defaults to GATLING_HOME/target. + results = results # Name of the folder where all reports folder are located + } + } + charting { + noReports = false # When set to true, don't generate HTML reports + maxPlotPerSeries = 1000 # Number of points per graph in Gatling reports + useGroupDurationMetric = false # Switch group timings from cumulated response time to group duration. + indicators { + lowerBound = 800 # Lower bound for the requests' response time to track in the reports and the console summary + higherBound = 1200 # Higher bound for the requests' response time to track in the reports and the console summary + percentile1 = 50 # Value for the 1st percentile to track in the reports, the console summary and Graphite + percentile2 = 75 # Value for the 2nd percentile to track in the reports, the console summary and Graphite + percentile3 = 95 # Value for the 3rd percentile to track in the reports, the console summary and Graphite + percentile4 = 99 # Value for the 4th percentile to track in the reports, the console summary and Graphite + } + } + http { + fetchedCssCacheMaxCapacity = 200 # Cache size for CSS parsed content, set to 0 to disable + fetchedHtmlCacheMaxCapacity = 200 # Cache size for HTML parsed content, set to 0 to disable + perUserCacheMaxCapacity = 200 # Per virtual user cache size, set to 0 to disable + warmUpUrl = "http://gatling.io" # The URL to use to warm-up the HTTP stack (blank means disabled) + enableGA = true # Very light Google Analytics, please support + ssl { + keyStore { + type = "" # Type of SSLContext's KeyManagers store + file = "" # Location of SSLContext's KeyManagers store + password = "" # Password for SSLContext's KeyManagers store + algorithm = "" # Algorithm used SSLContext's KeyManagers store + } + trustStore { + type = "" # Type of SSLContext's TrustManagers store + file = "" # Location of SSLContext's TrustManagers store + password = "" # Password for SSLContext's TrustManagers store + algorithm = "" # Algorithm used by SSLContext's TrustManagers store + } + } + ahc { + keepAlive = true # Allow pooling HTTP connections (keep-alive header automatically added) + connectTimeout = 10000 # Timeout when establishing a connection + handshakeTimeout = 10000 # Timeout when performing TLS hashshake + pooledConnectionIdleTimeout = 60000 # Timeout when a connection stays unused in the pool + readTimeout = 60000 # Timeout when a used connection stays idle + maxRetry = 2 # Number of times that a request should be tried again + requestTimeout = 60000 # Timeout of the requests + disableHttpsEndpointIdentificationAlgorithm = true # When set to true, don't enable SSL algorithm on the SSLEngine + useInsecureTrustManager = true # Use an insecure TrustManager that trusts all server certificates + httpClientCodecMaxChunkSize = 8192 # Maximum length of the content or each chunk + httpClientCodecInitialBufferSize = 128 # Initial HttpClientCodec buffer size + sslEnabledProtocols = [TLSv1.2, TLSv1.1, TLSv1] # Array of enabled protocols for HTTPS, if empty use the JDK defaults + sslEnabledCipherSuites = [] # Array of enabled cipher suites for HTTPS, if empty use the AHC defaults + sslSessionCacheSize = 0 # SSLSession cache size, set to 0 to use JDK's default + sslSessionTimeout = 0 # SSLSession timeout in seconds, set to 0 to use JDK's default (24h) + useOpenSsl = false # if OpenSSL should be used instead of JSSE (requires tcnative jar) + useNativeTransport = false # if native transport should be used instead of Java NIO (requires netty-transport-native-epoll, currently Linux only) + tcpNoDelay = true + soReuseAddress = false + soLinger = -1 + soSndBuf = -1 + soRcvBuf = -1 + allocator = "pooled" # switch to unpooled for unpooled ByteBufAllocator + maxThreadLocalCharBufferSize = 200000 # Netty's default is 16k + } + dns { + queryTimeout = 5000 # Timeout of each DNS query in millis + maxQueriesPerResolve = 6 # Maximum allowed number of DNS queries for a given name resolution + } + } + jms { + replyTimeoutScanPeriod = 1000 # scan period for timedout reply messages + } + data { + writers = [console, file] # The list of DataWriters to which Gatling write simulation data (currently supported : console, file, graphite, jdbc) + console { + light = false # When set to true, displays a light version without detailed request stats + } + file { + bufferSize = 8192 # FileDataWriter's internal data buffer size, in bytes + } + leak { + noActivityTimeout = 30 # Period, in seconds, for which Gatling may have no activity before considering a leak may be happening + } + graphite { + light = false # only send the all* stats + host = "localhost" # The host where the Carbon server is located + port = 2003 # The port to which the Carbon server listens to (2003 is default for plaintext, 2004 is default for pickle) + protocol = "tcp" # The protocol used to send data to Carbon (currently supported : "tcp", "udp") + rootPathPrefix = "gatling" # The common prefix of all metrics sent to Graphite + bufferSize = 8192 # GraphiteDataWriter's internal data buffer size, in bytes + writeInterval = 1 # GraphiteDataWriter's write interval, in seconds + } + } +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/ScalaGatling/licenseInfo.mustache b/modules/swagger-codegen/src/main/resources/ScalaGatling/licenseInfo.mustache new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/swagger-codegen/src/main/resources/ScalaGatling/logback.xml b/modules/swagger-codegen/src/main/resources/ScalaGatling/logback.xml new file mode 100644 index 00000000000..f60d0182ac3 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ScalaGatling/logback.xml @@ -0,0 +1,22 @@ + + + + + + %d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx + + false + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/ScalaGatling/model.mustache b/modules/swagger-codegen/src/main/resources/ScalaGatling/model.mustache new file mode 100644 index 00000000000..5c5e39f514a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ScalaGatling/model.mustache @@ -0,0 +1,26 @@ +{{>licenseInfo}} +package {{package}} + +{{#imports}}import {{import}} +{{/imports}} + +{{#models}} +{{#model}} +case class {{classname}} ( +{{#vars}} +{{#description}} + /* {{{description}}} */ +{{/description}} + _{{{name}}}: {{^required}}Option[{{/required}}{{datatype}}{{^required}}]{{/required}}{{#hasMore}},{{/hasMore}} +{{/vars}} +) +object {{classname}} { + def toStringBody({{#vars}}var_{{name}}: {{^required}}{{/required}}Object{{^required}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/vars}}) = + s""" + | { + | {{#vars}}"{{{name}}}":$var_{{{name}}}{{#hasMore}},{{/hasMore}}{{/vars}} + | } + """.stripMargin +} +{{/model}} +{{/models}} \ No newline at end of file diff --git a/samples/client/petstore-security-test/java/okhttp-gson/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore-security-test/java/okhttp-gson/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore-security-test/java/okhttp-gson/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore-security-test/java/okhttp-gson/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore-security-test/java/okhttp-gson/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore-security-test/java/okhttp-gson/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore-security-test/java/okhttp-gson/src/main/gen/io/swagger/client/R.java b/samples/client/petstore-security-test/java/okhttp-gson/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore-security-test/java/okhttp-gson/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/java/feign/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/feign/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore/java/feign/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/feign/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore/java/feign/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/feign/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/java/google-api-client/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/google-api-client/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore/java/google-api-client/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/google-api-client/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore/java/google-api-client/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/google-api-client/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey1/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/jersey1/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey1/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/jersey1/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey1/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/jersey1/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java6/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/jersey2-java6/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java6/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/jersey2-java6/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java6/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/jersey2-java6/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/jersey2-java8/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/jersey2-java8/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/jersey2-java8/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/jersey2/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/jersey2/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/jersey2/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/okhttp-gson/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/okhttp-gson/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/okhttp-gson/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/java/resteasy/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/resteasy/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore/java/resteasy/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/resteasy/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore/java/resteasy/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/resteasy/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/resttemplate-withXml/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/resttemplate-withXml/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/resttemplate/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/resttemplate/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/resttemplate/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/retrofit/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/retrofit/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/retrofit/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/retrofit2-play24/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/retrofit2-play24/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/retrofit2-play24/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/retrofit2/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/retrofit2/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/retrofit2/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/retrofit2rx/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/retrofit2rx/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/retrofit2rx/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/retrofit2rx2/src/main/gen/io/swagger/client/BuildConfig.java new file mode 100644 index 00000000000..720765940d3 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/gen/io/swagger/client/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/retrofit2rx2/src/main/gen/io/swagger/client/Manifest.java new file mode 100644 index 00000000000..41e0523a208 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/gen/io/swagger/client/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/retrofit2rx2/src/main/gen/io/swagger/client/R.java new file mode 100644 index 00000000000..cd0683364d5 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/gen/io/swagger/client/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package io.swagger.client; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/.swagger-codegen-ignore b/samples/client/petstore/scala-gatling/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/client/petstore/scala-gatling/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/scala-gatling/.swagger-codegen/VERSION b/samples/client/petstore/scala-gatling/.swagger-codegen/VERSION new file mode 100644 index 00000000000..f9f7450d135 --- /dev/null +++ b/samples/client/petstore/scala-gatling/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/build.gradle b/samples/client/petstore/scala-gatling/build.gradle new file mode 100644 index 00000000000..6671c428cbf --- /dev/null +++ b/samples/client/petstore/scala-gatling/build.gradle @@ -0,0 +1,29 @@ +plugins { + id 'com.github.lkishalmi.gatling' version '0.4.1' +} + +repositories { + mavenCentral() +} + +dependencies { + +} + +apply plugin: "com.github.lkishalmi.gatling" + +gatling { + toolVersion = '2.3.0' + jvmArgs = ['-server', '-XX:+UseThreadPriorities', + '-XX:ThreadPriorityPolicy=42', + '-Xms2048M', '-Xmx2048M', '-Xmn500M', + '-XX:+HeapDumpOnOutOfMemoryError', + '-XX:+AggressiveOpts', + '-XX:+OptimizeStringConcat', + '-XX:+UseFastAccessorMethods', + '-XX:+UseParNewGC', + '-XX:+UseConcMarkSweepGC', + '-XX:+CMSParallelRemarkEnabled', + '-Djava.net.preferIPv4Stack=true', + '-Djava.net.preferIPv6Addresses=false'] +} \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/conf/CD.conf b/samples/client/petstore/scala-gatling/src/gatling/resources/conf/CD.conf new file mode 100644 index 00000000000..1d75d0e40f9 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/conf/CD.conf @@ -0,0 +1,62 @@ +performance { + authorizationHeader = "~MANUAL_ENTRY~" + rampUpSeconds = 60 + rampDownSeconds = 60 + durationSeconds = 360 + contentType = "application/json" + acceptType = "application/json" + rateMultiplier = 1 + instanceMultiplier = 1 + operationsPerSecond { + addPet = 1 + deletePet = 1 + findPetsByStatus = 1 + findPetsByTags = 1 + getPetById = 1 + updatePet = 1 + updatePetWithForm = 1 + uploadFile = 1 + deleteOrder = 1 + getInventory = 1 + getOrderById = 1 + placeOrder = 1 + createUser = 1 + createUsersWithArrayInput = 1 + createUsersWithListInput = 1 + deleteUser = 1 + getUserByName = 1 + loginUser = 1 + logoutUser = 1 + updateUser = 1 + } + global { + assertions { + responseTime { + min { + lte = 30000 + gte = 0 + } + max { + lte = 30000 + gte = 0 + } + mean { + lte = 30000 + gte = 0 + } + } + failedRequests { + percent { + lte = 5 + gte = 0 + } + } + successfulRequests { + percent { + lte = 100 + gte = 0 + } + } + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/conf/CI.conf b/samples/client/petstore/scala-gatling/src/gatling/resources/conf/CI.conf new file mode 100644 index 00000000000..1d75d0e40f9 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/conf/CI.conf @@ -0,0 +1,62 @@ +performance { + authorizationHeader = "~MANUAL_ENTRY~" + rampUpSeconds = 60 + rampDownSeconds = 60 + durationSeconds = 360 + contentType = "application/json" + acceptType = "application/json" + rateMultiplier = 1 + instanceMultiplier = 1 + operationsPerSecond { + addPet = 1 + deletePet = 1 + findPetsByStatus = 1 + findPetsByTags = 1 + getPetById = 1 + updatePet = 1 + updatePetWithForm = 1 + uploadFile = 1 + deleteOrder = 1 + getInventory = 1 + getOrderById = 1 + placeOrder = 1 + createUser = 1 + createUsersWithArrayInput = 1 + createUsersWithListInput = 1 + deleteUser = 1 + getUserByName = 1 + loginUser = 1 + logoutUser = 1 + updateUser = 1 + } + global { + assertions { + responseTime { + min { + lte = 30000 + gte = 0 + } + max { + lte = 30000 + gte = 0 + } + mean { + lte = 30000 + gte = 0 + } + } + failedRequests { + percent { + lte = 5 + gte = 0 + } + } + successfulRequests { + percent { + lte = 100 + gte = 0 + } + } + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/conf/baseline.conf b/samples/client/petstore/scala-gatling/src/gatling/resources/conf/baseline.conf new file mode 100644 index 00000000000..1d75d0e40f9 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/conf/baseline.conf @@ -0,0 +1,62 @@ +performance { + authorizationHeader = "~MANUAL_ENTRY~" + rampUpSeconds = 60 + rampDownSeconds = 60 + durationSeconds = 360 + contentType = "application/json" + acceptType = "application/json" + rateMultiplier = 1 + instanceMultiplier = 1 + operationsPerSecond { + addPet = 1 + deletePet = 1 + findPetsByStatus = 1 + findPetsByTags = 1 + getPetById = 1 + updatePet = 1 + updatePetWithForm = 1 + uploadFile = 1 + deleteOrder = 1 + getInventory = 1 + getOrderById = 1 + placeOrder = 1 + createUser = 1 + createUsersWithArrayInput = 1 + createUsersWithListInput = 1 + deleteUser = 1 + getUserByName = 1 + loginUser = 1 + logoutUser = 1 + updateUser = 1 + } + global { + assertions { + responseTime { + min { + lte = 30000 + gte = 0 + } + max { + lte = 30000 + gte = 0 + } + mean { + lte = 30000 + gte = 0 + } + } + failedRequests { + percent { + lte = 5 + gte = 0 + } + } + successfulRequests { + percent { + lte = 100 + gte = 0 + } + } + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/conf/default.conf b/samples/client/petstore/scala-gatling/src/gatling/resources/conf/default.conf new file mode 100644 index 00000000000..1d75d0e40f9 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/conf/default.conf @@ -0,0 +1,62 @@ +performance { + authorizationHeader = "~MANUAL_ENTRY~" + rampUpSeconds = 60 + rampDownSeconds = 60 + durationSeconds = 360 + contentType = "application/json" + acceptType = "application/json" + rateMultiplier = 1 + instanceMultiplier = 1 + operationsPerSecond { + addPet = 1 + deletePet = 1 + findPetsByStatus = 1 + findPetsByTags = 1 + getPetById = 1 + updatePet = 1 + updatePetWithForm = 1 + uploadFile = 1 + deleteOrder = 1 + getInventory = 1 + getOrderById = 1 + placeOrder = 1 + createUser = 1 + createUsersWithArrayInput = 1 + createUsersWithListInput = 1 + deleteUser = 1 + getUserByName = 1 + loginUser = 1 + logoutUser = 1 + updateUser = 1 + } + global { + assertions { + responseTime { + min { + lte = 30000 + gte = 0 + } + max { + lte = 30000 + gte = 0 + } + mean { + lte = 30000 + gte = 0 + } + } + failedRequests { + percent { + lte = 5 + gte = 0 + } + } + successfulRequests { + percent { + lte = 100 + gte = 0 + } + } + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/conf/logback.xml b/samples/client/petstore/scala-gatling/src/gatling/resources/conf/logback.xml new file mode 100644 index 00000000000..f60d0182ac3 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/conf/logback.xml @@ -0,0 +1,22 @@ + + + + + + %d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx + + false + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/conf/longevity.conf b/samples/client/petstore/scala-gatling/src/gatling/resources/conf/longevity.conf new file mode 100644 index 00000000000..1d75d0e40f9 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/conf/longevity.conf @@ -0,0 +1,62 @@ +performance { + authorizationHeader = "~MANUAL_ENTRY~" + rampUpSeconds = 60 + rampDownSeconds = 60 + durationSeconds = 360 + contentType = "application/json" + acceptType = "application/json" + rateMultiplier = 1 + instanceMultiplier = 1 + operationsPerSecond { + addPet = 1 + deletePet = 1 + findPetsByStatus = 1 + findPetsByTags = 1 + getPetById = 1 + updatePet = 1 + updatePetWithForm = 1 + uploadFile = 1 + deleteOrder = 1 + getInventory = 1 + getOrderById = 1 + placeOrder = 1 + createUser = 1 + createUsersWithArrayInput = 1 + createUsersWithListInput = 1 + deleteUser = 1 + getUserByName = 1 + loginUser = 1 + logoutUser = 1 + updateUser = 1 + } + global { + assertions { + responseTime { + min { + lte = 30000 + gte = 0 + } + max { + lte = 30000 + gte = 0 + } + mean { + lte = 30000 + gte = 0 + } + } + failedRequests { + percent { + lte = 5 + gte = 0 + } + } + successfulRequests { + percent { + lte = 100 + gte = 0 + } + } + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/conf/stress.conf b/samples/client/petstore/scala-gatling/src/gatling/resources/conf/stress.conf new file mode 100644 index 00000000000..1d75d0e40f9 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/conf/stress.conf @@ -0,0 +1,62 @@ +performance { + authorizationHeader = "~MANUAL_ENTRY~" + rampUpSeconds = 60 + rampDownSeconds = 60 + durationSeconds = 360 + contentType = "application/json" + acceptType = "application/json" + rateMultiplier = 1 + instanceMultiplier = 1 + operationsPerSecond { + addPet = 1 + deletePet = 1 + findPetsByStatus = 1 + findPetsByTags = 1 + getPetById = 1 + updatePet = 1 + updatePetWithForm = 1 + uploadFile = 1 + deleteOrder = 1 + getInventory = 1 + getOrderById = 1 + placeOrder = 1 + createUser = 1 + createUsersWithArrayInput = 1 + createUsersWithListInput = 1 + deleteUser = 1 + getUserByName = 1 + loginUser = 1 + logoutUser = 1 + updateUser = 1 + } + global { + assertions { + responseTime { + min { + lte = 30000 + gte = 0 + } + max { + lte = 30000 + gte = 0 + } + mean { + lte = 30000 + gte = 0 + } + } + failedRequests { + percent { + lte = 5 + gte = 0 + } + } + successfulRequests { + percent { + lte = 100 + gte = 0 + } + } + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/addPet-BodyParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/addPet-BodyParams.csv new file mode 100644 index 00000000000..9c23144ca97 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/addPet-BodyParams.csv @@ -0,0 +1 @@ +photoUrls,name,id,category,tags,status \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/createUser-BodyParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/createUser-BodyParams.csv new file mode 100644 index 00000000000..38dcc63f020 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/createUser-BodyParams.csv @@ -0,0 +1 @@ +firstName,lastName,password,userStatus,phone,id,email,username \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/deleteOrder-pathParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/deleteOrder-pathParams.csv new file mode 100644 index 00000000000..1b404007da9 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/deleteOrder-pathParams.csv @@ -0,0 +1 @@ +orderId \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/deletePet-headerParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/deletePet-headerParams.csv new file mode 100644 index 00000000000..afbd34a4d63 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/deletePet-headerParams.csv @@ -0,0 +1 @@ +api_key \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/deletePet-pathParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/deletePet-pathParams.csv new file mode 100644 index 00000000000..45e87671b9a --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/deletePet-pathParams.csv @@ -0,0 +1 @@ +petId \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/deleteUser-pathParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/deleteUser-pathParams.csv new file mode 100644 index 00000000000..22947b68d01 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/deleteUser-pathParams.csv @@ -0,0 +1 @@ +username \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/findPetsByStatus-queryParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/findPetsByStatus-queryParams.csv new file mode 100644 index 00000000000..962a7f7e76e --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/findPetsByStatus-queryParams.csv @@ -0,0 +1 @@ +status \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/findPetsByTags-queryParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/findPetsByTags-queryParams.csv new file mode 100644 index 00000000000..55cf73544d2 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/findPetsByTags-queryParams.csv @@ -0,0 +1 @@ +tags \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/getOrderById-pathParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/getOrderById-pathParams.csv new file mode 100644 index 00000000000..1b404007da9 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/getOrderById-pathParams.csv @@ -0,0 +1 @@ +orderId \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/getPetById-pathParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/getPetById-pathParams.csv new file mode 100644 index 00000000000..45e87671b9a --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/getPetById-pathParams.csv @@ -0,0 +1 @@ +petId \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/getUserByName-pathParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/getUserByName-pathParams.csv new file mode 100644 index 00000000000..22947b68d01 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/getUserByName-pathParams.csv @@ -0,0 +1 @@ +username \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/loginUser-queryParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/loginUser-queryParams.csv new file mode 100644 index 00000000000..d8bc9aec67d --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/loginUser-queryParams.csv @@ -0,0 +1 @@ +username,password \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/placeOrder-BodyParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/placeOrder-BodyParams.csv new file mode 100644 index 00000000000..a2fe128b281 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/placeOrder-BodyParams.csv @@ -0,0 +1 @@ +petId,quantity,id,shipDate,complete,status \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/updatePet-BodyParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/updatePet-BodyParams.csv new file mode 100644 index 00000000000..9c23144ca97 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/updatePet-BodyParams.csv @@ -0,0 +1 @@ +photoUrls,name,id,category,tags,status \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/updatePetWithForm-formParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/updatePetWithForm-formParams.csv new file mode 100644 index 00000000000..14cb48cc6be --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/updatePetWithForm-formParams.csv @@ -0,0 +1 @@ +name,status \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/updatePetWithForm-pathParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/updatePetWithForm-pathParams.csv new file mode 100644 index 00000000000..45e87671b9a --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/updatePetWithForm-pathParams.csv @@ -0,0 +1 @@ +petId \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/updateUser-BodyParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/updateUser-BodyParams.csv new file mode 100644 index 00000000000..38dcc63f020 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/updateUser-BodyParams.csv @@ -0,0 +1 @@ +firstName,lastName,password,userStatus,phone,id,email,username \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/updateUser-pathParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/updateUser-pathParams.csv new file mode 100644 index 00000000000..22947b68d01 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/updateUser-pathParams.csv @@ -0,0 +1 @@ +username \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/uploadFile-formParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/uploadFile-formParams.csv new file mode 100644 index 00000000000..50f9afc8d6c --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/uploadFile-formParams.csv @@ -0,0 +1 @@ +file,additionalMetadata \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/uploadFile-pathParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/uploadFile-pathParams.csv new file mode 100644 index 00000000000..45e87671b9a --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/uploadFile-pathParams.csv @@ -0,0 +1 @@ +petId \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/PetApiSimulation.scala b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/PetApiSimulation.scala new file mode 100644 index 00000000000..5e349cc2b6d --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/PetApiSimulation.scala @@ -0,0 +1,223 @@ +package io.swagger.client.api + +import io.swagger.client.model._ +import com.typesafe.config.ConfigFactory + +import io.gatling.core.Predef._ +import io.gatling.http.Predef._ +import io.gatling.core.structure.PopulationBuilder + +import java.io.File + +import scala.collection.mutable + +class PetApiSimulation extends Simulation { + + def getCurrentDirectory = new File("").getAbsolutePath + def userDataDirectory = getCurrentDirectory + "/src/gatling/resources/data" + + // basic test setup + val configName = System.getProperty("testConfig", "baseline") + val config = ConfigFactory.load(configName).withFallback(ConfigFactory.load("default")) + val durationSeconds = config.getInt("performance.durationSeconds") + val rampUpSeconds = config.getInt("performance.rampUpSeconds") + val rampDownSeconds = config.getInt("performance.rampDownSeconds") + val authentication = config.getString("performance.authorizationHeader") + val acceptHeader = config.getString("performance.acceptType") + val contentTypeHeader = config.getString("performance.contentType") + val rateMultiplier = config.getDouble("performance.rateMultiplier") + val instanceMultiplier = config.getDouble("performance.instanceMultiplier") + + // global assertion data + val globalResponseTimeMinLTE = config.getInt("performance.global.assertions.responseTime.min.lte") + val globalResponseTimeMinGTE = config.getInt("performance.global.assertions.responseTime.min.gte") + val globalResponseTimeMaxLTE = config.getInt("performance.global.assertions.responseTime.max.lte") + val globalResponseTimeMaxGTE = config.getInt("performance.global.assertions.responseTime.max.gte") + val globalResponseTimeMeanLTE = config.getInt("performance.global.assertions.responseTime.mean.lte") + val globalResponseTimeMeanGTE = config.getInt("performance.global.assertions.responseTime.mean.gte") + val globalResponseTimeFailedRequestsPercentLTE = config.getDouble("performance.global.assertions.failedRequests.percent.lte") + val globalResponseTimeFailedRequestsPercentGTE = config.getDouble("performance.global.assertions.failedRequests.percent.gte") + val globalResponseTimeSuccessfulRequestsPercentLTE = config.getDouble("performance.global.assertions.successfulRequests.percent.lte") + val globalResponseTimeSuccessfulRequestsPercentGTE = config.getDouble("performance.global.assertions.successfulRequests.percent.gte") + +// Setup http protocol configuration + val httpConf = http + .baseURL("http://petstore.swagger.io/v2") + .doNotTrackHeader("1") + .acceptLanguageHeader("en-US,en;q=0.5") + .acceptEncodingHeader("gzip, deflate") + .userAgentHeader("Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0") + .acceptHeader(acceptHeader) + .contentTypeHeader(contentTypeHeader) + + // set authorization header if it has been modified from config + if(!authentication.equals("~MANUAL_ENTRY")){ + httpConf.authorizationHeader(authentication) + } + + // Setup all the operations per second for the test to ultimately be generated from configs + val addPetPerSecond = config.getDouble("performance.operationsPerSecond.addPet") * rateMultiplier * instanceMultiplier + val deletePetPerSecond = config.getDouble("performance.operationsPerSecond.deletePet") * rateMultiplier * instanceMultiplier + val findPetsByStatusPerSecond = config.getDouble("performance.operationsPerSecond.findPetsByStatus") * rateMultiplier * instanceMultiplier + val findPetsByTagsPerSecond = config.getDouble("performance.operationsPerSecond.findPetsByTags") * rateMultiplier * instanceMultiplier + val getPetByIdPerSecond = config.getDouble("performance.operationsPerSecond.getPetById") * rateMultiplier * instanceMultiplier + val updatePetPerSecond = config.getDouble("performance.operationsPerSecond.updatePet") * rateMultiplier * instanceMultiplier + val updatePetWithFormPerSecond = config.getDouble("performance.operationsPerSecond.updatePetWithForm") * rateMultiplier * instanceMultiplier + val uploadFilePerSecond = config.getDouble("performance.operationsPerSecond.uploadFile") * rateMultiplier * instanceMultiplier + + val scenarioBuilders: mutable.MutableList[PopulationBuilder] = new mutable.MutableList[PopulationBuilder]() + + // Set up CSV feeders + val addPetBodyFeeder = csv(userDataDirectory + File.separator + "addPet-bodyParams.csv", escapeChar = '\\').random + val deletePetHEADERFeeder = csv(userDataDirectory + File.separator + "deletePet-headerParams.csv").random + val deletePetPATHFeeder = csv(userDataDirectory + File.separator + "deletePet-pathParams.csv").random + val findPetsByStatusQUERYFeeder = csv(userDataDirectory + File.separator + "findPetsByStatus-queryParams.csv").random + val findPetsByTagsQUERYFeeder = csv(userDataDirectory + File.separator + "findPetsByTags-queryParams.csv").random + val getPetByIdPATHFeeder = csv(userDataDirectory + File.separator + "getPetById-pathParams.csv").random + val updatePetBodyFeeder = csv(userDataDirectory + File.separator + "updatePet-bodyParams.csv", escapeChar = '\\').random + val updatePetWithFormFORMFeeder = csv(userDataDirectory + File.separator + "updatePetWithForm-formParams.csv").random + val updatePetWithFormPATHFeeder = csv(userDataDirectory + File.separator + "updatePetWithForm-pathParams.csv").random + val uploadFileFORMFeeder = csv(userDataDirectory + File.separator + "uploadFile-formParams.csv").random + val uploadFilePATHFeeder = csv(userDataDirectory + File.separator + "uploadFile-pathParams.csv").random + + // Setup all scenarios + + + val scnaddPet = scenario("addPetSimulation") + .feed(addPetBodyFeeder) + .exec(http("addPet") + .httpRequest("POST","/pet") + .body(StringBody(Pet.toStringBody("${id}","${category}","${name}","${tags}","${status}","${photoUrls}"))) + ) + + // Run scnaddPet with warm up and reach a constant rate for entire duration + scenarioBuilders += scnaddPet.inject( + rampUsersPerSec(1) to(addPetPerSecond) during(rampUpSeconds), + constantUsersPerSec(addPetPerSecond) during(durationSeconds), + rampUsersPerSec(addPetPerSecond) to(1) during(rampDownSeconds) + ) + + + val scndeletePet = scenario("deletePetSimulation") + .feed(deletePetHEADERFeeder) + .feed(deletePetPATHFeeder) + .exec(http("deletePet") + .httpRequest("DELETE","/pet/${petId}") + .header("api_key","${api_key}") +) + + // Run scndeletePet with warm up and reach a constant rate for entire duration + scenarioBuilders += scndeletePet.inject( + rampUsersPerSec(1) to(deletePetPerSecond) during(rampUpSeconds), + constantUsersPerSec(deletePetPerSecond) during(durationSeconds), + rampUsersPerSec(deletePetPerSecond) to(1) during(rampDownSeconds) + ) + + + val scnfindPetsByStatus = scenario("findPetsByStatusSimulation") + .feed(findPetsByStatusQUERYFeeder) + .exec(http("findPetsByStatus") + .httpRequest("GET","/pet/findByStatus") + .queryParam("status","${status}") +) + + // Run scnfindPetsByStatus with warm up and reach a constant rate for entire duration + scenarioBuilders += scnfindPetsByStatus.inject( + rampUsersPerSec(1) to(findPetsByStatusPerSecond) during(rampUpSeconds), + constantUsersPerSec(findPetsByStatusPerSecond) during(durationSeconds), + rampUsersPerSec(findPetsByStatusPerSecond) to(1) during(rampDownSeconds) + ) + + + val scnfindPetsByTags = scenario("findPetsByTagsSimulation") + .feed(findPetsByTagsQUERYFeeder) + .exec(http("findPetsByTags") + .httpRequest("GET","/pet/findByTags") + .queryParam("tags","${tags}") +) + + // Run scnfindPetsByTags with warm up and reach a constant rate for entire duration + scenarioBuilders += scnfindPetsByTags.inject( + rampUsersPerSec(1) to(findPetsByTagsPerSecond) during(rampUpSeconds), + constantUsersPerSec(findPetsByTagsPerSecond) during(durationSeconds), + rampUsersPerSec(findPetsByTagsPerSecond) to(1) during(rampDownSeconds) + ) + + + val scngetPetById = scenario("getPetByIdSimulation") + .feed(getPetByIdPATHFeeder) + .exec(http("getPetById") + .httpRequest("GET","/pet/${petId}") +) + + // Run scngetPetById with warm up and reach a constant rate for entire duration + scenarioBuilders += scngetPetById.inject( + rampUsersPerSec(1) to(getPetByIdPerSecond) during(rampUpSeconds), + constantUsersPerSec(getPetByIdPerSecond) during(durationSeconds), + rampUsersPerSec(getPetByIdPerSecond) to(1) during(rampDownSeconds) + ) + + + val scnupdatePet = scenario("updatePetSimulation") + .feed(updatePetBodyFeeder) + .exec(http("updatePet") + .httpRequest("PUT","/pet") + .body(StringBody(Pet.toStringBody("${id}","${category}","${name}","${tags}","${status}","${photoUrls}"))) + ) + + // Run scnupdatePet with warm up and reach a constant rate for entire duration + scenarioBuilders += scnupdatePet.inject( + rampUsersPerSec(1) to(updatePetPerSecond) during(rampUpSeconds), + constantUsersPerSec(updatePetPerSecond) during(durationSeconds), + rampUsersPerSec(updatePetPerSecond) to(1) during(rampDownSeconds) + ) + + + val scnupdatePetWithForm = scenario("updatePetWithFormSimulation") + .feed(updatePetWithFormFORMFeeder) + .feed(updatePetWithFormPATHFeeder) + .exec(http("updatePetWithForm") + .httpRequest("POST","/pet/${petId}") + .formParam("name","${name}") + .formParam("status","${status}") +) + + // Run scnupdatePetWithForm with warm up and reach a constant rate for entire duration + scenarioBuilders += scnupdatePetWithForm.inject( + rampUsersPerSec(1) to(updatePetWithFormPerSecond) during(rampUpSeconds), + constantUsersPerSec(updatePetWithFormPerSecond) during(durationSeconds), + rampUsersPerSec(updatePetWithFormPerSecond) to(1) during(rampDownSeconds) + ) + + + val scnuploadFile = scenario("uploadFileSimulation") + .feed(uploadFileFORMFeeder) + .feed(uploadFilePATHFeeder) + .exec(http("uploadFile") + .httpRequest("POST","/pet/${petId}/uploadImage") + .formParam("file","${file}") + .formParam("additionalMetadata","${additionalMetadata}") +) + + // Run scnuploadFile with warm up and reach a constant rate for entire duration + scenarioBuilders += scnuploadFile.inject( + rampUsersPerSec(1) to(uploadFilePerSecond) during(rampUpSeconds), + constantUsersPerSec(uploadFilePerSecond) during(durationSeconds), + rampUsersPerSec(uploadFilePerSecond) to(1) during(rampDownSeconds) + ) + + setUp( + scenarioBuilders.toList + ).protocols(httpConf).assertions( + global.responseTime.min.lte(globalResponseTimeMinLTE), + global.responseTime.min.gte(globalResponseTimeMinGTE), + global.responseTime.max.lte(globalResponseTimeMaxLTE), + global.responseTime.max.gte(globalResponseTimeMaxGTE), + global.responseTime.mean.lte(globalResponseTimeMeanLTE), + global.responseTime.mean.gte(globalResponseTimeMeanGTE), + global.failedRequests.percent.lte(globalResponseTimeFailedRequestsPercentLTE), + global.failedRequests.percent.gte(globalResponseTimeFailedRequestsPercentGTE), + global.successfulRequests.percent.lte(globalResponseTimeSuccessfulRequestsPercentLTE), + global.successfulRequests.percent.gte(globalResponseTimeSuccessfulRequestsPercentGTE) + ) +} diff --git a/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/StoreApiSimulation.scala b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/StoreApiSimulation.scala new file mode 100644 index 00000000000..3331dc06aa2 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/StoreApiSimulation.scala @@ -0,0 +1,143 @@ +package io.swagger.client.api + +import io.swagger.client.model._ +import com.typesafe.config.ConfigFactory + +import io.gatling.core.Predef._ +import io.gatling.http.Predef._ +import io.gatling.core.structure.PopulationBuilder + +import java.io.File + +import scala.collection.mutable + +class StoreApiSimulation extends Simulation { + + def getCurrentDirectory = new File("").getAbsolutePath + def userDataDirectory = getCurrentDirectory + "/src/gatling/resources/data" + + // basic test setup + val configName = System.getProperty("testConfig", "baseline") + val config = ConfigFactory.load(configName).withFallback(ConfigFactory.load("default")) + val durationSeconds = config.getInt("performance.durationSeconds") + val rampUpSeconds = config.getInt("performance.rampUpSeconds") + val rampDownSeconds = config.getInt("performance.rampDownSeconds") + val authentication = config.getString("performance.authorizationHeader") + val acceptHeader = config.getString("performance.acceptType") + val contentTypeHeader = config.getString("performance.contentType") + val rateMultiplier = config.getDouble("performance.rateMultiplier") + val instanceMultiplier = config.getDouble("performance.instanceMultiplier") + + // global assertion data + val globalResponseTimeMinLTE = config.getInt("performance.global.assertions.responseTime.min.lte") + val globalResponseTimeMinGTE = config.getInt("performance.global.assertions.responseTime.min.gte") + val globalResponseTimeMaxLTE = config.getInt("performance.global.assertions.responseTime.max.lte") + val globalResponseTimeMaxGTE = config.getInt("performance.global.assertions.responseTime.max.gte") + val globalResponseTimeMeanLTE = config.getInt("performance.global.assertions.responseTime.mean.lte") + val globalResponseTimeMeanGTE = config.getInt("performance.global.assertions.responseTime.mean.gte") + val globalResponseTimeFailedRequestsPercentLTE = config.getDouble("performance.global.assertions.failedRequests.percent.lte") + val globalResponseTimeFailedRequestsPercentGTE = config.getDouble("performance.global.assertions.failedRequests.percent.gte") + val globalResponseTimeSuccessfulRequestsPercentLTE = config.getDouble("performance.global.assertions.successfulRequests.percent.lte") + val globalResponseTimeSuccessfulRequestsPercentGTE = config.getDouble("performance.global.assertions.successfulRequests.percent.gte") + +// Setup http protocol configuration + val httpConf = http + .baseURL("http://petstore.swagger.io/v2") + .doNotTrackHeader("1") + .acceptLanguageHeader("en-US,en;q=0.5") + .acceptEncodingHeader("gzip, deflate") + .userAgentHeader("Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0") + .acceptHeader(acceptHeader) + .contentTypeHeader(contentTypeHeader) + + // set authorization header if it has been modified from config + if(!authentication.equals("~MANUAL_ENTRY")){ + httpConf.authorizationHeader(authentication) + } + + // Setup all the operations per second for the test to ultimately be generated from configs + val deleteOrderPerSecond = config.getDouble("performance.operationsPerSecond.deleteOrder") * rateMultiplier * instanceMultiplier + val getInventoryPerSecond = config.getDouble("performance.operationsPerSecond.getInventory") * rateMultiplier * instanceMultiplier + val getOrderByIdPerSecond = config.getDouble("performance.operationsPerSecond.getOrderById") * rateMultiplier * instanceMultiplier + val placeOrderPerSecond = config.getDouble("performance.operationsPerSecond.placeOrder") * rateMultiplier * instanceMultiplier + + val scenarioBuilders: mutable.MutableList[PopulationBuilder] = new mutable.MutableList[PopulationBuilder]() + + // Set up CSV feeders + val deleteOrderPATHFeeder = csv(userDataDirectory + File.separator + "deleteOrder-pathParams.csv").random + val getOrderByIdPATHFeeder = csv(userDataDirectory + File.separator + "getOrderById-pathParams.csv").random + val placeOrderBodyFeeder = csv(userDataDirectory + File.separator + "placeOrder-bodyParams.csv", escapeChar = '\\').random + + // Setup all scenarios + + + val scndeleteOrder = scenario("deleteOrderSimulation") + .feed(deleteOrderPATHFeeder) + .exec(http("deleteOrder") + .httpRequest("DELETE","/store/order/${orderId}") +) + + // Run scndeleteOrder with warm up and reach a constant rate for entire duration + scenarioBuilders += scndeleteOrder.inject( + rampUsersPerSec(1) to(deleteOrderPerSecond) during(rampUpSeconds), + constantUsersPerSec(deleteOrderPerSecond) during(durationSeconds), + rampUsersPerSec(deleteOrderPerSecond) to(1) during(rampDownSeconds) + ) + + + val scngetInventory = scenario("getInventorySimulation") + .exec(http("getInventory") + .httpRequest("GET","/store/inventory") +) + + // Run scngetInventory with warm up and reach a constant rate for entire duration + scenarioBuilders += scngetInventory.inject( + rampUsersPerSec(1) to(getInventoryPerSecond) during(rampUpSeconds), + constantUsersPerSec(getInventoryPerSecond) during(durationSeconds), + rampUsersPerSec(getInventoryPerSecond) to(1) during(rampDownSeconds) + ) + + + val scngetOrderById = scenario("getOrderByIdSimulation") + .feed(getOrderByIdPATHFeeder) + .exec(http("getOrderById") + .httpRequest("GET","/store/order/${orderId}") +) + + // Run scngetOrderById with warm up and reach a constant rate for entire duration + scenarioBuilders += scngetOrderById.inject( + rampUsersPerSec(1) to(getOrderByIdPerSecond) during(rampUpSeconds), + constantUsersPerSec(getOrderByIdPerSecond) during(durationSeconds), + rampUsersPerSec(getOrderByIdPerSecond) to(1) during(rampDownSeconds) + ) + + + val scnplaceOrder = scenario("placeOrderSimulation") + .feed(placeOrderBodyFeeder) + .exec(http("placeOrder") + .httpRequest("POST","/store/order") + .body(StringBody(Order.toStringBody("${id}","${shipDate}","${complete}","${quantity}","${status}","${petId}"))) + ) + + // Run scnplaceOrder with warm up and reach a constant rate for entire duration + scenarioBuilders += scnplaceOrder.inject( + rampUsersPerSec(1) to(placeOrderPerSecond) during(rampUpSeconds), + constantUsersPerSec(placeOrderPerSecond) during(durationSeconds), + rampUsersPerSec(placeOrderPerSecond) to(1) during(rampDownSeconds) + ) + + setUp( + scenarioBuilders.toList + ).protocols(httpConf).assertions( + global.responseTime.min.lte(globalResponseTimeMinLTE), + global.responseTime.min.gte(globalResponseTimeMinGTE), + global.responseTime.max.lte(globalResponseTimeMaxLTE), + global.responseTime.max.gte(globalResponseTimeMaxGTE), + global.responseTime.mean.lte(globalResponseTimeMeanLTE), + global.responseTime.mean.gte(globalResponseTimeMeanGTE), + global.failedRequests.percent.lte(globalResponseTimeFailedRequestsPercentLTE), + global.failedRequests.percent.gte(globalResponseTimeFailedRequestsPercentGTE), + global.successfulRequests.percent.lte(globalResponseTimeSuccessfulRequestsPercentLTE), + global.successfulRequests.percent.gte(globalResponseTimeSuccessfulRequestsPercentGTE) + ) +} diff --git a/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/UserApiSimulation.scala b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/UserApiSimulation.scala new file mode 100644 index 00000000000..b065e226dff --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/UserApiSimulation.scala @@ -0,0 +1,210 @@ +package io.swagger.client.api + +import io.swagger.client.model._ +import com.typesafe.config.ConfigFactory + +import io.gatling.core.Predef._ +import io.gatling.http.Predef._ +import io.gatling.core.structure.PopulationBuilder + +import java.io.File + +import scala.collection.mutable + +class UserApiSimulation extends Simulation { + + def getCurrentDirectory = new File("").getAbsolutePath + def userDataDirectory = getCurrentDirectory + "/src/gatling/resources/data" + + // basic test setup + val configName = System.getProperty("testConfig", "baseline") + val config = ConfigFactory.load(configName).withFallback(ConfigFactory.load("default")) + val durationSeconds = config.getInt("performance.durationSeconds") + val rampUpSeconds = config.getInt("performance.rampUpSeconds") + val rampDownSeconds = config.getInt("performance.rampDownSeconds") + val authentication = config.getString("performance.authorizationHeader") + val acceptHeader = config.getString("performance.acceptType") + val contentTypeHeader = config.getString("performance.contentType") + val rateMultiplier = config.getDouble("performance.rateMultiplier") + val instanceMultiplier = config.getDouble("performance.instanceMultiplier") + + // global assertion data + val globalResponseTimeMinLTE = config.getInt("performance.global.assertions.responseTime.min.lte") + val globalResponseTimeMinGTE = config.getInt("performance.global.assertions.responseTime.min.gte") + val globalResponseTimeMaxLTE = config.getInt("performance.global.assertions.responseTime.max.lte") + val globalResponseTimeMaxGTE = config.getInt("performance.global.assertions.responseTime.max.gte") + val globalResponseTimeMeanLTE = config.getInt("performance.global.assertions.responseTime.mean.lte") + val globalResponseTimeMeanGTE = config.getInt("performance.global.assertions.responseTime.mean.gte") + val globalResponseTimeFailedRequestsPercentLTE = config.getDouble("performance.global.assertions.failedRequests.percent.lte") + val globalResponseTimeFailedRequestsPercentGTE = config.getDouble("performance.global.assertions.failedRequests.percent.gte") + val globalResponseTimeSuccessfulRequestsPercentLTE = config.getDouble("performance.global.assertions.successfulRequests.percent.lte") + val globalResponseTimeSuccessfulRequestsPercentGTE = config.getDouble("performance.global.assertions.successfulRequests.percent.gte") + +// Setup http protocol configuration + val httpConf = http + .baseURL("http://petstore.swagger.io/v2") + .doNotTrackHeader("1") + .acceptLanguageHeader("en-US,en;q=0.5") + .acceptEncodingHeader("gzip, deflate") + .userAgentHeader("Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0") + .acceptHeader(acceptHeader) + .contentTypeHeader(contentTypeHeader) + + // set authorization header if it has been modified from config + if(!authentication.equals("~MANUAL_ENTRY")){ + httpConf.authorizationHeader(authentication) + } + + // Setup all the operations per second for the test to ultimately be generated from configs + val createUserPerSecond = config.getDouble("performance.operationsPerSecond.createUser") * rateMultiplier * instanceMultiplier + val createUsersWithArrayInputPerSecond = config.getDouble("performance.operationsPerSecond.createUsersWithArrayInput") * rateMultiplier * instanceMultiplier + val createUsersWithListInputPerSecond = config.getDouble("performance.operationsPerSecond.createUsersWithListInput") * rateMultiplier * instanceMultiplier + val deleteUserPerSecond = config.getDouble("performance.operationsPerSecond.deleteUser") * rateMultiplier * instanceMultiplier + val getUserByNamePerSecond = config.getDouble("performance.operationsPerSecond.getUserByName") * rateMultiplier * instanceMultiplier + val loginUserPerSecond = config.getDouble("performance.operationsPerSecond.loginUser") * rateMultiplier * instanceMultiplier + val logoutUserPerSecond = config.getDouble("performance.operationsPerSecond.logoutUser") * rateMultiplier * instanceMultiplier + val updateUserPerSecond = config.getDouble("performance.operationsPerSecond.updateUser") * rateMultiplier * instanceMultiplier + + val scenarioBuilders: mutable.MutableList[PopulationBuilder] = new mutable.MutableList[PopulationBuilder]() + + // Set up CSV feeders + val createUserBodyFeeder = csv(userDataDirectory + File.separator + "createUser-bodyParams.csv", escapeChar = '\\').random + val deleteUserPATHFeeder = csv(userDataDirectory + File.separator + "deleteUser-pathParams.csv").random + val getUserByNamePATHFeeder = csv(userDataDirectory + File.separator + "getUserByName-pathParams.csv").random + val loginUserQUERYFeeder = csv(userDataDirectory + File.separator + "loginUser-queryParams.csv").random + val updateUserPATHFeeder = csv(userDataDirectory + File.separator + "updateUser-pathParams.csv").random + val updateUserBodyFeeder = csv(userDataDirectory + File.separator + "updateUser-bodyParams.csv", escapeChar = '\\').random + + // Setup all scenarios + + + val scncreateUser = scenario("createUserSimulation") + .feed(createUserBodyFeeder) + .exec(http("createUser") + .httpRequest("POST","/user") + .body(StringBody(User.toStringBody("${password}","${id}","${lastName}","${firstName}","${email}","${userStatus}","${phone}","${username}"))) + ) + + // Run scncreateUser with warm up and reach a constant rate for entire duration + scenarioBuilders += scncreateUser.inject( + rampUsersPerSec(1) to(createUserPerSecond) during(rampUpSeconds), + constantUsersPerSec(createUserPerSecond) during(durationSeconds), + rampUsersPerSec(createUserPerSecond) to(1) during(rampDownSeconds) + ) + + + val scncreateUsersWithArrayInput = scenario("createUsersWithArrayInputSimulation") + .exec(http("createUsersWithArrayInput") + .httpRequest("POST","/user/createWithArray") + .body(StringBody(StringBody("[]"))) + ) + + // Run scncreateUsersWithArrayInput with warm up and reach a constant rate for entire duration + scenarioBuilders += scncreateUsersWithArrayInput.inject( + rampUsersPerSec(1) to(createUsersWithArrayInputPerSecond) during(rampUpSeconds), + constantUsersPerSec(createUsersWithArrayInputPerSecond) during(durationSeconds), + rampUsersPerSec(createUsersWithArrayInputPerSecond) to(1) during(rampDownSeconds) + ) + + + val scncreateUsersWithListInput = scenario("createUsersWithListInputSimulation") + .exec(http("createUsersWithListInput") + .httpRequest("POST","/user/createWithList") + .body(StringBody(StringBody("[]"))) + ) + + // Run scncreateUsersWithListInput with warm up and reach a constant rate for entire duration + scenarioBuilders += scncreateUsersWithListInput.inject( + rampUsersPerSec(1) to(createUsersWithListInputPerSecond) during(rampUpSeconds), + constantUsersPerSec(createUsersWithListInputPerSecond) during(durationSeconds), + rampUsersPerSec(createUsersWithListInputPerSecond) to(1) during(rampDownSeconds) + ) + + + val scndeleteUser = scenario("deleteUserSimulation") + .feed(deleteUserPATHFeeder) + .exec(http("deleteUser") + .httpRequest("DELETE","/user/${username}") +) + + // Run scndeleteUser with warm up and reach a constant rate for entire duration + scenarioBuilders += scndeleteUser.inject( + rampUsersPerSec(1) to(deleteUserPerSecond) during(rampUpSeconds), + constantUsersPerSec(deleteUserPerSecond) during(durationSeconds), + rampUsersPerSec(deleteUserPerSecond) to(1) during(rampDownSeconds) + ) + + + val scngetUserByName = scenario("getUserByNameSimulation") + .feed(getUserByNamePATHFeeder) + .exec(http("getUserByName") + .httpRequest("GET","/user/${username}") +) + + // Run scngetUserByName with warm up and reach a constant rate for entire duration + scenarioBuilders += scngetUserByName.inject( + rampUsersPerSec(1) to(getUserByNamePerSecond) during(rampUpSeconds), + constantUsersPerSec(getUserByNamePerSecond) during(durationSeconds), + rampUsersPerSec(getUserByNamePerSecond) to(1) during(rampDownSeconds) + ) + + + val scnloginUser = scenario("loginUserSimulation") + .feed(loginUserQUERYFeeder) + .exec(http("loginUser") + .httpRequest("GET","/user/login") + .queryParam("username","${username}") + .queryParam("password","${password}") +) + + // Run scnloginUser with warm up and reach a constant rate for entire duration + scenarioBuilders += scnloginUser.inject( + rampUsersPerSec(1) to(loginUserPerSecond) during(rampUpSeconds), + constantUsersPerSec(loginUserPerSecond) during(durationSeconds), + rampUsersPerSec(loginUserPerSecond) to(1) during(rampDownSeconds) + ) + + + val scnlogoutUser = scenario("logoutUserSimulation") + .exec(http("logoutUser") + .httpRequest("GET","/user/logout") +) + + // Run scnlogoutUser with warm up and reach a constant rate for entire duration + scenarioBuilders += scnlogoutUser.inject( + rampUsersPerSec(1) to(logoutUserPerSecond) during(rampUpSeconds), + constantUsersPerSec(logoutUserPerSecond) during(durationSeconds), + rampUsersPerSec(logoutUserPerSecond) to(1) during(rampDownSeconds) + ) + + + val scnupdateUser = scenario("updateUserSimulation") + .feed(updateUserBodyFeeder) + .feed(updateUserPATHFeeder) + .exec(http("updateUser") + .httpRequest("PUT","/user/${username}") + .body(StringBody(User.toStringBody("${password}","${id}","${lastName}","${firstName}","${email}","${userStatus}","${phone}","${username}"))) + ) + + // Run scnupdateUser with warm up and reach a constant rate for entire duration + scenarioBuilders += scnupdateUser.inject( + rampUsersPerSec(1) to(updateUserPerSecond) during(rampUpSeconds), + constantUsersPerSec(updateUserPerSecond) during(durationSeconds), + rampUsersPerSec(updateUserPerSecond) to(1) during(rampDownSeconds) + ) + + setUp( + scenarioBuilders.toList + ).protocols(httpConf).assertions( + global.responseTime.min.lte(globalResponseTimeMinLTE), + global.responseTime.min.gte(globalResponseTimeMinGTE), + global.responseTime.max.lte(globalResponseTimeMaxLTE), + global.responseTime.max.gte(globalResponseTimeMaxGTE), + global.responseTime.mean.lte(globalResponseTimeMeanLTE), + global.responseTime.mean.gte(globalResponseTimeMeanGTE), + global.failedRequests.percent.lte(globalResponseTimeFailedRequestsPercentLTE), + global.failedRequests.percent.gte(globalResponseTimeFailedRequestsPercentGTE), + global.successfulRequests.percent.lte(globalResponseTimeSuccessfulRequestsPercentLTE), + global.successfulRequests.percent.gte(globalResponseTimeSuccessfulRequestsPercentGTE) + ) +} diff --git a/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/ApiResponse.scala b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/ApiResponse.scala new file mode 100644 index 00000000000..33a26c338b4 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/ApiResponse.scala @@ -0,0 +1,17 @@ + +package io.swagger.client.model + + +case class ApiResponse ( + _code: Option[Integer], + _type: Option[String], + _message: Option[String] +) +object ApiResponse { + def toStringBody(var_code: Object, var_type: Object, var_message: Object) = + s""" + | { + | "code":$var_code,"type":$var_type,"message":$var_message + | } + """.stripMargin +} diff --git a/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/Category.scala b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/Category.scala new file mode 100644 index 00000000000..e8f0eda76cc --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/Category.scala @@ -0,0 +1,16 @@ + +package io.swagger.client.model + + +case class Category ( + _id: Option[Long], + _name: Option[String] +) +object Category { + def toStringBody(var_id: Object, var_name: Object) = + s""" + | { + | "id":$var_id,"name":$var_name + | } + """.stripMargin +} diff --git a/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/Order.scala b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/Order.scala new file mode 100644 index 00000000000..757b8c06810 --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/Order.scala @@ -0,0 +1,22 @@ + +package io.swagger.client.model + +import java.util.Date + +case class Order ( + _id: Option[Long], + _petId: Option[Long], + _quantity: Option[Integer], + _shipDate: Option[Date], + /* Order Status */ + _status: Option[String], + _complete: Option[Boolean] +) +object Order { + def toStringBody(var_id: Object, var_petId: Object, var_quantity: Object, var_shipDate: Object, var_status: Object, var_complete: Object) = + s""" + | { + | "id":$var_id,"petId":$var_petId,"quantity":$var_quantity,"shipDate":$var_shipDate,"status":$var_status,"complete":$var_complete + | } + """.stripMargin +} diff --git a/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/Pet.scala b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/Pet.scala new file mode 100644 index 00000000000..eae41bc8a2f --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/Pet.scala @@ -0,0 +1,21 @@ + +package io.swagger.client.model + + +case class Pet ( + _id: Option[Long], + _category: Option[Category], + _name: String, + _photoUrls: List[String], + _tags: Option[List[Tag]], + /* pet status in the store */ + _status: Option[String] +) +object Pet { + def toStringBody(var_id: Object, var_category: Object, var_name: Object, var_photoUrls: Object, var_tags: Object, var_status: Object) = + s""" + | { + | "id":$var_id,"category":$var_category,"name":$var_name,"photoUrls":$var_photoUrls,"tags":$var_tags,"status":$var_status + | } + """.stripMargin +} diff --git a/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/Tag.scala b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/Tag.scala new file mode 100644 index 00000000000..4662d850fdd --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/Tag.scala @@ -0,0 +1,16 @@ + +package io.swagger.client.model + + +case class Tag ( + _id: Option[Long], + _name: Option[String] +) +object Tag { + def toStringBody(var_id: Object, var_name: Object) = + s""" + | { + | "id":$var_id,"name":$var_name + | } + """.stripMargin +} diff --git a/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/User.scala b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/User.scala new file mode 100644 index 00000000000..3db708ad9ca --- /dev/null +++ b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/model/User.scala @@ -0,0 +1,23 @@ + +package io.swagger.client.model + + +case class User ( + _id: Option[Long], + _username: Option[String], + _firstName: Option[String], + _lastName: Option[String], + _email: Option[String], + _password: Option[String], + _phone: Option[String], + /* User Status */ + _userStatus: Option[Integer] +) +object User { + def toStringBody(var_id: Object, var_username: Object, var_firstName: Object, var_lastName: Object, var_email: Object, var_password: Object, var_phone: Object, var_userStatus: Object) = + s""" + | { + | "id":$var_id,"username":$var_username,"firstName":$var_firstName,"lastName":$var_lastName,"email":$var_email,"password":$var_password,"phone":$var_phone,"userStatus":$var_userStatus + | } + """.stripMargin +} From 0469975632bfad1cdb7a28357f2eadff14e1956b Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 7 Jan 2018 17:38:55 +0800 Subject: [PATCH 19/65] minor enhancement to scala gatling --- bin/scala-gatling-petstore.sh | 2 +- bin/windows/scala-gatling-petstore.sh | 10 ++++++++++ .../swagger/codegen/languages/ScalaGatlingCodegen.java | 6 +++--- .../META-INF/services/io.swagger.codegen.CodegenConfig | 2 +- .../{ScalaGatling => scala-gatling}/api.mustache | 0 .../{ScalaGatling => scala-gatling}/build.gradle | 0 .../default.conf.mustache | 0 .../{ScalaGatling => scala-gatling}/gatling.conf | 0 .../licenseInfo.mustache | 0 .../{ScalaGatling => scala-gatling}/logback.xml | 0 .../{ScalaGatling => scala-gatling}/model.mustache | 0 .../petstore/scala-gatling/.swagger-codegen/VERSION | 2 +- 12 files changed, 16 insertions(+), 6 deletions(-) create mode 100755 bin/windows/scala-gatling-petstore.sh rename modules/swagger-codegen/src/main/resources/{ScalaGatling => scala-gatling}/api.mustache (100%) rename modules/swagger-codegen/src/main/resources/{ScalaGatling => scala-gatling}/build.gradle (100%) rename modules/swagger-codegen/src/main/resources/{ScalaGatling => scala-gatling}/default.conf.mustache (100%) rename modules/swagger-codegen/src/main/resources/{ScalaGatling => scala-gatling}/gatling.conf (100%) rename modules/swagger-codegen/src/main/resources/{ScalaGatling => scala-gatling}/licenseInfo.mustache (100%) rename modules/swagger-codegen/src/main/resources/{ScalaGatling => scala-gatling}/logback.xml (100%) rename modules/swagger-codegen/src/main/resources/{ScalaGatling => scala-gatling}/model.mustache (100%) diff --git a/bin/scala-gatling-petstore.sh b/bin/scala-gatling-petstore.sh index 87495a5213f..7a670bc4239 100755 --- a/bin/scala-gatling-petstore.sh +++ b/bin/scala-gatling-petstore.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/ScalaGatling -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l scala-gatling -o samples/client/petstore/scala-gatling" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/scala-gatling -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l scala-gatling -o samples/client/petstore/scala-gatling" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/scala-gatling-petstore.sh b/bin/windows/scala-gatling-petstore.sh new file mode 100755 index 00000000000..793abd80e10 --- /dev/null +++ b/bin/windows/scala-gatling-petstore.sh @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -t modules\swagger-codegen\src\main\resources\scala-gatling -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l scala-gatling -o samples\client\petstore\scala-gatling + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaGatlingCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaGatlingCodegen.java index 6c578875f89..2e163ba305b 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaGatlingCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaGatlingCodegen.java @@ -47,7 +47,7 @@ public String getName() { * @return A string value for the help message */ public String getHelp() { - return "Generates a gatling simulation library."; + return "Generates a gatling simulation library (beta)."; } public ScalaGatlingCodegen() { @@ -71,7 +71,7 @@ public ScalaGatlingCodegen() { * Template Location. This is the location which templates will be read from. The generator * will use the resource stream to attempt to read the templates. */ - templateDir = "ScalaGatling"; + templateDir = "scala-gatling"; /** * Api Package. Optional, if needed, this can be used in templates @@ -342,4 +342,4 @@ public String getSwaggerType(Property p) { type = swaggerType; return toModelName(type); } -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig b/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig index b787a7b6a3a..80ec28e7b0c 100644 --- a/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig +++ b/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig @@ -19,7 +19,6 @@ io.swagger.codegen.languages.ErlangServerCodegen io.swagger.codegen.languages.FinchServerCodegen io.swagger.codegen.languages.FlashClientCodegen io.swagger.codegen.languages.FlaskConnexionCodegen -io.swagger.codegen.languages.ScalaGatlingCodegen io.swagger.codegen.languages.GoClientCodegen io.swagger.codegen.languages.GoServerCodegen io.swagger.codegen.languages.GroovyClientCodegen @@ -61,6 +60,7 @@ io.swagger.codegen.languages.RubyClientCodegen io.swagger.codegen.languages.RustClientCodegen io.swagger.codegen.languages.RustServerCodegen io.swagger.codegen.languages.ScalaClientCodegen +io.swagger.codegen.languages.ScalaGatlingCodegen io.swagger.codegen.languages.ScalaLagomServerCodegen io.swagger.codegen.languages.ScalatraServerCodegen io.swagger.codegen.languages.ScalazClientCodegen diff --git a/modules/swagger-codegen/src/main/resources/ScalaGatling/api.mustache b/modules/swagger-codegen/src/main/resources/scala-gatling/api.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/ScalaGatling/api.mustache rename to modules/swagger-codegen/src/main/resources/scala-gatling/api.mustache diff --git a/modules/swagger-codegen/src/main/resources/ScalaGatling/build.gradle b/modules/swagger-codegen/src/main/resources/scala-gatling/build.gradle similarity index 100% rename from modules/swagger-codegen/src/main/resources/ScalaGatling/build.gradle rename to modules/swagger-codegen/src/main/resources/scala-gatling/build.gradle diff --git a/modules/swagger-codegen/src/main/resources/ScalaGatling/default.conf.mustache b/modules/swagger-codegen/src/main/resources/scala-gatling/default.conf.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/ScalaGatling/default.conf.mustache rename to modules/swagger-codegen/src/main/resources/scala-gatling/default.conf.mustache diff --git a/modules/swagger-codegen/src/main/resources/ScalaGatling/gatling.conf b/modules/swagger-codegen/src/main/resources/scala-gatling/gatling.conf similarity index 100% rename from modules/swagger-codegen/src/main/resources/ScalaGatling/gatling.conf rename to modules/swagger-codegen/src/main/resources/scala-gatling/gatling.conf diff --git a/modules/swagger-codegen/src/main/resources/ScalaGatling/licenseInfo.mustache b/modules/swagger-codegen/src/main/resources/scala-gatling/licenseInfo.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/ScalaGatling/licenseInfo.mustache rename to modules/swagger-codegen/src/main/resources/scala-gatling/licenseInfo.mustache diff --git a/modules/swagger-codegen/src/main/resources/ScalaGatling/logback.xml b/modules/swagger-codegen/src/main/resources/scala-gatling/logback.xml similarity index 100% rename from modules/swagger-codegen/src/main/resources/ScalaGatling/logback.xml rename to modules/swagger-codegen/src/main/resources/scala-gatling/logback.xml diff --git a/modules/swagger-codegen/src/main/resources/ScalaGatling/model.mustache b/modules/swagger-codegen/src/main/resources/scala-gatling/model.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/ScalaGatling/model.mustache rename to modules/swagger-codegen/src/main/resources/scala-gatling/model.mustache diff --git a/samples/client/petstore/scala-gatling/.swagger-codegen/VERSION b/samples/client/petstore/scala-gatling/.swagger-codegen/VERSION index f9f7450d135..855ff9501eb 100644 --- a/samples/client/petstore/scala-gatling/.swagger-codegen/VERSION +++ b/samples/client/petstore/scala-gatling/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.4.0-SNAPSHOT \ No newline at end of file From c7ff3037791168eabd892c7ae9b194da7175bb06 Mon Sep 17 00:00:00 2001 From: etherealjoy <33183834+etherealjoy@users.noreply.github.com> Date: Sun, 7 Jan 2018 10:50:44 +0100 Subject: [PATCH 20/65] [qt5cpp] Disable creation of empty json fields and handle prefix in model generation (#7206) * Disable creation of empty json fields and fields for primitives which were not set, but using default values modelnamePrefix will be the one passed from command line or SWG if none * Updates after review Also common http files are splitted Update Petstore examples --- .../codegen/languages/Qt5CPPGenerator.java | 18 +- .../resources/qt5cpp/HttpRequest.cpp.mustache | 32 +-- .../resources/qt5cpp/HttpRequest.h.mustache | 32 +-- .../main/resources/qt5cpp/api-body.mustache | 19 +- .../main/resources/qt5cpp/api-header.mustache | 8 +- .../resources/qt5cpp/helpers-body.mustache | 36 +-- .../resources/qt5cpp/helpers-header.mustache | 6 +- .../main/resources/qt5cpp/model-body.mustache | 80 +++++-- .../resources/qt5cpp/model-header.mustache | 8 +- .../resources/qt5cpp/modelFactory.mustache | 2 +- .../src/main/resources/qt5cpp/object.mustache | 11 +- .../petstore/qt5cpp/PetStore/PetApiTests.cpp | 28 +-- .../petstore/qt5cpp/PetStore/PetApiTests.h | 2 +- .../petstore/qt5cpp/client/SWGApiResponse.cpp | 28 ++- .../petstore/qt5cpp/client/SWGApiResponse.h | 8 + .../petstore/qt5cpp/client/SWGCategory.cpp | 21 +- .../petstore/qt5cpp/client/SWGCategory.h | 6 + .../petstore/qt5cpp/client/SWGHelpers.cpp | 206 +++++++++++++----- .../petstore/qt5cpp/client/SWGHelpers.h | 6 +- .../petstore/qt5cpp/client/SWGHttpRequest.cpp | 26 +-- .../petstore/qt5cpp/client/SWGHttpRequest.h | 28 +-- .../client/petstore/qt5cpp/client/SWGObject.h | 7 +- .../petstore/qt5cpp/client/SWGOrder.cpp | 46 +++- .../client/petstore/qt5cpp/client/SWGOrder.h | 14 ++ .../client/petstore/qt5cpp/client/SWGPet.cpp | 57 ++++- .../client/petstore/qt5cpp/client/SWGPet.h | 14 ++ .../petstore/qt5cpp/client/SWGPetApi.cpp | 74 ++++--- .../client/petstore/qt5cpp/client/SWGPetApi.h | 32 +-- .../petstore/qt5cpp/client/SWGStoreApi.cpp | 39 ++-- .../petstore/qt5cpp/client/SWGStoreApi.h | 16 +- .../client/petstore/qt5cpp/client/SWGTag.cpp | 21 +- .../client/petstore/qt5cpp/client/SWGTag.h | 6 + .../client/petstore/qt5cpp/client/SWGUser.cpp | 63 +++++- .../client/petstore/qt5cpp/client/SWGUser.h | 18 ++ .../petstore/qt5cpp/client/SWGUserApi.cpp | 74 ++++--- .../petstore/qt5cpp/client/SWGUserApi.h | 32 +-- 36 files changed, 771 insertions(+), 353 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Qt5CPPGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Qt5CPPGenerator.java index 774184ef26c..8cdd89b603f 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Qt5CPPGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Qt5CPPGenerator.java @@ -169,6 +169,20 @@ public void processOpts() { } additionalProperties.put("cppNamespaceDeclarations", cppNamespace.split("\\::")); + if(additionalProperties.containsKey("modelNamePrefix")){ + supportingFiles.clear(); + supportingFiles.add(new SupportingFile("helpers-header.mustache", sourceFolder, modelNamePrefix + "Helpers.h")); + supportingFiles.add(new SupportingFile("helpers-body.mustache", sourceFolder, modelNamePrefix + "Helpers.cpp")); + supportingFiles.add(new SupportingFile("HttpRequest.h.mustache", sourceFolder, modelNamePrefix + "HttpRequest.h")); + supportingFiles.add(new SupportingFile("HttpRequest.cpp.mustache", sourceFolder, modelNamePrefix + "HttpRequest.cpp")); + supportingFiles.add(new SupportingFile("modelFactory.mustache", sourceFolder, modelNamePrefix + "ModelFactory.h")); + supportingFiles.add(new SupportingFile("object.mustache", sourceFolder, modelNamePrefix + "Object.h")); + + typeMapping.put("object", modelNamePrefix + "Object"); + typeMapping.put("file", modelNamePrefix + "HttpRequestInputFileElement"); + importMapping.put("SWGHttpRequestInputFileElement", "#include \"" + modelNamePrefix + "HttpRequest.h\""); + additionalProperties().put("prefix", modelNamePrefix); + } } /** @@ -258,7 +272,7 @@ public String toModelFilename(String name) { @Override public String toApiFilename(String name) { - return PREFIX + initialCaps(name) + "Api"; + return modelNamePrefix + initialCaps(name) + "Api"; } /** @@ -398,7 +412,7 @@ public String toParamName(String name) { @Override public String toApiName(String type) { - return PREFIX + Character.toUpperCase(type.charAt(0)) + type.substring(1) + "Api"; + return modelNamePrefix + Character.toUpperCase(type.charAt(0)) + type.substring(1) + "Api"; } @Override diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/HttpRequest.cpp.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/HttpRequest.cpp.mustache index 8f042bcf0c8..cf3a82bece5 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/HttpRequest.cpp.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/HttpRequest.cpp.mustache @@ -1,5 +1,5 @@ {{>licenseInfo}} -#include "SWGHttpRequest.h" +#include "{{prefix}}HttpRequest.h" #include #include #include @@ -11,28 +11,28 @@ namespace {{this}} { {{/cppNamespaceDeclarations}} -HttpRequestInput::HttpRequestInput() { +{{prefix}}HttpRequestInput::{{prefix}}HttpRequestInput() { initialize(); } -HttpRequestInput::HttpRequestInput(QString v_url_str, QString v_http_method) { +{{prefix}}HttpRequestInput::{{prefix}}HttpRequestInput(QString v_url_str, QString v_http_method) { initialize(); url_str = v_url_str; http_method = v_http_method; } -void HttpRequestInput::initialize() { +void {{prefix}}HttpRequestInput::initialize() { var_layout = NOT_SET; url_str = ""; http_method = "GET"; } -void HttpRequestInput::add_var(QString key, QString value) { +void {{prefix}}HttpRequestInput::add_var(QString key, QString value) { vars[key] = value; } -void HttpRequestInput::add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type) { - SWGHttpRequestInputFileElement file; +void {{prefix}}HttpRequestInput::add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type) { + {{prefix}}HttpRequestInputFileElement file; file.variable_name = variable_name; file.local_filename = local_filename; file.request_filename = request_filename; @@ -41,7 +41,7 @@ void HttpRequestInput::add_file(QString variable_name, QString local_filename, Q } -HttpRequestWorker::HttpRequestWorker(QObject *parent) +{{prefix}}HttpRequestWorker::{{prefix}}HttpRequestWorker(QObject *parent) : QObject(parent), manager(nullptr) { qsrand(QDateTime::currentDateTime().toTime_t()); @@ -50,10 +50,10 @@ HttpRequestWorker::HttpRequestWorker(QObject *parent) connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(on_manager_finished(QNetworkReply*))); } -HttpRequestWorker::~HttpRequestWorker() { +{{prefix}}HttpRequestWorker::~{{prefix}}HttpRequestWorker() { } -QString HttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) { +QString {{prefix}}HttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) { // result structure follows RFC 5987 bool need_utf_encoding = false; QString result = ""; @@ -101,7 +101,7 @@ QString HttpRequestWorker::http_attribute_encode(QString attribute_name, QString return QString("%1=\"%2\"; %1*=utf-8''%3").arg(attribute_name, result, result_utf8); } -void HttpRequestWorker::execute(HttpRequestInput *input) { +void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) { // reset variables @@ -181,7 +181,7 @@ void HttpRequestWorker::execute(HttpRequestInput *input) { } // add files - for (QList::iterator file_info = input->files.begin(); file_info != input->files.end(); file_info++) { + for (QList<{{prefix}}HttpRequestInputFileElement>::iterator file_info = input->files.begin(); file_info != input->files.end(); file_info++) { QFileInfo fi(file_info->local_filename); // ensure necessary variables are available @@ -253,8 +253,8 @@ void HttpRequestWorker::execute(HttpRequestInput *input) { // prepare connection QNetworkRequest request = QNetworkRequest(QUrl(input->url_str)); - if (HttpRequestWorker::sslDefaultConfiguration != nullptr) { - request.setSslConfiguration(*HttpRequestWorker::sslDefaultConfiguration); + if ({{prefix}}HttpRequestWorker::sslDefaultConfiguration != nullptr) { + request.setSslConfiguration(*{{prefix}}HttpRequestWorker::sslDefaultConfiguration); } request.setRawHeader("User-Agent", "Swagger-Client"); foreach(QString key, input->headers.keys()) { @@ -301,7 +301,7 @@ void HttpRequestWorker::execute(HttpRequestInput *input) { } -void HttpRequestWorker::on_manager_finished(QNetworkReply *reply) { +void {{prefix}}HttpRequestWorker::on_manager_finished(QNetworkReply *reply) { error_type = reply->error(); response = reply->readAll(); error_str = reply->errorString(); @@ -310,7 +310,7 @@ void HttpRequestWorker::on_manager_finished(QNetworkReply *reply) { emit on_execution_finished(this); } -QSslConfiguration* HttpRequestWorker::sslDefaultConfiguration; +QSslConfiguration* {{prefix}}HttpRequestWorker::sslDefaultConfiguration; {{#cppNamespaceDeclarations}} diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/HttpRequest.h.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/HttpRequest.h.mustache index 4351b48a43c..e89aeb0e386 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/HttpRequest.h.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/HttpRequest.h.mustache @@ -5,8 +5,8 @@ * **/ -#ifndef HTTPREQUESTWORKER_H -#define HTTPREQUESTWORKER_H +#ifndef {{prefix}}_HTTPREQUESTWORKER_H +#define {{prefix}}_HTTPREQUESTWORKER_H #include #include @@ -14,13 +14,15 @@ #include #include -enum HttpRequestVarLayout {NOT_SET, ADDRESS, URL_ENCODED, MULTIPART}; + {{#cppNamespaceDeclarations}} namespace {{this}} { {{/cppNamespaceDeclarations}} -class SWGHttpRequestInputFileElement { +enum {{prefix}}HttpRequestVarLayout {NOT_SET, ADDRESS, URL_ENCODED, MULTIPART}; + +class {{prefix}}HttpRequestInputFileElement { public: QString variable_name; @@ -31,19 +33,19 @@ public: }; -class HttpRequestInput { +class {{prefix}}HttpRequestInput { public: QString url_str; QString http_method; - HttpRequestVarLayout var_layout; + {{prefix}}HttpRequestVarLayout var_layout; QMap vars; QMap headers; - QList files; + QList<{{prefix}}HttpRequestInputFileElement> files; QByteArray request_body; - HttpRequestInput(); - HttpRequestInput(QString v_url_str, QString v_http_method); + {{prefix}}HttpRequestInput(); + {{prefix}}HttpRequestInput(QString v_url_str, QString v_http_method); void initialize(); void add_var(QString key, QString value); void add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type); @@ -51,7 +53,7 @@ public: }; -class HttpRequestWorker : public QObject { +class {{prefix}}HttpRequestWorker : public QObject { Q_OBJECT public: @@ -59,15 +61,15 @@ public: QNetworkReply::NetworkError error_type; QString error_str; - explicit HttpRequestWorker(QObject *parent = 0); - virtual ~HttpRequestWorker(); + explicit {{prefix}}HttpRequestWorker(QObject *parent = 0); + virtual ~{{prefix}}HttpRequestWorker(); QString http_attribute_encode(QString attribute_name, QString input); - void execute(HttpRequestInput *input); + void execute({{prefix}}HttpRequestInput *input); static QSslConfiguration* sslDefaultConfiguration; signals: - void on_execution_finished(HttpRequestWorker *worker); + void on_execution_finished({{prefix}}HttpRequestWorker *worker); private: QNetworkAccessManager *manager; @@ -81,4 +83,4 @@ private slots: } {{/cppNamespaceDeclarations}} -#endif // HTTPREQUESTWORKER_H +#endif // {{prefix}}_HTTPREQUESTWORKER_H diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache index a451eaa8275..5e3290aded4 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache @@ -87,8 +87,8 @@ void {{/collectionFormat}} {{/queryParams}} - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "{{httpMethod}}"); + {{prefix}}HttpRequestWorker *worker = new {{prefix}}HttpRequestWorker(); + {{prefix}}HttpRequestInput input(fullPath, "{{httpMethod}}"); {{#formParams}} if ({{paramName}} != nullptr) { @@ -99,15 +99,16 @@ void {{#bodyParams}} {{#isContainer}} QJsonArray* {{paramName}}Array = new QJsonArray(); - toJsonArray((QList*){{paramName}}, {{paramName}}Array, QString("body"), QString("SWGUser*")); + toJsonArray((QList*){{paramName}}, {{paramName}}Array, QString("body"), QString("{{prefix}}User*")); QJsonDocument doc(*{{paramName}}Array); QByteArray bytes = doc.toJson(); input.request_body.append(bytes); {{/isContainer}} - {{^isContainer}} - QString output = {{paramName}}.asJson(); + {{^isContainer}}{{#isString}} + QString output(*{{paramName}});{{/isString}}{{^isString}} + QString output = {{paramName}}.asJson();{{/isString}} input.request_body.append(output); {{/isContainer}}{{/bodyParams}} @@ -122,7 +123,7 @@ void } connect(worker, - &HttpRequestWorker::on_execution_finished, + &{{prefix}}HttpRequestWorker::on_execution_finished, this, &{{classname}}::{{nickname}}Callback); @@ -130,7 +131,7 @@ void } void -{{classname}}::{{nickname}}Callback(HttpRequestWorker * worker) { +{{classname}}::{{nickname}}Callback({{prefix}}HttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -159,10 +160,10 @@ void } {{/isListContainer}} - {{^isListContainer}} + {{^isListContainer}}{{^isMapContainer}} {{#returnTypeIsPrimitive}} {{{returnType}}} output; // TODO add primitive output support - {{/returnTypeIsPrimitive}} + {{/returnTypeIsPrimitive}}{{/isMapContainer}} {{#isMapContainer}} {{{returnType}}} output = {{{defaultResponse}}}; QString json(worker->response); diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/api-header.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/api-header.mustache index 6c1aec1ed2a..286936ef64a 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/api-header.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/api-header.mustache @@ -1,6 +1,6 @@ {{>licenseInfo}} -#ifndef _SWG_{{classname}}_H_ -#define _SWG_{{classname}}_H_ +#ifndef _{{prefix}}_{{classname}}_H_ +#define _{{prefix}}_{{classname}}_H_ #include "{{prefix}}HttpRequest.h" @@ -28,14 +28,14 @@ public: {{#operations}}{{#operation}}void {{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{/operation}}{{/operations}} private: - {{#operations}}{{#operation}}void {{nickname}}Callback (HttpRequestWorker * worker); + {{#operations}}{{#operation}}void {{nickname}}Callback ({{prefix}}HttpRequestWorker * worker); {{/operation}}{{/operations}} signals: {{#operations}}{{#operation}}void {{nickname}}Signal({{#returnType}}{{{returnType}}} summary{{/returnType}}); {{/operation}}{{/operations}} {{#operations}}{{#operation}}void {{nickname}}SignalE({{#returnType}}{{{returnType}}} summary, {{/returnType}}QNetworkReply::NetworkError error_type, QString& error_str); {{/operation}}{{/operations}} - {{#operations}}{{#operation}}void {{nickname}}SignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + {{#operations}}{{#operation}}void {{nickname}}SignalEFull({{prefix}}HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); {{/operation}}{{/operations}} }; diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache index 94d1d60a37c..8bd673e980e 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache @@ -1,7 +1,7 @@ {{>licenseInfo}} -#include "SWGHelpers.h" -#include "SWGModelFactory.h" -#include "SWGObject.h" +#include "{{prefix}}Helpers.h" +#include "{{prefix}}ModelFactory.h" +#include "{{prefix}}Object.h" #include #include #include @@ -119,31 +119,31 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) { qDebug() << "Can't set value because the target pointer is nullptr"; } } - else if(type.startsWith("SWG") && obj.isObject()) { + else if(type.startsWith("{{prefix}}") && obj.isObject()) { // complex type QJsonObject jsonObj = obj.toObject(); - SWGObject * so = (SWGObject*)::{{cppNamespace}}::create(type); + {{prefix}}Object * so = ({{prefix}}Object*)::{{cppNamespace}}::create(type); if(so != nullptr) { so->fromJsonObject(jsonObj); - SWGObject **val = static_cast(value); + {{prefix}}Object **val = static_cast<{{prefix}}Object**>(value); delete *val; *val = so; } } else if(type.startsWith("QList") && QString("").compare(complexType) != 0 && obj.isArray()) { // list of values - if(complexType.startsWith("SWG")) { - QList* output = new QList(); + if(complexType.startsWith("{{prefix}}")) { + QList<{{prefix}}Object*>* output = new QList<{{prefix}}Object*>(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr) { // it's an object - SWGObject * val = (SWGObject*)create(complexType); + {{prefix}}Object * val = ({{prefix}}Object*)create(complexType); QJsonObject t = jval.toObject(); val->fromJsonObject(t); output->append(val); } - QList **val = static_cast**>(value); + QList<{{prefix}}Object*> **val = static_cast**>(value); for (auto item : **val) { delete item; } @@ -247,10 +247,10 @@ toJsonValue(QString name, void* value, QJsonObject* output, QString type) { if(value == nullptr) { return; } - if(type.startsWith("SWG")) { - SWGObject *swgObject = reinterpret_cast(value); - if(swgObject != nullptr) { - QJsonObject* o = (*swgObject).asJsonObject(); + if(type.startsWith("{{prefix}}")) { + {{prefix}}Object *{{prefix}}object = reinterpret_cast<{{prefix}}Object *>(value); + if({{prefix}}object != nullptr) { + QJsonObject* o = (*{{prefix}}object).asJsonObject(); if(name != nullptr) { output->insert(name, *o); delete o; @@ -303,11 +303,11 @@ toJsonValue(QString name, void* value, QJsonObject* output, QString type) { void toJsonArray(QList* value, QJsonArray* output, QString innerName, QString innerType) { - if(innerType.startsWith("SWG")){ + if(innerType.startsWith("{{prefix}}")){ for(void* obj : *value) { - SWGObject *swgObject = reinterpret_cast(obj); - if(swgObject != nullptr) { - output->append(*(swgObject->asJsonObject())); + {{prefix}}Object *{{prefix}}object = reinterpret_cast<{{prefix}}Object *>(obj); + if({{prefix}}object != nullptr) { + output->append(*({{prefix}}object->asJsonObject())); } } } diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-header.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-header.mustache index 3eb4f9a9d47..d35465685bf 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-header.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-header.mustache @@ -1,6 +1,6 @@ {{>licenseInfo}} -#ifndef SWGHELPERS_H -#define SWGHELPERS_H +#ifndef {{prefix}}_HELPERS_H +#define {{prefix}}_HELPERS_H #include @@ -21,4 +21,4 @@ namespace {{this}} { } {{/cppNamespaceDeclarations}} -#endif // SWGHELPERS_H +#endif // {{prefix}}_HELPERS_H diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache index 307494dda7d..ceb8b05cdb7 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache @@ -2,7 +2,7 @@ {{#models}}{{#model}} #include "{{classname}}.h" -#include "SWGHelpers.h" +#include "{{prefix}}Helpers.h" #include #include @@ -30,6 +30,7 @@ void {{classname}}::init() { {{#vars}} {{name}} = {{{defaultValue}}}; + m_{{name}}_isSet = false; {{/vars}} } @@ -106,7 +107,18 @@ QJsonObject* {{#complexType}} {{^isContainer}} {{#complexType}} - toJsonValue(QString("{{baseName}}"), {{name}}, obj, QString("{{complexType}}")); + {{^isString}} + {{^isDateTime}} + if({{name}}->isSet()){ + toJsonValue(QString("{{baseName}}"), {{name}}, obj, QString("{{complexType}}")); + } + {{/isDateTime}} + {{/isString}} + {{#isString}} + if({{name}} != nullptr && *{{name}} != QString("")){ + toJsonValue(QString("{{baseName}}"), {{name}}, obj, QString("{{complexType}}")); + } + {{/isString}} {{/complexType}} {{^complexType}} if({{name}} != nullptr && *{{name}} != nullptr) { @@ -115,33 +127,52 @@ QJsonObject* {{/complexType}} {{/isContainer}} {{#isListContainer}} - QJsonArray {{name}}JsonArray; - toJsonArray((QList*){{name}}, &{{name}}JsonArray, "{{name}}", "{{complexType}}"); - obj->insert("{{baseName}}", {{name}}JsonArray); + if({{name}}->size() > 0){ + QJsonArray {{name}}JsonArray; + toJsonArray((QList*){{name}}, &{{name}}JsonArray, "{{name}}", "{{complexType}}"); + obj->insert("{{baseName}}", {{name}}JsonArray); + } {{/isListContainer}} {{#isMapContainer}} - QJsonObject {{name}}_jobj; - for(auto keyval : {{name}}->keys()){ - toJsonValue(keyval, ((*{{name}})[keyval]), &{{name}}_jobj, "{{complexType}}"); - } - obj->insert("{{baseName}}", {{name}}_jobj); + if({{name}}->size() > 0) { + QJsonObject {{name}}_jobj; + for(auto keyval : {{name}}->keys()){ + toJsonValue(keyval, ((*{{name}})[keyval]), &{{name}}_jobj, "{{complexType}}"); + } + obj->insert("{{baseName}}", {{name}}_jobj); + } {{/isMapContainer}} {{/complexType}} {{^complexType}} {{^isContainer}} - obj->insert("{{baseName}}", QJsonValue({{name}})); + {{^isString}} + {{^isDateTime}} + if(m_{{name}}_isSet){ + obj->insert("{{baseName}}", QJsonValue({{name}})); + } + {{/isDateTime}} + {{/isString}} + {{#isString}} + if({{name}} != nullptr && *{{name}} != QString("")) { + obj->insert("{{name}}", QJsonValue(*{{name}})); + } + {{/isString}} {{/isContainer}} {{#isListContainer}} - QJsonArray {{name}}JsonArray; - toJsonArray((QList*){{name}}, &{{name}}JsonArray, "{{name}}", "{{items.baseType}}"); - obj->insert("{{baseName}}", {{name}}JsonArray); + if({{name}}->size() > 0){ + QJsonArray {{name}}JsonArray; + toJsonArray((QList*){{name}}, &{{name}}JsonArray, "{{name}}", "{{items.baseType}}"); + obj->insert("{{baseName}}", {{name}}JsonArray); + } {{/isListContainer}} {{#isMapContainer}} - QJsonObject {{name}}_jobj; - for(auto keyval : {{name}}->keys()){ - toJsonValue(keyval, ((*{{name}})[keyval]), &{{name}}_jobj, "{{items.baseType}}"); - } - obj->insert("{{baseName}}", {{name}}_jobj); + if({{name}}->size() > 0){ + QJsonObject {{name}}_jobj; + for(auto keyval : {{name}}->keys()){ + toJsonValue(keyval, ((*{{name}})[keyval]), &{{name}}_jobj, "{{items.baseType}}"); + } + obj->insert("{{baseName}}", {{name}}_jobj); + } {{/isMapContainer}} {{/complexType}} {{/vars}} @@ -157,10 +188,21 @@ QJsonObject* void {{classname}}::{{setter}}({{{datatype}}} {{name}}) { this->{{name}} = {{name}}; + this->m_{{name}}_isSet = true; } {{/vars}} +bool +{{classname}}::isSet(){ + bool isObjectUpdated = false; + do{ + {{#vars}} + {{#isPrimitiveType}}if(m_{{name}}_isSet){ isObjectUpdated = true; break;}{{/isPrimitiveType}}{{#isContainer}}if({{name}}->size() > 0){ isObjectUpdated = true; break;}{{/isContainer}}{{^isContainer}}{{#complexType}}{{^isString}}{{^isDateTime}}if({{name}} != nullptr && {{name}}->isSet()){ isObjectUpdated = true; break;}{{/isDateTime}}{{/isString}}{{#isString}}if({{name}} != nullptr && *{{name}} != QString("")){ isObjectUpdated = true; break;}{{/isString}}{{/complexType}}{{/isContainer}} + {{/vars}} + }while(false); + return isObjectUpdated; +} {{#cppNamespaceDeclarations}} } {{/cppNamespaceDeclarations}} diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/model-header.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/model-header.mustache index d2866f60e57..c3182a72c16 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/model-header.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/model-header.mustache @@ -14,7 +14,7 @@ {{#imports}}{{{import}}} {{/imports}} -#include "SWGObject.h" +#include "{{prefix}}Object.h" {{#models}} {{#model}} @@ -22,7 +22,7 @@ namespace {{this}} { {{/cppNamespaceDeclarations}} -class {{classname}}: public SWGObject { +class {{classname}}: public {{prefix}}Object { public: {{classname}}(); {{classname}}(QString* json); @@ -41,9 +41,13 @@ public: {{/vars}} + virtual bool isSet() override; + private: {{#vars}} {{{datatype}}} {{name}}; + bool m_{{name}}_isSet; + {{/vars}} }; diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/modelFactory.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/modelFactory.mustache index d4643363a5a..c1fbc136433 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/modelFactory.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/modelFactory.mustache @@ -20,7 +20,7 @@ namespace {{this}} { inline void* create(QString json, QString type) { void* val = create(type); if(val != nullptr) { - SWGObject* obj = static_cast(val); + {{prefix}}Object* obj = static_cast<{{prefix}}Object*>(val); return obj->fromJson(json); } if(type.startsWith("QString")) { diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/object.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/object.mustache index 53b7181b14d..e82bc31073a 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/object.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/object.mustache @@ -11,12 +11,12 @@ namespace {{this}} { class {{prefix}}Object { public: virtual QJsonObject* asJsonObject() { - return nullptr; + return new QJsonObject(); } - virtual ~SWGObject() {} - virtual SWGObject* fromJson(QString &jsonString) { + virtual ~{{prefix}}Object() {} + virtual {{prefix}}Object* fromJson(QString &jsonString) { Q_UNUSED(jsonString); - return nullptr; + return new {{prefix}}Object(); } virtual void fromJsonObject(QJsonObject &json) { Q_UNUSED(json); @@ -24,6 +24,9 @@ class {{prefix}}Object { virtual QString asJson() { return QString(""); } + virtual bool isSet() { + return false; + } }; {{#cppNamespaceDeclarations}} diff --git a/samples/client/petstore/qt5cpp/PetStore/PetApiTests.cpp b/samples/client/petstore/qt5cpp/PetStore/PetApiTests.cpp index 5299224d297..cf07c4ca5ec 100644 --- a/samples/client/petstore/qt5cpp/PetStore/PetApiTests.cpp +++ b/samples/client/petstore/qt5cpp/PetStore/PetApiTests.cpp @@ -18,8 +18,8 @@ SWGPetApi* PetApiTests::getApi() { return api; } -Pet* PetApiTests::createRandomPet() { - Pet* pet = new Pet(); +SWGPet* PetApiTests::createRandomPet() { + SWGPet* pet = new SWGPet(); qint64 id = QDateTime::currentMSecsSinceEpoch(); pet->setName(new QString("monster")); @@ -43,8 +43,8 @@ void PetApiTests::findPetsByStatusTest() { timer.setInterval(14000); timer.setSingleShot(true); - auto validator = [](QList* pets) { - foreach(Pet* pet, *pets) { + auto validator = [](QList* pets) { + foreach(SWGPet* pet, *pets) { QVERIFY(pet->getStatus()->startsWith("available") || pet->getStatus()->startsWith("sold")); } loop.quit(); @@ -79,7 +79,7 @@ void PetApiTests::createAndGetPetTest() { connect(api, &SWGPetApi::addPetSignal, this, validator); connect(&timer, &QTimer::timeout, &loop, &QEventLoop::quit); - Pet* pet = createRandomPet(); + SWGPet* pet = createRandomPet(); qint64 id = pet->getId(); api->addPet(*pet); @@ -90,7 +90,7 @@ void PetApiTests::createAndGetPetTest() { timer.setInterval(1000); timer.setSingleShot(true); - auto getPetValidator = [](Pet* pet) { + auto getPetValidator = [](SWGPet* pet) { QVERIFY(pet->getId() > 0); QVERIFY(pet->getStatus()->compare("freaky") == 0); loop.quit(); @@ -109,8 +109,8 @@ void PetApiTests::createAndGetPetTest() { void PetApiTests::updatePetTest() { static SWGPetApi* api = getApi(); - Pet* pet = createRandomPet(); - static Pet* petToCheck; + SWGPet* pet = createRandomPet(); + static SWGPet* petToCheck; qint64 id = pet->getId(); static QEventLoop loop; QTimer timer; @@ -134,7 +134,7 @@ void PetApiTests::updatePetTest() { timer.setInterval(1000); timer.setSingleShot(true); - auto fetchPet = [](Pet* pet) { + auto fetchPet = [](SWGPet* pet) { petToCheck = pet; loop.quit(); }; @@ -168,7 +168,7 @@ void PetApiTests::updatePetTest() { timer.setInterval(1000); timer.setSingleShot(true); - auto fetchPet2 = [](Pet* pet) { + auto fetchPet2 = [](SWGPet* pet) { QVERIFY(pet->getId() == petToCheck->getId()); QVERIFY(pet->getStatus()->compare(petToCheck->getStatus()) == 0); loop.quit(); @@ -184,8 +184,8 @@ void PetApiTests::updatePetTest() { void PetApiTests::updatePetWithFormTest() { static SWGPetApi* api = getApi(); - Pet* pet = createRandomPet(); - static Pet* petToCheck; + SWGPet* pet = createRandomPet(); + static SWGPet* petToCheck; qint64 id = pet->getId(); static QEventLoop loop; QTimer timer; @@ -209,7 +209,7 @@ void PetApiTests::updatePetWithFormTest() { timer.setInterval(1000); timer.setSingleShot(true); - auto fetchPet = [](Pet* pet) { + auto fetchPet = [](SWGPet* pet) { petToCheck = pet; loop.quit(); }; @@ -237,7 +237,7 @@ void PetApiTests::updatePetWithFormTest() { timer.setInterval(1000); timer.setSingleShot(true); - auto fetchUpdatedPet = [](Pet* pet) { + auto fetchUpdatedPet = [](SWGPet* pet) { QVERIFY(pet->getName()->compare(QString("gorilla")) == 0); loop.quit(); }; diff --git a/samples/client/petstore/qt5cpp/PetStore/PetApiTests.h b/samples/client/petstore/qt5cpp/PetStore/PetApiTests.h index 6de5bf4ecbd..e219bb9a639 100644 --- a/samples/client/petstore/qt5cpp/PetStore/PetApiTests.h +++ b/samples/client/petstore/qt5cpp/PetStore/PetApiTests.h @@ -18,7 +18,7 @@ Q_OBJECT private: SWGPetApi* getApi(); - Pet* createRandomPet(); + SWGPet* createRandomPet(); signals: void quit(); diff --git a/samples/client/petstore/qt5cpp/client/SWGApiResponse.cpp b/samples/client/petstore/qt5cpp/client/SWGApiResponse.cpp index 8835d53325b..276270ae3cd 100644 --- a/samples/client/petstore/qt5cpp/client/SWGApiResponse.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGApiResponse.cpp @@ -38,8 +38,11 @@ SWGApiResponse::~SWGApiResponse() { void SWGApiResponse::init() { code = 0; + m_code_isSet = false; type = new QString(""); + m_type_isSet = false; message = new QString(""); + m_message_isSet = false; } void @@ -82,9 +85,15 @@ SWGApiResponse::asJson () QJsonObject* SWGApiResponse::asJsonObject() { QJsonObject* obj = new QJsonObject(); - obj->insert("code", QJsonValue(code)); - toJsonValue(QString("type"), type, obj, QString("QString")); - toJsonValue(QString("message"), message, obj, QString("QString")); + if(m_code_isSet){ + obj->insert("code", QJsonValue(code)); + } + if(type != nullptr && *type != QString("")){ + toJsonValue(QString("type"), type, obj, QString("QString")); + } + if(message != nullptr && *message != QString("")){ + toJsonValue(QString("message"), message, obj, QString("QString")); + } return obj; } @@ -96,6 +105,7 @@ SWGApiResponse::getCode() { void SWGApiResponse::setCode(qint32 code) { this->code = code; + this->m_code_isSet = true; } QString* @@ -105,6 +115,7 @@ SWGApiResponse::getType() { void SWGApiResponse::setType(QString* type) { this->type = type; + this->m_type_isSet = true; } QString* @@ -114,8 +125,19 @@ SWGApiResponse::getMessage() { void SWGApiResponse::setMessage(QString* message) { this->message = message; + this->m_message_isSet = true; } +bool +SWGApiResponse::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_code_isSet){ isObjectUpdated = true; break;} + if(type != nullptr && *type != QString("")){ isObjectUpdated = true; break;} + if(message != nullptr && *message != QString("")){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} } diff --git a/samples/client/petstore/qt5cpp/client/SWGApiResponse.h b/samples/client/petstore/qt5cpp/client/SWGApiResponse.h index 864cf964353..5204b245da6 100644 --- a/samples/client/petstore/qt5cpp/client/SWGApiResponse.h +++ b/samples/client/petstore/qt5cpp/client/SWGApiResponse.h @@ -51,10 +51,18 @@ class SWGApiResponse: public SWGObject { void setMessage(QString* message); + virtual bool isSet() override; + private: qint32 code; + bool m_code_isSet; + QString* type; + bool m_type_isSet; + QString* message; + bool m_message_isSet; + }; } diff --git a/samples/client/petstore/qt5cpp/client/SWGCategory.cpp b/samples/client/petstore/qt5cpp/client/SWGCategory.cpp index 916492f2f51..b383141403d 100644 --- a/samples/client/petstore/qt5cpp/client/SWGCategory.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGCategory.cpp @@ -38,7 +38,9 @@ SWGCategory::~SWGCategory() { void SWGCategory::init() { id = 0L; + m_id_isSet = false; name = new QString(""); + m_name_isSet = false; } void @@ -77,8 +79,12 @@ SWGCategory::asJson () QJsonObject* SWGCategory::asJsonObject() { QJsonObject* obj = new QJsonObject(); - obj->insert("id", QJsonValue(id)); - toJsonValue(QString("name"), name, obj, QString("QString")); + if(m_id_isSet){ + obj->insert("id", QJsonValue(id)); + } + if(name != nullptr && *name != QString("")){ + toJsonValue(QString("name"), name, obj, QString("QString")); + } return obj; } @@ -90,6 +96,7 @@ SWGCategory::getId() { void SWGCategory::setId(qint64 id) { this->id = id; + this->m_id_isSet = true; } QString* @@ -99,8 +106,18 @@ SWGCategory::getName() { void SWGCategory::setName(QString* name) { this->name = name; + this->m_name_isSet = true; } +bool +SWGCategory::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_id_isSet){ isObjectUpdated = true; break;} + if(name != nullptr && *name != QString("")){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} } diff --git a/samples/client/petstore/qt5cpp/client/SWGCategory.h b/samples/client/petstore/qt5cpp/client/SWGCategory.h index 6b9fcb34773..83172863564 100644 --- a/samples/client/petstore/qt5cpp/client/SWGCategory.h +++ b/samples/client/petstore/qt5cpp/client/SWGCategory.h @@ -48,9 +48,15 @@ class SWGCategory: public SWGObject { void setName(QString* name); + virtual bool isSet() override; + private: qint64 id; + bool m_id_isSet; + QString* name; + bool m_name_isSet; + }; } diff --git a/samples/client/petstore/qt5cpp/client/SWGHelpers.cpp b/samples/client/petstore/qt5cpp/client/SWGHelpers.cpp index 7a899b84882..ed33368f1f7 100644 --- a/samples/client/petstore/qt5cpp/client/SWGHelpers.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGHelpers.cpp @@ -141,10 +141,10 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) { } else if(type.startsWith("QList") && QString("").compare(complexType) != 0 && obj.isArray()) { // list of values - QList* output = new QList(); - QJsonArray arr = obj.toArray(); - foreach (const QJsonValue & jval, arr) { - if(complexType.startsWith("SWG")) { + if(complexType.startsWith("SWG")) { + QList* output = new QList(); + QJsonArray arr = obj.toArray(); + for (const QJsonValue & jval : arr) { // it's an object SWGObject * val = (SWGObject*)create(complexType); QJsonObject t = jval.toObject(); @@ -152,53 +152,102 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) { val->fromJsonObject(t); output->append(val); } - else { - // primitives - if(QStringLiteral("qint32").compare(complexType) == 0) { - qint32 val; - setValue(&val, jval, QStringLiteral("qint32"), QStringLiteral("")); - output->append((void*)&val); - } - else if(QStringLiteral("qint64").compare(complexType) == 0) { - qint64 val; - setValue(&val, jval, QStringLiteral("qint64"), QStringLiteral("")); - output->append((void*)&val); - } - else if(QStringLiteral("bool").compare(complexType) == 0) { - bool val; - setValue(&val, jval, QStringLiteral("bool"), QStringLiteral("")); - output->append((void*)&val); - } - else if(QStringLiteral("float").compare(complexType) == 0) { - float val; - setValue(&val, jval, QStringLiteral("float"), QStringLiteral("")); - output->append((void*)&val); - } - else if(QStringLiteral("double").compare(complexType) == 0) { - double val; - setValue(&val, jval, QStringLiteral("double"), QStringLiteral("")); - output->append((void*)&val); - } - else if(QStringLiteral("QString").compare(complexType) == 0) { - QString * val = new QString(); - setValue(&val, jval, QStringLiteral("QString"), QStringLiteral("")); - output->append((void*)val); - } - else if(QStringLiteral("QDate").compare(complexType) == 0) { - QDate * val = new QDate(); - setValue(&val, jval, QStringLiteral("QDate"), QStringLiteral("")); - output->append((void*)val); - } - else if(QStringLiteral("QDateTime").compare(complexType) == 0) { - QDateTime * val = new QDateTime(); - setValue(&val, jval, QStringLiteral("QDateTime"), QStringLiteral("")); - output->append((void*)val); - } + QList **val = static_cast**>(value); + for (auto item : **val) { + delete item; + } + delete *val; + *val = output; + } + else if(QStringLiteral("qint32").compare(complexType) == 0) { + QList **output = reinterpret_cast **> (value); + (*output)->clear(); + QJsonArray arr = obj.toArray(); + for (const QJsonValue & jval : arr){ + qint32 val; + setValue(&val, jval, QStringLiteral("qint32"), QStringLiteral("")); + (*output)->push_back(val); + } + } + else if(QStringLiteral("qint64").compare(complexType) == 0) { + QList **output = reinterpret_cast **> (value); + (*output)->clear(); + QJsonArray arr = obj.toArray(); + for (const QJsonValue & jval : arr){ + qint64 val; + setValue(&val, jval, QStringLiteral("qint64"), QStringLiteral("")); + (*output)->push_back(val); + } + } + else if(QStringLiteral("bool").compare(complexType) == 0) { + QList **output = reinterpret_cast **> (value); + (*output)->clear(); + QJsonArray arr = obj.toArray(); + for (const QJsonValue & jval : arr){ + bool val; + setValue(&val, jval, QStringLiteral("bool"), QStringLiteral("")); + (*output)->push_back(val); + } + } + else if(QStringLiteral("float").compare(complexType) == 0) { + QList **output = reinterpret_cast **> (value); + (*output)->clear(); + QJsonArray arr = obj.toArray(); + for (const QJsonValue & jval : arr){ + float val; + setValue(&val, jval, QStringLiteral("float"), QStringLiteral("")); + (*output)->push_back(val); + } + } + else if(QStringLiteral("double").compare(complexType) == 0) { + QList **output = reinterpret_cast **> (value); + (*output)->clear(); + QJsonArray arr = obj.toArray(); + for (const QJsonValue & jval : arr){ + double val; + setValue(&val, jval, QStringLiteral("double"), QStringLiteral("")); + (*output)->push_back(val); + } + } + else if(QStringLiteral("QString").compare(complexType) == 0) { + QList **output = reinterpret_cast **> (value); + for (auto item : **output) { + delete item; + } + (*output)->clear(); + QJsonArray arr = obj.toArray(); + for (const QJsonValue & jval : arr){ + QString * val = new QString(); + setValue(&val, jval, QStringLiteral("QString"), QStringLiteral("")); + (*output)->push_back(val); + } + } + else if(QStringLiteral("QDate").compare(complexType) == 0) { + QList **output = reinterpret_cast **> (value); + for (auto item : **output) { + delete item; + } + (*output)->clear(); + QJsonArray arr = obj.toArray(); + for (const QJsonValue & jval : arr){ + QDate * val = new QDate(); + setValue(&val, jval, QStringLiteral("QDate"), QStringLiteral("")); + (*output)->push_back(val); + } + } + else if(QStringLiteral("QDateTime").compare(complexType) == 0) { + QList **output = reinterpret_cast **> (value); + for (auto item : **output) { + delete item; + } + (*output)->clear(); + QJsonArray arr = obj.toArray(); + for (const QJsonValue & jval : arr){ + QDateTime * val = new QDateTime(); + setValue(&val, jval, QStringLiteral("QDateTime"), QStringLiteral("")); + (*output)->push_back(val); } } - QList **val = static_cast**>(value); - delete *val; - *val = output; } } @@ -208,16 +257,16 @@ toJsonValue(QString name, void* value, QJsonObject* output, QString type) { return; } if(type.startsWith("SWG")) { - SWGObject *swgObject = reinterpret_cast(value); - if(swgObject != nullptr) { - QJsonObject* o = (*swgObject).asJsonObject(); + SWGObject *SWGobject = reinterpret_cast(value); + if(SWGobject != nullptr) { + QJsonObject* o = (*SWGobject).asJsonObject(); if(name != nullptr) { output->insert(name, *o); delete o; } else { output->empty(); - foreach(QString key, o->keys()) { + for(QString key : o->keys()) { output->insert(key, o->value(key)); } } @@ -263,11 +312,52 @@ toJsonValue(QString name, void* value, QJsonObject* output, QString type) { void toJsonArray(QList* value, QJsonArray* output, QString innerName, QString innerType) { - foreach(void* obj, *value) { - QJsonObject element; - - toJsonValue(nullptr, obj, &element, innerType); - output->append(element); + if(innerType.startsWith("SWG")){ + for(void* obj : *value) { + SWGObject *SWGobject = reinterpret_cast(obj); + if(SWGobject != nullptr) { + output->append(*(SWGobject->asJsonObject())); + } + } + } + else if(QStringLiteral("QString").compare(innerType) == 0) { + for(QString* obj : *(reinterpret_cast*>(value))){ + output->append(QJsonValue(*obj)); + } + } + else if(QStringLiteral("QDate").compare(innerType) == 0) { + for(QDate* obj : *(reinterpret_cast*>(value))){ + output->append(QJsonValue(obj->toString(Qt::ISODate))); + } + } + else if(QStringLiteral("QDateTime").compare(innerType) == 0) { + for(QDateTime* obj : *(reinterpret_cast*>(value))){ + output->append(QJsonValue(obj->toString(Qt::ISODate))); } + } + else if(QStringLiteral("QByteArray").compare(innerType) == 0) { + for(QByteArray* obj : *(reinterpret_cast*>(value))){ + output->append(QJsonValue(QString(obj->toBase64()))); + } + } + else if(QStringLiteral("qint32").compare(innerType) == 0) { + for(qint32 obj : *(reinterpret_cast*>(value))) + output->append(QJsonValue(obj)); + } + else if(QStringLiteral("qint64").compare(innerType) == 0) { + for(qint64 obj : *(reinterpret_cast*>(value))) + output->append(QJsonValue(obj)); + } + else if(QStringLiteral("bool").compare(innerType) == 0) { + for(bool obj : *(reinterpret_cast*>(value))) + output->append(QJsonValue(obj)); + } + else if(QStringLiteral("float").compare(innerType) == 0) { + for(float obj : *(reinterpret_cast*>(value))) + output->append(QJsonValue(obj)); + } + else if(QStringLiteral("double").compare(innerType) == 0) { + for(double obj : *(reinterpret_cast*>(value))) + output->append(QJsonValue(obj)); } } diff --git a/samples/client/petstore/qt5cpp/client/SWGHelpers.h b/samples/client/petstore/qt5cpp/client/SWGHelpers.h index 4a0aee4ee70..13a33c9c338 100644 --- a/samples/client/petstore/qt5cpp/client/SWGHelpers.h +++ b/samples/client/petstore/qt5cpp/client/SWGHelpers.h @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -#ifndef SWGHELPERS_H -#define SWGHELPERS_H +#ifndef SWG_HELPERS_H +#define SWG_HELPERS_H #include @@ -28,4 +28,4 @@ namespace Swagger { } -#endif // SWGHELPERS_H +#endif // SWG_HELPERS_H diff --git a/samples/client/petstore/qt5cpp/client/SWGHttpRequest.cpp b/samples/client/petstore/qt5cpp/client/SWGHttpRequest.cpp index 958b9a49ca3..bf2fe17f6b0 100644 --- a/samples/client/petstore/qt5cpp/client/SWGHttpRequest.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGHttpRequest.cpp @@ -20,27 +20,27 @@ namespace Swagger { -HttpRequestInput::HttpRequestInput() { +SWGHttpRequestInput::SWGHttpRequestInput() { initialize(); } -HttpRequestInput::HttpRequestInput(QString v_url_str, QString v_http_method) { +SWGHttpRequestInput::SWGHttpRequestInput(QString v_url_str, QString v_http_method) { initialize(); url_str = v_url_str; http_method = v_http_method; } -void HttpRequestInput::initialize() { +void SWGHttpRequestInput::initialize() { var_layout = NOT_SET; url_str = ""; http_method = "GET"; } -void HttpRequestInput::add_var(QString key, QString value) { +void SWGHttpRequestInput::add_var(QString key, QString value) { vars[key] = value; } -void HttpRequestInput::add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type) { +void SWGHttpRequestInput::add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type) { SWGHttpRequestInputFileElement file; file.variable_name = variable_name; file.local_filename = local_filename; @@ -50,7 +50,7 @@ void HttpRequestInput::add_file(QString variable_name, QString local_filename, Q } -HttpRequestWorker::HttpRequestWorker(QObject *parent) +SWGHttpRequestWorker::SWGHttpRequestWorker(QObject *parent) : QObject(parent), manager(nullptr) { qsrand(QDateTime::currentDateTime().toTime_t()); @@ -59,10 +59,10 @@ HttpRequestWorker::HttpRequestWorker(QObject *parent) connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(on_manager_finished(QNetworkReply*))); } -HttpRequestWorker::~HttpRequestWorker() { +SWGHttpRequestWorker::~SWGHttpRequestWorker() { } -QString HttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) { +QString SWGHttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) { // result structure follows RFC 5987 bool need_utf_encoding = false; QString result = ""; @@ -110,7 +110,7 @@ QString HttpRequestWorker::http_attribute_encode(QString attribute_name, QString return QString("%1=\"%2\"; %1*=utf-8''%3").arg(attribute_name, result, result_utf8); } -void HttpRequestWorker::execute(HttpRequestInput *input) { +void SWGHttpRequestWorker::execute(SWGHttpRequestInput *input) { // reset variables @@ -262,8 +262,8 @@ void HttpRequestWorker::execute(HttpRequestInput *input) { // prepare connection QNetworkRequest request = QNetworkRequest(QUrl(input->url_str)); - if (HttpRequestWorker::sslDefaultConfiguration != nullptr) { - request.setSslConfiguration(*HttpRequestWorker::sslDefaultConfiguration); + if (SWGHttpRequestWorker::sslDefaultConfiguration != nullptr) { + request.setSslConfiguration(*SWGHttpRequestWorker::sslDefaultConfiguration); } request.setRawHeader("User-Agent", "Swagger-Client"); foreach(QString key, input->headers.keys()) { @@ -310,7 +310,7 @@ void HttpRequestWorker::execute(HttpRequestInput *input) { } -void HttpRequestWorker::on_manager_finished(QNetworkReply *reply) { +void SWGHttpRequestWorker::on_manager_finished(QNetworkReply *reply) { error_type = reply->error(); response = reply->readAll(); error_str = reply->errorString(); @@ -319,7 +319,7 @@ void HttpRequestWorker::on_manager_finished(QNetworkReply *reply) { emit on_execution_finished(this); } -QSslConfiguration* HttpRequestWorker::sslDefaultConfiguration; +QSslConfiguration* SWGHttpRequestWorker::sslDefaultConfiguration; } diff --git a/samples/client/petstore/qt5cpp/client/SWGHttpRequest.h b/samples/client/petstore/qt5cpp/client/SWGHttpRequest.h index 97bfd542593..d15ecb2b27c 100644 --- a/samples/client/petstore/qt5cpp/client/SWGHttpRequest.h +++ b/samples/client/petstore/qt5cpp/client/SWGHttpRequest.h @@ -16,8 +16,8 @@ * **/ -#ifndef HTTPREQUESTWORKER_H -#define HTTPREQUESTWORKER_H +#ifndef SWG_HTTPREQUESTWORKER_H +#define SWG_HTTPREQUESTWORKER_H #include #include @@ -25,10 +25,12 @@ #include #include -enum HttpRequestVarLayout {NOT_SET, ADDRESS, URL_ENCODED, MULTIPART}; + namespace Swagger { +enum SWGHttpRequestVarLayout {NOT_SET, ADDRESS, URL_ENCODED, MULTIPART}; + class SWGHttpRequestInputFileElement { public: @@ -40,19 +42,19 @@ class SWGHttpRequestInputFileElement { }; -class HttpRequestInput { +class SWGHttpRequestInput { public: QString url_str; QString http_method; - HttpRequestVarLayout var_layout; + SWGHttpRequestVarLayout var_layout; QMap vars; QMap headers; QList files; QByteArray request_body; - HttpRequestInput(); - HttpRequestInput(QString v_url_str, QString v_http_method); + SWGHttpRequestInput(); + SWGHttpRequestInput(QString v_url_str, QString v_http_method); void initialize(); void add_var(QString key, QString value); void add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type); @@ -60,7 +62,7 @@ class HttpRequestInput { }; -class HttpRequestWorker : public QObject { +class SWGHttpRequestWorker : public QObject { Q_OBJECT public: @@ -68,15 +70,15 @@ class HttpRequestWorker : public QObject { QNetworkReply::NetworkError error_type; QString error_str; - explicit HttpRequestWorker(QObject *parent = 0); - virtual ~HttpRequestWorker(); + explicit SWGHttpRequestWorker(QObject *parent = 0); + virtual ~SWGHttpRequestWorker(); QString http_attribute_encode(QString attribute_name, QString input); - void execute(HttpRequestInput *input); + void execute(SWGHttpRequestInput *input); static QSslConfiguration* sslDefaultConfiguration; signals: - void on_execution_finished(HttpRequestWorker *worker); + void on_execution_finished(SWGHttpRequestWorker *worker); private: QNetworkAccessManager *manager; @@ -88,4 +90,4 @@ private slots: } -#endif // HTTPREQUESTWORKER_H +#endif // SWG_HTTPREQUESTWORKER_H diff --git a/samples/client/petstore/qt5cpp/client/SWGObject.h b/samples/client/petstore/qt5cpp/client/SWGObject.h index 1183eb5f06e..26e6b905df9 100644 --- a/samples/client/petstore/qt5cpp/client/SWGObject.h +++ b/samples/client/petstore/qt5cpp/client/SWGObject.h @@ -20,12 +20,12 @@ namespace Swagger { class SWGObject { public: virtual QJsonObject* asJsonObject() { - return nullptr; + return new QJsonObject(); } virtual ~SWGObject() {} virtual SWGObject* fromJson(QString &jsonString) { Q_UNUSED(jsonString); - return nullptr; + return new SWGObject(); } virtual void fromJsonObject(QJsonObject &json) { Q_UNUSED(json); @@ -33,6 +33,9 @@ class SWGObject { virtual QString asJson() { return QString(""); } + virtual bool isSet() { + return false; + } }; } diff --git a/samples/client/petstore/qt5cpp/client/SWGOrder.cpp b/samples/client/petstore/qt5cpp/client/SWGOrder.cpp index 8092e3cf428..af011bd0e60 100644 --- a/samples/client/petstore/qt5cpp/client/SWGOrder.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGOrder.cpp @@ -38,11 +38,17 @@ SWGOrder::~SWGOrder() { void SWGOrder::init() { id = 0L; + m_id_isSet = false; pet_id = 0L; + m_pet_id_isSet = false; quantity = 0; + m_quantity_isSet = false; ship_date = NULL; + m_ship_date_isSet = false; status = new QString(""); + m_status_isSet = false; complete = false; + m_complete_isSet = false; } void @@ -91,12 +97,21 @@ SWGOrder::asJson () QJsonObject* SWGOrder::asJsonObject() { QJsonObject* obj = new QJsonObject(); - obj->insert("id", QJsonValue(id)); - obj->insert("petId", QJsonValue(pet_id)); - obj->insert("quantity", QJsonValue(quantity)); - toJsonValue(QString("shipDate"), ship_date, obj, QString("QDateTime")); - toJsonValue(QString("status"), status, obj, QString("QString")); - obj->insert("complete", QJsonValue(complete)); + if(m_id_isSet){ + obj->insert("id", QJsonValue(id)); + } + if(m_pet_id_isSet){ + obj->insert("petId", QJsonValue(pet_id)); + } + if(m_quantity_isSet){ + obj->insert("quantity", QJsonValue(quantity)); + } + if(status != nullptr && *status != QString("")){ + toJsonValue(QString("status"), status, obj, QString("QString")); + } + if(m_complete_isSet){ + obj->insert("complete", QJsonValue(complete)); + } return obj; } @@ -108,6 +123,7 @@ SWGOrder::getId() { void SWGOrder::setId(qint64 id) { this->id = id; + this->m_id_isSet = true; } qint64 @@ -117,6 +133,7 @@ SWGOrder::getPetId() { void SWGOrder::setPetId(qint64 pet_id) { this->pet_id = pet_id; + this->m_pet_id_isSet = true; } qint32 @@ -126,6 +143,7 @@ SWGOrder::getQuantity() { void SWGOrder::setQuantity(qint32 quantity) { this->quantity = quantity; + this->m_quantity_isSet = true; } QDateTime* @@ -135,6 +153,7 @@ SWGOrder::getShipDate() { void SWGOrder::setShipDate(QDateTime* ship_date) { this->ship_date = ship_date; + this->m_ship_date_isSet = true; } QString* @@ -144,6 +163,7 @@ SWGOrder::getStatus() { void SWGOrder::setStatus(QString* status) { this->status = status; + this->m_status_isSet = true; } bool @@ -153,8 +173,22 @@ SWGOrder::isComplete() { void SWGOrder::setComplete(bool complete) { this->complete = complete; + this->m_complete_isSet = true; } +bool +SWGOrder::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_id_isSet){ isObjectUpdated = true; break;} + if(m_pet_id_isSet){ isObjectUpdated = true; break;} + if(m_quantity_isSet){ isObjectUpdated = true; break;} + + if(status != nullptr && *status != QString("")){ isObjectUpdated = true; break;} + if(m_complete_isSet){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} } diff --git a/samples/client/petstore/qt5cpp/client/SWGOrder.h b/samples/client/petstore/qt5cpp/client/SWGOrder.h index ef061bffe2e..74cfc443f10 100644 --- a/samples/client/petstore/qt5cpp/client/SWGOrder.h +++ b/samples/client/petstore/qt5cpp/client/SWGOrder.h @@ -61,13 +61,27 @@ class SWGOrder: public SWGObject { void setComplete(bool complete); + virtual bool isSet() override; + private: qint64 id; + bool m_id_isSet; + qint64 pet_id; + bool m_pet_id_isSet; + qint32 quantity; + bool m_quantity_isSet; + QDateTime* ship_date; + bool m_ship_date_isSet; + QString* status; + bool m_status_isSet; + bool complete; + bool m_complete_isSet; + }; } diff --git a/samples/client/petstore/qt5cpp/client/SWGPet.cpp b/samples/client/petstore/qt5cpp/client/SWGPet.cpp index 6c377a057b0..c4c7a72fda3 100644 --- a/samples/client/petstore/qt5cpp/client/SWGPet.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGPet.cpp @@ -38,11 +38,17 @@ SWGPet::~SWGPet() { void SWGPet::init() { id = 0L; + m_id_isSet = false; category = new SWGCategory(); + m_category_isSet = false; name = new QString(""); + m_name_isSet = false; photo_urls = new QList(); + m_photo_urls_isSet = false; tags = new QList(); + m_tags_isSet = false; status = new QString(""); + m_status_isSet = false; } void @@ -105,16 +111,28 @@ SWGPet::asJson () QJsonObject* SWGPet::asJsonObject() { QJsonObject* obj = new QJsonObject(); - obj->insert("id", QJsonValue(id)); - toJsonValue(QString("category"), category, obj, QString("SWGCategory")); - toJsonValue(QString("name"), name, obj, QString("QString")); - QJsonArray photo_urlsJsonArray; - toJsonArray((QList*)photo_urls, &photo_urlsJsonArray, "photo_urls", "QString"); - obj->insert("photoUrls", photo_urlsJsonArray); - QJsonArray tagsJsonArray; - toJsonArray((QList*)tags, &tagsJsonArray, "tags", "SWGTag"); - obj->insert("tags", tagsJsonArray); - toJsonValue(QString("status"), status, obj, QString("QString")); + if(m_id_isSet){ + obj->insert("id", QJsonValue(id)); + } + if(category->isSet()){ + toJsonValue(QString("category"), category, obj, QString("SWGCategory")); + } + if(name != nullptr && *name != QString("")){ + toJsonValue(QString("name"), name, obj, QString("QString")); + } + if(photo_urls->size() > 0){ + QJsonArray photo_urlsJsonArray; + toJsonArray((QList*)photo_urls, &photo_urlsJsonArray, "photo_urls", "QString"); + obj->insert("photoUrls", photo_urlsJsonArray); + } + if(tags->size() > 0){ + QJsonArray tagsJsonArray; + toJsonArray((QList*)tags, &tagsJsonArray, "tags", "SWGTag"); + obj->insert("tags", tagsJsonArray); + } + if(status != nullptr && *status != QString("")){ + toJsonValue(QString("status"), status, obj, QString("QString")); + } return obj; } @@ -126,6 +144,7 @@ SWGPet::getId() { void SWGPet::setId(qint64 id) { this->id = id; + this->m_id_isSet = true; } SWGCategory* @@ -135,6 +154,7 @@ SWGPet::getCategory() { void SWGPet::setCategory(SWGCategory* category) { this->category = category; + this->m_category_isSet = true; } QString* @@ -144,6 +164,7 @@ SWGPet::getName() { void SWGPet::setName(QString* name) { this->name = name; + this->m_name_isSet = true; } QList* @@ -153,6 +174,7 @@ SWGPet::getPhotoUrls() { void SWGPet::setPhotoUrls(QList* photo_urls) { this->photo_urls = photo_urls; + this->m_photo_urls_isSet = true; } QList* @@ -162,6 +184,7 @@ SWGPet::getTags() { void SWGPet::setTags(QList* tags) { this->tags = tags; + this->m_tags_isSet = true; } QString* @@ -171,8 +194,22 @@ SWGPet::getStatus() { void SWGPet::setStatus(QString* status) { this->status = status; + this->m_status_isSet = true; } +bool +SWGPet::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_id_isSet){ isObjectUpdated = true; break;} + if(category != nullptr && category->isSet()){ isObjectUpdated = true; break;} + if(name != nullptr && *name != QString("")){ isObjectUpdated = true; break;} + if(photo_urls->size() > 0){ isObjectUpdated = true; break;} + if(tags->size() > 0){ isObjectUpdated = true; break;} + if(status != nullptr && *status != QString("")){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} } diff --git a/samples/client/petstore/qt5cpp/client/SWGPet.h b/samples/client/petstore/qt5cpp/client/SWGPet.h index a3b58bceaf6..30a46879084 100644 --- a/samples/client/petstore/qt5cpp/client/SWGPet.h +++ b/samples/client/petstore/qt5cpp/client/SWGPet.h @@ -63,13 +63,27 @@ class SWGPet: public SWGObject { void setStatus(QString* status); + virtual bool isSet() override; + private: qint64 id; + bool m_id_isSet; + SWGCategory* category; + bool m_category_isSet; + QString* name; + bool m_name_isSet; + QList* photo_urls; + bool m_photo_urls_isSet; + QList* tags; + bool m_tags_isSet; + QString* status; + bool m_status_isSet; + }; } diff --git a/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp b/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp index e96d210e3eb..dc2afc37919 100644 --- a/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp @@ -35,10 +35,11 @@ SWGPetApi::addPet(SWGPet body) { - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "POST"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "POST"); + QString output = body.asJson(); input.request_body.append(output); @@ -49,7 +50,7 @@ SWGPetApi::addPet(SWGPet body) { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGPetApi::addPetCallback); @@ -57,7 +58,7 @@ SWGPetApi::addPet(SWGPet body) { } void -SWGPetApi::addPetCallback(HttpRequestWorker * worker) { +SWGPetApi::addPetCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -88,8 +89,8 @@ SWGPetApi::deletePet(qint64 pet_id, QString* api_key) { fullPath.replace(pet_idPathParam, stringValue(pet_id)); - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "DELETE"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "DELETE"); @@ -103,7 +104,7 @@ SWGPetApi::deletePet(qint64 pet_id, QString* api_key) { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGPetApi::deletePetCallback); @@ -111,7 +112,7 @@ SWGPetApi::deletePet(qint64 pet_id, QString* api_key) { } void -SWGPetApi::deletePetCallback(HttpRequestWorker * worker) { +SWGPetApi::deletePetCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -182,8 +183,8 @@ SWGPetApi::findPetsByStatus(QList* status) { } - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "GET"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "GET"); @@ -194,7 +195,7 @@ SWGPetApi::findPetsByStatus(QList* status) { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGPetApi::findPetsByStatusCallback); @@ -202,7 +203,7 @@ SWGPetApi::findPetsByStatus(QList* status) { } void -SWGPetApi::findPetsByStatusCallback(HttpRequestWorker * worker) { +SWGPetApi::findPetsByStatusCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -228,7 +229,7 @@ SWGPetApi::findPetsByStatusCallback(HttpRequestWorker * worker) { output->append(o); } - worker->deleteLater(); + worker->deleteLater(); if (worker->error_type == QNetworkReply::NoError) { emit findPetsByStatusSignal(output); @@ -287,8 +288,8 @@ SWGPetApi::findPetsByTags(QList* tags) { } - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "GET"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "GET"); @@ -299,7 +300,7 @@ SWGPetApi::findPetsByTags(QList* tags) { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGPetApi::findPetsByTagsCallback); @@ -307,7 +308,7 @@ SWGPetApi::findPetsByTags(QList* tags) { } void -SWGPetApi::findPetsByTagsCallback(HttpRequestWorker * worker) { +SWGPetApi::findPetsByTagsCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -333,7 +334,7 @@ SWGPetApi::findPetsByTagsCallback(HttpRequestWorker * worker) { output->append(o); } - worker->deleteLater(); + worker->deleteLater(); if (worker->error_type == QNetworkReply::NoError) { emit findPetsByTagsSignal(output); @@ -352,8 +353,8 @@ SWGPetApi::getPetById(qint64 pet_id) { fullPath.replace(pet_idPathParam, stringValue(pet_id)); - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "GET"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "GET"); @@ -364,7 +365,7 @@ SWGPetApi::getPetById(qint64 pet_id) { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGPetApi::getPetByIdCallback); @@ -372,7 +373,7 @@ SWGPetApi::getPetById(qint64 pet_id) { } void -SWGPetApi::getPetByIdCallback(HttpRequestWorker * worker) { +SWGPetApi::getPetByIdCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -385,6 +386,8 @@ SWGPetApi::getPetByIdCallback(HttpRequestWorker * worker) { } + + QString json(worker->response); SWGPet* output = static_cast(create(json, QString("SWGPet"))); worker->deleteLater(); @@ -404,10 +407,11 @@ SWGPetApi::updatePet(SWGPet body) { - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "PUT"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "PUT"); + QString output = body.asJson(); input.request_body.append(output); @@ -418,7 +422,7 @@ SWGPetApi::updatePet(SWGPet body) { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGPetApi::updatePetCallback); @@ -426,7 +430,7 @@ SWGPetApi::updatePet(SWGPet body) { } void -SWGPetApi::updatePetCallback(HttpRequestWorker * worker) { +SWGPetApi::updatePetCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -457,8 +461,8 @@ SWGPetApi::updatePetWithForm(qint64 pet_id, QString* name, QString* status) { fullPath.replace(pet_idPathParam, stringValue(pet_id)); - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "POST"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "POST"); if (name != nullptr) { input.add_var("name", *name); @@ -475,7 +479,7 @@ SWGPetApi::updatePetWithForm(qint64 pet_id, QString* name, QString* status) { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGPetApi::updatePetWithFormCallback); @@ -483,7 +487,7 @@ SWGPetApi::updatePetWithForm(qint64 pet_id, QString* name, QString* status) { } void -SWGPetApi::updatePetWithFormCallback(HttpRequestWorker * worker) { +SWGPetApi::updatePetWithFormCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -514,8 +518,8 @@ SWGPetApi::uploadFile(qint64 pet_id, QString* additional_metadata, SWGHttpReques fullPath.replace(pet_idPathParam, stringValue(pet_id)); - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "POST"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "POST"); if (additional_metadata != nullptr) { input.add_var("additionalMetadata", *additional_metadata); @@ -532,7 +536,7 @@ SWGPetApi::uploadFile(qint64 pet_id, QString* additional_metadata, SWGHttpReques } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGPetApi::uploadFileCallback); @@ -540,7 +544,7 @@ SWGPetApi::uploadFile(qint64 pet_id, QString* additional_metadata, SWGHttpReques } void -SWGPetApi::uploadFileCallback(HttpRequestWorker * worker) { +SWGPetApi::uploadFileCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -553,6 +557,8 @@ SWGPetApi::uploadFileCallback(HttpRequestWorker * worker) { } + + QString json(worker->response); SWGApiResponse* output = static_cast(create(json, QString("SWGApiResponse"))); worker->deleteLater(); diff --git a/samples/client/petstore/qt5cpp/client/SWGPetApi.h b/samples/client/petstore/qt5cpp/client/SWGPetApi.h index 6313bbf1647..33c7ce0aff2 100644 --- a/samples/client/petstore/qt5cpp/client/SWGPetApi.h +++ b/samples/client/petstore/qt5cpp/client/SWGPetApi.h @@ -46,14 +46,14 @@ class SWGPetApi: public QObject { void uploadFile(qint64 pet_id, QString* additional_metadata, SWGHttpRequestInputFileElement* file); private: - void addPetCallback (HttpRequestWorker * worker); - void deletePetCallback (HttpRequestWorker * worker); - void findPetsByStatusCallback (HttpRequestWorker * worker); - void findPetsByTagsCallback (HttpRequestWorker * worker); - void getPetByIdCallback (HttpRequestWorker * worker); - void updatePetCallback (HttpRequestWorker * worker); - void updatePetWithFormCallback (HttpRequestWorker * worker); - void uploadFileCallback (HttpRequestWorker * worker); + void addPetCallback (SWGHttpRequestWorker * worker); + void deletePetCallback (SWGHttpRequestWorker * worker); + void findPetsByStatusCallback (SWGHttpRequestWorker * worker); + void findPetsByTagsCallback (SWGHttpRequestWorker * worker); + void getPetByIdCallback (SWGHttpRequestWorker * worker); + void updatePetCallback (SWGHttpRequestWorker * worker); + void updatePetWithFormCallback (SWGHttpRequestWorker * worker); + void uploadFileCallback (SWGHttpRequestWorker * worker); signals: void addPetSignal(); @@ -74,14 +74,14 @@ class SWGPetApi: public QObject { void updatePetWithFormSignalE(QNetworkReply::NetworkError error_type, QString& error_str); void uploadFileSignalE(SWGApiResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void addPetSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void deletePetSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void findPetsByStatusSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void findPetsByTagsSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void getPetByIdSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void updatePetSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void updatePetWithFormSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void uploadFileSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void addPetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void deletePetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void findPetsByStatusSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void findPetsByTagsSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void getPetByIdSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void updatePetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void updatePetWithFormSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void uploadFileSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); }; diff --git a/samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp b/samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp index 58fcf48d648..94b9f2292c3 100644 --- a/samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp @@ -37,8 +37,8 @@ SWGStoreApi::deleteOrder(QString* order_id) { fullPath.replace(order_idPathParam, stringValue(order_id)); - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "DELETE"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "DELETE"); @@ -49,7 +49,7 @@ SWGStoreApi::deleteOrder(QString* order_id) { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGStoreApi::deleteOrderCallback); @@ -57,7 +57,7 @@ SWGStoreApi::deleteOrder(QString* order_id) { } void -SWGStoreApi::deleteOrderCallback(HttpRequestWorker * worker) { +SWGStoreApi::deleteOrderCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -86,8 +86,8 @@ SWGStoreApi::getInventory() { - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "GET"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "GET"); @@ -98,7 +98,7 @@ SWGStoreApi::getInventory() { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGStoreApi::getInventoryCallback); @@ -106,7 +106,7 @@ SWGStoreApi::getInventory() { } void -SWGStoreApi::getInventoryCallback(HttpRequestWorker * worker) { +SWGStoreApi::getInventoryCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -119,7 +119,7 @@ SWGStoreApi::getInventoryCallback(HttpRequestWorker * worker) { } - QMap* output; // TODO add primitive output support + QMap* output = new QMap(); QString json(worker->response); QByteArray array (json.toStdString().c_str()); @@ -150,8 +150,8 @@ SWGStoreApi::getOrderById(qint64 order_id) { fullPath.replace(order_idPathParam, stringValue(order_id)); - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "GET"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "GET"); @@ -162,7 +162,7 @@ SWGStoreApi::getOrderById(qint64 order_id) { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGStoreApi::getOrderByIdCallback); @@ -170,7 +170,7 @@ SWGStoreApi::getOrderById(qint64 order_id) { } void -SWGStoreApi::getOrderByIdCallback(HttpRequestWorker * worker) { +SWGStoreApi::getOrderByIdCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -183,6 +183,8 @@ SWGStoreApi::getOrderByIdCallback(HttpRequestWorker * worker) { } + + QString json(worker->response); SWGOrder* output = static_cast(create(json, QString("SWGOrder"))); worker->deleteLater(); @@ -202,10 +204,11 @@ SWGStoreApi::placeOrder(SWGOrder body) { - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "POST"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "POST"); + QString output = body.asJson(); input.request_body.append(output); @@ -216,7 +219,7 @@ SWGStoreApi::placeOrder(SWGOrder body) { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGStoreApi::placeOrderCallback); @@ -224,7 +227,7 @@ SWGStoreApi::placeOrder(SWGOrder body) { } void -SWGStoreApi::placeOrderCallback(HttpRequestWorker * worker) { +SWGStoreApi::placeOrderCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -237,6 +240,8 @@ SWGStoreApi::placeOrderCallback(HttpRequestWorker * worker) { } + + QString json(worker->response); SWGOrder* output = static_cast(create(json, QString("SWGOrder"))); worker->deleteLater(); diff --git a/samples/client/petstore/qt5cpp/client/SWGStoreApi.h b/samples/client/petstore/qt5cpp/client/SWGStoreApi.h index 8bef2d38b4c..8984eb6ceae 100644 --- a/samples/client/petstore/qt5cpp/client/SWGStoreApi.h +++ b/samples/client/petstore/qt5cpp/client/SWGStoreApi.h @@ -41,10 +41,10 @@ class SWGStoreApi: public QObject { void placeOrder(SWGOrder body); private: - void deleteOrderCallback (HttpRequestWorker * worker); - void getInventoryCallback (HttpRequestWorker * worker); - void getOrderByIdCallback (HttpRequestWorker * worker); - void placeOrderCallback (HttpRequestWorker * worker); + void deleteOrderCallback (SWGHttpRequestWorker * worker); + void getInventoryCallback (SWGHttpRequestWorker * worker); + void getOrderByIdCallback (SWGHttpRequestWorker * worker); + void placeOrderCallback (SWGHttpRequestWorker * worker); signals: void deleteOrderSignal(); @@ -57,10 +57,10 @@ class SWGStoreApi: public QObject { void getOrderByIdSignalE(SWGOrder* summary, QNetworkReply::NetworkError error_type, QString& error_str); void placeOrderSignalE(SWGOrder* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void deleteOrderSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void getInventorySignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void getOrderByIdSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void placeOrderSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void deleteOrderSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void getInventorySignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void getOrderByIdSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void placeOrderSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); }; diff --git a/samples/client/petstore/qt5cpp/client/SWGTag.cpp b/samples/client/petstore/qt5cpp/client/SWGTag.cpp index febee3a6a76..2d11260cd60 100644 --- a/samples/client/petstore/qt5cpp/client/SWGTag.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGTag.cpp @@ -38,7 +38,9 @@ SWGTag::~SWGTag() { void SWGTag::init() { id = 0L; + m_id_isSet = false; name = new QString(""); + m_name_isSet = false; } void @@ -77,8 +79,12 @@ SWGTag::asJson () QJsonObject* SWGTag::asJsonObject() { QJsonObject* obj = new QJsonObject(); - obj->insert("id", QJsonValue(id)); - toJsonValue(QString("name"), name, obj, QString("QString")); + if(m_id_isSet){ + obj->insert("id", QJsonValue(id)); + } + if(name != nullptr && *name != QString("")){ + toJsonValue(QString("name"), name, obj, QString("QString")); + } return obj; } @@ -90,6 +96,7 @@ SWGTag::getId() { void SWGTag::setId(qint64 id) { this->id = id; + this->m_id_isSet = true; } QString* @@ -99,8 +106,18 @@ SWGTag::getName() { void SWGTag::setName(QString* name) { this->name = name; + this->m_name_isSet = true; } +bool +SWGTag::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_id_isSet){ isObjectUpdated = true; break;} + if(name != nullptr && *name != QString("")){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} } diff --git a/samples/client/petstore/qt5cpp/client/SWGTag.h b/samples/client/petstore/qt5cpp/client/SWGTag.h index ee562bc8665..1bddc52e312 100644 --- a/samples/client/petstore/qt5cpp/client/SWGTag.h +++ b/samples/client/petstore/qt5cpp/client/SWGTag.h @@ -48,9 +48,15 @@ class SWGTag: public SWGObject { void setName(QString* name); + virtual bool isSet() override; + private: qint64 id; + bool m_id_isSet; + QString* name; + bool m_name_isSet; + }; } diff --git a/samples/client/petstore/qt5cpp/client/SWGUser.cpp b/samples/client/petstore/qt5cpp/client/SWGUser.cpp index e915cd05a4a..4031a959b68 100644 --- a/samples/client/petstore/qt5cpp/client/SWGUser.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGUser.cpp @@ -38,13 +38,21 @@ SWGUser::~SWGUser() { void SWGUser::init() { id = 0L; + m_id_isSet = false; username = new QString(""); + m_username_isSet = false; first_name = new QString(""); + m_first_name_isSet = false; last_name = new QString(""); + m_last_name_isSet = false; email = new QString(""); + m_email_isSet = false; password = new QString(""); + m_password_isSet = false; phone = new QString(""); + m_phone_isSet = false; user_status = 0; + m_user_status_isSet = false; } void @@ -105,14 +113,30 @@ SWGUser::asJson () QJsonObject* SWGUser::asJsonObject() { QJsonObject* obj = new QJsonObject(); - obj->insert("id", QJsonValue(id)); - toJsonValue(QString("username"), username, obj, QString("QString")); - toJsonValue(QString("firstName"), first_name, obj, QString("QString")); - toJsonValue(QString("lastName"), last_name, obj, QString("QString")); - toJsonValue(QString("email"), email, obj, QString("QString")); - toJsonValue(QString("password"), password, obj, QString("QString")); - toJsonValue(QString("phone"), phone, obj, QString("QString")); - obj->insert("userStatus", QJsonValue(user_status)); + if(m_id_isSet){ + obj->insert("id", QJsonValue(id)); + } + if(username != nullptr && *username != QString("")){ + toJsonValue(QString("username"), username, obj, QString("QString")); + } + if(first_name != nullptr && *first_name != QString("")){ + toJsonValue(QString("firstName"), first_name, obj, QString("QString")); + } + if(last_name != nullptr && *last_name != QString("")){ + toJsonValue(QString("lastName"), last_name, obj, QString("QString")); + } + if(email != nullptr && *email != QString("")){ + toJsonValue(QString("email"), email, obj, QString("QString")); + } + if(password != nullptr && *password != QString("")){ + toJsonValue(QString("password"), password, obj, QString("QString")); + } + if(phone != nullptr && *phone != QString("")){ + toJsonValue(QString("phone"), phone, obj, QString("QString")); + } + if(m_user_status_isSet){ + obj->insert("userStatus", QJsonValue(user_status)); + } return obj; } @@ -124,6 +148,7 @@ SWGUser::getId() { void SWGUser::setId(qint64 id) { this->id = id; + this->m_id_isSet = true; } QString* @@ -133,6 +158,7 @@ SWGUser::getUsername() { void SWGUser::setUsername(QString* username) { this->username = username; + this->m_username_isSet = true; } QString* @@ -142,6 +168,7 @@ SWGUser::getFirstName() { void SWGUser::setFirstName(QString* first_name) { this->first_name = first_name; + this->m_first_name_isSet = true; } QString* @@ -151,6 +178,7 @@ SWGUser::getLastName() { void SWGUser::setLastName(QString* last_name) { this->last_name = last_name; + this->m_last_name_isSet = true; } QString* @@ -160,6 +188,7 @@ SWGUser::getEmail() { void SWGUser::setEmail(QString* email) { this->email = email; + this->m_email_isSet = true; } QString* @@ -169,6 +198,7 @@ SWGUser::getPassword() { void SWGUser::setPassword(QString* password) { this->password = password; + this->m_password_isSet = true; } QString* @@ -178,6 +208,7 @@ SWGUser::getPhone() { void SWGUser::setPhone(QString* phone) { this->phone = phone; + this->m_phone_isSet = true; } qint32 @@ -187,8 +218,24 @@ SWGUser::getUserStatus() { void SWGUser::setUserStatus(qint32 user_status) { this->user_status = user_status; + this->m_user_status_isSet = true; } +bool +SWGUser::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_id_isSet){ isObjectUpdated = true; break;} + if(username != nullptr && *username != QString("")){ isObjectUpdated = true; break;} + if(first_name != nullptr && *first_name != QString("")){ isObjectUpdated = true; break;} + if(last_name != nullptr && *last_name != QString("")){ isObjectUpdated = true; break;} + if(email != nullptr && *email != QString("")){ isObjectUpdated = true; break;} + if(password != nullptr && *password != QString("")){ isObjectUpdated = true; break;} + if(phone != nullptr && *phone != QString("")){ isObjectUpdated = true; break;} + if(m_user_status_isSet){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} } diff --git a/samples/client/petstore/qt5cpp/client/SWGUser.h b/samples/client/petstore/qt5cpp/client/SWGUser.h index bdd4e77a56a..c7839922539 100644 --- a/samples/client/petstore/qt5cpp/client/SWGUser.h +++ b/samples/client/petstore/qt5cpp/client/SWGUser.h @@ -66,15 +66,33 @@ class SWGUser: public SWGObject { void setUserStatus(qint32 user_status); + virtual bool isSet() override; + private: qint64 id; + bool m_id_isSet; + QString* username; + bool m_username_isSet; + QString* first_name; + bool m_first_name_isSet; + QString* last_name; + bool m_last_name_isSet; + QString* email; + bool m_email_isSet; + QString* password; + bool m_password_isSet; + QString* phone; + bool m_phone_isSet; + qint32 user_status; + bool m_user_status_isSet; + }; } diff --git a/samples/client/petstore/qt5cpp/client/SWGUserApi.cpp b/samples/client/petstore/qt5cpp/client/SWGUserApi.cpp index 44fbfe9259a..bface16c256 100644 --- a/samples/client/petstore/qt5cpp/client/SWGUserApi.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGUserApi.cpp @@ -35,10 +35,11 @@ SWGUserApi::createUser(SWGUser body) { - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "POST"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "POST"); + QString output = body.asJson(); input.request_body.append(output); @@ -49,7 +50,7 @@ SWGUserApi::createUser(SWGUser body) { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGUserApi::createUserCallback); @@ -57,7 +58,7 @@ SWGUserApi::createUser(SWGUser body) { } void -SWGUserApi::createUserCallback(HttpRequestWorker * worker) { +SWGUserApi::createUserCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -86,8 +87,8 @@ SWGUserApi::createUsersWithArrayInput(QList* body) { - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "POST"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "POST"); QJsonArray* bodyArray = new QJsonArray(); @@ -97,7 +98,7 @@ SWGUserApi::createUsersWithArrayInput(QList* body) { QByteArray bytes = doc.toJson(); input.request_body.append(bytes); - + foreach(QString key, this->defaultHeaders.keys()) { @@ -105,7 +106,7 @@ SWGUserApi::createUsersWithArrayInput(QList* body) { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGUserApi::createUsersWithArrayInputCallback); @@ -113,7 +114,7 @@ SWGUserApi::createUsersWithArrayInput(QList* body) { } void -SWGUserApi::createUsersWithArrayInputCallback(HttpRequestWorker * worker) { +SWGUserApi::createUsersWithArrayInputCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -142,8 +143,8 @@ SWGUserApi::createUsersWithListInput(QList* body) { - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "POST"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "POST"); QJsonArray* bodyArray = new QJsonArray(); @@ -153,7 +154,7 @@ SWGUserApi::createUsersWithListInput(QList* body) { QByteArray bytes = doc.toJson(); input.request_body.append(bytes); - + foreach(QString key, this->defaultHeaders.keys()) { @@ -161,7 +162,7 @@ SWGUserApi::createUsersWithListInput(QList* body) { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGUserApi::createUsersWithListInputCallback); @@ -169,7 +170,7 @@ SWGUserApi::createUsersWithListInput(QList* body) { } void -SWGUserApi::createUsersWithListInputCallback(HttpRequestWorker * worker) { +SWGUserApi::createUsersWithListInputCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -200,8 +201,8 @@ SWGUserApi::deleteUser(QString* username) { fullPath.replace(usernamePathParam, stringValue(username)); - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "DELETE"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "DELETE"); @@ -212,7 +213,7 @@ SWGUserApi::deleteUser(QString* username) { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGUserApi::deleteUserCallback); @@ -220,7 +221,7 @@ SWGUserApi::deleteUser(QString* username) { } void -SWGUserApi::deleteUserCallback(HttpRequestWorker * worker) { +SWGUserApi::deleteUserCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -251,8 +252,8 @@ SWGUserApi::getUserByName(QString* username) { fullPath.replace(usernamePathParam, stringValue(username)); - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "GET"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "GET"); @@ -263,7 +264,7 @@ SWGUserApi::getUserByName(QString* username) { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGUserApi::getUserByNameCallback); @@ -271,7 +272,7 @@ SWGUserApi::getUserByName(QString* username) { } void -SWGUserApi::getUserByNameCallback(HttpRequestWorker * worker) { +SWGUserApi::getUserByNameCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -284,6 +285,8 @@ SWGUserApi::getUserByNameCallback(HttpRequestWorker * worker) { } + + QString json(worker->response); SWGUser* output = static_cast(create(json, QString("SWGUser"))); worker->deleteLater(); @@ -319,8 +322,8 @@ SWGUserApi::loginUser(QString* username, QString* password) { .append(QUrl::toPercentEncoding(stringValue(password))); - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "GET"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "GET"); @@ -331,7 +334,7 @@ SWGUserApi::loginUser(QString* username, QString* password) { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGUserApi::loginUserCallback); @@ -339,7 +342,7 @@ SWGUserApi::loginUser(QString* username, QString* password) { } void -SWGUserApi::loginUserCallback(HttpRequestWorker * worker) { +SWGUserApi::loginUserCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -352,6 +355,8 @@ SWGUserApi::loginUserCallback(HttpRequestWorker * worker) { } + + QString json(worker->response); QString* output = static_cast(create(json, QString("QString"))); worker->deleteLater(); @@ -371,8 +376,8 @@ SWGUserApi::logoutUser() { - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "GET"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "GET"); @@ -383,7 +388,7 @@ SWGUserApi::logoutUser() { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGUserApi::logoutUserCallback); @@ -391,7 +396,7 @@ SWGUserApi::logoutUser() { } void -SWGUserApi::logoutUserCallback(HttpRequestWorker * worker) { +SWGUserApi::logoutUserCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; @@ -422,10 +427,11 @@ SWGUserApi::updateUser(QString* username, SWGUser body) { fullPath.replace(usernamePathParam, stringValue(username)); - HttpRequestWorker *worker = new HttpRequestWorker(); - HttpRequestInput input(fullPath, "PUT"); + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "PUT"); + QString output = body.asJson(); input.request_body.append(output); @@ -436,7 +442,7 @@ SWGUserApi::updateUser(QString* username, SWGUser body) { } connect(worker, - &HttpRequestWorker::on_execution_finished, + &SWGHttpRequestWorker::on_execution_finished, this, &SWGUserApi::updateUserCallback); @@ -444,7 +450,7 @@ SWGUserApi::updateUser(QString* username, SWGUser body) { } void -SWGUserApi::updateUserCallback(HttpRequestWorker * worker) { +SWGUserApi::updateUserCallback(SWGHttpRequestWorker * worker) { QString msg; QString error_str = worker->error_str; QNetworkReply::NetworkError error_type = worker->error_type; diff --git a/samples/client/petstore/qt5cpp/client/SWGUserApi.h b/samples/client/petstore/qt5cpp/client/SWGUserApi.h index 3d5fff70ec5..c24d062361b 100644 --- a/samples/client/petstore/qt5cpp/client/SWGUserApi.h +++ b/samples/client/petstore/qt5cpp/client/SWGUserApi.h @@ -45,14 +45,14 @@ class SWGUserApi: public QObject { void updateUser(QString* username, SWGUser body); private: - void createUserCallback (HttpRequestWorker * worker); - void createUsersWithArrayInputCallback (HttpRequestWorker * worker); - void createUsersWithListInputCallback (HttpRequestWorker * worker); - void deleteUserCallback (HttpRequestWorker * worker); - void getUserByNameCallback (HttpRequestWorker * worker); - void loginUserCallback (HttpRequestWorker * worker); - void logoutUserCallback (HttpRequestWorker * worker); - void updateUserCallback (HttpRequestWorker * worker); + void createUserCallback (SWGHttpRequestWorker * worker); + void createUsersWithArrayInputCallback (SWGHttpRequestWorker * worker); + void createUsersWithListInputCallback (SWGHttpRequestWorker * worker); + void deleteUserCallback (SWGHttpRequestWorker * worker); + void getUserByNameCallback (SWGHttpRequestWorker * worker); + void loginUserCallback (SWGHttpRequestWorker * worker); + void logoutUserCallback (SWGHttpRequestWorker * worker); + void updateUserCallback (SWGHttpRequestWorker * worker); signals: void createUserSignal(); @@ -73,14 +73,14 @@ class SWGUserApi: public QObject { void logoutUserSignalE(QNetworkReply::NetworkError error_type, QString& error_str); void updateUserSignalE(QNetworkReply::NetworkError error_type, QString& error_str); - void createUserSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void createUsersWithArrayInputSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void createUsersWithListInputSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void deleteUserSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void getUserByNameSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void loginUserSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void logoutUserSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void updateUserSignalEFull(HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void createUserSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void createUsersWithArrayInputSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void createUsersWithListInputSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void deleteUserSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void getUserByNameSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void loginUserSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void logoutUserSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void updateUserSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); }; From ea3d039717705145c42a85dfee7efaea92eb2b7e Mon Sep 17 00:00:00 2001 From: westse Date: Sun, 7 Jan 2018 06:47:25 -0700 Subject: [PATCH 21/65] [scala] make stripPackage name configurable via property (#7226) * Make stripPackage name configurable via property - Needed because some APIs (e.g. Kubernetes) include version information in packages. Stripping causes many generated API and model classes to be named the same, causing a last-one-wins situation which is unacceptable. * Per PR review, ensure stripPackageName Boolean property and log warning --- .../main/java/io/swagger/codegen/CodegenConstants.java | 3 +++ .../codegen/languages/AbstractScalaCodegen.java | 10 +++++++++- .../swagger/codegen/languages/ScalaClientCodegen.java | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java index 379102f417a..8fb3f3b1a79 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java @@ -218,4 +218,7 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, public static final String REMOVE_OPERATION_ID_PREFIX = "removeOperationIdPrefix"; public static final String REMOVE_OPERATION_ID_PREFIX_DESC = "Remove prefix of operationId, e.g. config_getId => getId"; + + public static final String STRIP_PACKAGE_NAME = "stripPackageName"; + public static final String STRIP_PACKAGE_NAME_DESC = "Whether to strip leading dot-separated packages from generated model classes"; } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractScalaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractScalaCodegen.java index 3ef8b2e06bb..cf45b77527f 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractScalaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractScalaCodegen.java @@ -27,6 +27,7 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen { protected String modelPropertyNaming = "camelCase"; protected String invokerPackage = "io.swagger.client"; protected String sourceFolder = "src/main/scala"; + protected boolean stripPackageName = true; public AbstractScalaCodegen() { super(); @@ -57,6 +58,13 @@ public void processOpts() { if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) { this.setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER)); } + if (additionalProperties.containsKey(CodegenConstants.STRIP_PACKAGE_NAME) && + "false".equalsIgnoreCase(additionalProperties.get(CodegenConstants.STRIP_PACKAGE_NAME).toString())) { + this.stripPackageName = false; + additionalProperties.put(CodegenConstants.STRIP_PACKAGE_NAME, false); + LOGGER.warn("stripPackageName=false. Compilation errors may occur if API type names clash with types " + + "in the default imports"); + } } public void setSourceFolder(String sourceFolder) { @@ -197,7 +205,7 @@ protected String formatIdentifier(String name, boolean capitalized) { } protected String stripPackageName(String input) { - if (StringUtils.isEmpty(input) || input.lastIndexOf(".") < 0) + if (!stripPackageName || StringUtils.isEmpty(input) || input.lastIndexOf(".") < 0) return input; int lastIndexOfDot = input.lastIndexOf("."); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaClientCodegen.java index 14f8f4e182a..f28a3491f22 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaClientCodegen.java @@ -50,6 +50,7 @@ public ScalaClientCodegen() { additionalProperties.put("authScheme", authScheme); additionalProperties.put("authPreemptive", authPreemptive); additionalProperties.put("clientName", clientName); + additionalProperties.put(CodegenConstants.STRIP_PACKAGE_NAME, stripPackageName); supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml")); supportingFiles.add(new SupportingFile("apiInvoker.mustache", From 9a284776d852d82987280cac45281682c393915c Mon Sep 17 00:00:00 2001 From: craffael Date: Sun, 7 Jan 2018 16:10:32 +0100 Subject: [PATCH 22/65] [Java] Fix serialization of the discriminator field when using GSON (#7075) * set discriminator on object construction... * regenerate all java samples * run bin/java-msf4j-petstore-server.sh * remove extra newline --- .../src/main/resources/Java/pojo.mustache | 7 + .../java/io/swagger/client/api/PetApi.java | 6 + .../java/io/swagger/client/api/StoreApi.java | 3 + .../java/io/swagger/client/api/UserApi.java | 5 + .../petstore/java/jersey2-java6/pom.xml | 511 +++++++++--------- .../petstore/java/jersey2-java8/pom.xml | 475 ++++++++-------- samples/client/petstore/java/jersey2/pom.xml | 487 ++++++++--------- samples/client/petstore/java/resteasy/pom.xml | 399 +++++++------- .../java/resttemplate-withXml/pom.xml | 484 ++++++++--------- .../client/petstore/java/resttemplate/pom.xml | 472 ++++++++-------- samples/client/petstore/java/retrofit/pom.xml | 444 ++++++++------- .../petstore/java/retrofit2-play24/pom.xml | 509 +++++++++-------- .../src/main/swagger/swagger.yaml | 8 +- .../conf/routes | 90 +-- 14 files changed, 1879 insertions(+), 2021 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/pojo.mustache b/modules/swagger-codegen/src/main/resources/Java/pojo.mustache index fa0a84b2c65..a2929417b09 100644 --- a/modules/swagger-codegen/src/main/resources/Java/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/pojo.mustache @@ -67,6 +67,13 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela {{/isContainer}} {{/vars}} + {{#gson}} + {{#discriminator}} + public {{classname}}() { + this.{{discriminator}} = this.getClass().getSimpleName(); + } + {{/discriminator}} + {{/gson}} {{#vars}} {{^isReadOnly}} public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java index 70fbb3b6710..5a6813c6198 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java @@ -37,6 +37,7 @@ public interface PetApi extends ApiClient.Api { */ @RequestLine("DELETE /pet/{petId}") @Headers({ + "Content-Type: application/json", "Accept: application/json", "api_key: {apiKey}" }) @@ -50,6 +51,7 @@ public interface PetApi extends ApiClient.Api { */ @RequestLine("GET /pet/findByStatus?status={status}") @Headers({ + "Content-Type: application/json", "Accept: application/json", }) List findPetsByStatus(@Param("status") List status); @@ -71,6 +73,7 @@ public interface PetApi extends ApiClient.Api { */ @RequestLine("GET /pet/findByStatus?status={status}") @Headers({ + "Content-Type: application/json", "Accept: application/json", }) List findPetsByStatus(@QueryMap(encoded=true) Map queryParams); @@ -94,6 +97,7 @@ public FindPetsByStatusQueryParams status(final List value) { */ @RequestLine("GET /pet/findByTags?tags={tags}") @Headers({ + "Content-Type: application/json", "Accept: application/json", }) List findPetsByTags(@Param("tags") List tags); @@ -115,6 +119,7 @@ public FindPetsByStatusQueryParams status(final List value) { */ @RequestLine("GET /pet/findByTags?tags={tags}") @Headers({ + "Content-Type: application/json", "Accept: application/json", }) List findPetsByTags(@QueryMap(encoded=true) Map queryParams); @@ -138,6 +143,7 @@ public FindPetsByTagsQueryParams tags(final List value) { */ @RequestLine("GET /pet/{petId}") @Headers({ + "Content-Type: application/json", "Accept: application/json", }) Pet getPetById(@Param("petId") Long petId); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java index 42aaf047b73..1ad8111d3d6 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/StoreApi.java @@ -22,6 +22,7 @@ public interface StoreApi extends ApiClient.Api { */ @RequestLine("DELETE /store/order/{orderId}") @Headers({ + "Content-Type: application/json", "Accept: application/json", }) void deleteOrder(@Param("orderId") String orderId); @@ -33,6 +34,7 @@ public interface StoreApi extends ApiClient.Api { */ @RequestLine("GET /store/inventory") @Headers({ + "Content-Type: application/json", "Accept: application/json", }) Map getInventory(); @@ -45,6 +47,7 @@ public interface StoreApi extends ApiClient.Api { */ @RequestLine("GET /store/order/{orderId}") @Headers({ + "Content-Type: application/json", "Accept: application/json", }) Order getOrderById(@Param("orderId") Long orderId); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java index 3a6c3288195..e85fca41f8b 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java @@ -58,6 +58,7 @@ public interface UserApi extends ApiClient.Api { */ @RequestLine("DELETE /user/{username}") @Headers({ + "Content-Type: application/json", "Accept: application/json", }) void deleteUser(@Param("username") String username); @@ -70,6 +71,7 @@ public interface UserApi extends ApiClient.Api { */ @RequestLine("GET /user/{username}") @Headers({ + "Content-Type: application/json", "Accept: application/json", }) User getUserByName(@Param("username") String username); @@ -83,6 +85,7 @@ public interface UserApi extends ApiClient.Api { */ @RequestLine("GET /user/login?username={username}&password={password}") @Headers({ + "Content-Type: application/json", "Accept: application/json", }) String loginUser(@Param("username") String username, @Param("password") String password); @@ -105,6 +108,7 @@ public interface UserApi extends ApiClient.Api { */ @RequestLine("GET /user/login?username={username}&password={password}") @Headers({ + "Content-Type: application/json", "Accept: application/json", }) String loginUser(@QueryMap(encoded=true) Map queryParams); @@ -130,6 +134,7 @@ public LoginUserQueryParams password(final String value) { */ @RequestLine("GET /user/logout") @Headers({ + "Content-Type: application/json", "Accept: application/json", }) void logoutUser(); diff --git a/samples/client/petstore/java/jersey2-java6/pom.xml b/samples/client/petstore/java/jersey2-java6/pom.xml index e77db066489..722fac22117 100644 --- a/samples/client/petstore/java/jersey2-java6/pom.xml +++ b/samples/client/petstore/java/jersey2-java6/pom.xml @@ -1,278 +1,257 @@ - 4.0.0 - io.swagger - swagger-petstore-jersey2-java6 - jar - swagger-petstore-jersey2-java6 - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-petstore-jersey2-java6 + jar + swagger-petstore-jersey2-java6 + 1.0.0 + https://github.com/swagger-api/swagger-codegen + Swagger Java + + scm:git:git@github.com:swagger-api/swagger-codegen.git + scm:git:git@github.com:swagger-api/swagger-codegen.git https://github.com/swagger-api/swagger-codegen - Swagger Java - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - + + + 2.2.0 + - - - Unlicense - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - + + + Unlicense + http://www.apache.org/licenses/LICENSE-2.0.html + repo + + - - - Swagger - apiteam@swagger.io - Swagger - http://swagger.io - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - - org.apache.maven.plugins - maven-jar-plugin - 2.6 - - - - jar - test-jar - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + - - - io.swagger - swagger-annotations - ${swagger-core-version} - + + + io.swagger + swagger-annotations + ${swagger-core-version} + - - - org.glassfish.jersey.core - jersey-client - ${jersey-version} - - - org.glassfish.jersey.media - jersey-media-multipart - ${jersey-version} - - - org.glassfish.jersey.media - jersey-media-json-jackson - ${jersey-version} - + + + org.glassfish.jersey.core + jersey-client + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey-version} + - - - com.fasterxml.jackson.core - jackson-core - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-version} - - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-version} - - - - com.brsanthu - migbase64 - 2.2 - - - org.apache.commons - commons-lang3 - ${commons_lang3_version} - - - commons-io - commons-io - ${commons_io_version} - - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.15 - 2.6 - 2.5 - 3.6 - 2.6.4 - 1.0.0 - 4.12 - + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-version} + + + + com.brsanthu + migbase64 + 2.2 + + + org.apache.commons + commons-lang3 + ${commons_lang3_version} + + + commons-io + commons-io + ${commons_io_version} + + + + junit + junit + ${junit-version} + test + + + + 1.5.15 + 2.6 + 2.5 + 3.6 + 2.6.4 + 1.0.0 + 4.12 + diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index 846832f4461..2e0dc20ad8f 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -1,260 +1,239 @@ - 4.0.0 - io.swagger - swagger-petstore-jersey2 - jar - swagger-petstore-jersey2 - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-petstore-jersey2 + jar + swagger-petstore-jersey2 + 1.0.0 + https://github.com/swagger-api/swagger-codegen + Swagger Java + + scm:git:git@github.com:swagger-api/swagger-codegen.git + scm:git:git@github.com:swagger-api/swagger-codegen.git https://github.com/swagger-api/swagger-codegen - Swagger Java - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - + + + 2.2.0 + - - - Unlicense - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - + + + Unlicense + http://www.apache.org/licenses/LICENSE-2.0.html + repo + + - - - Swagger - apiteam@swagger.io - Swagger - http://swagger.io - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - - org.apache.maven.plugins - maven-jar-plugin - 2.6 - - - - jar - test-jar - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + - - - io.swagger - swagger-annotations - ${swagger-core-version} - + + + io.swagger + swagger-annotations + ${swagger-core-version} + - - - org.glassfish.jersey.core - jersey-client - ${jersey-version} - - - org.glassfish.jersey.media - jersey-media-multipart - ${jersey-version} - - - org.glassfish.jersey.media - jersey-media-json-jackson - ${jersey-version} - + + + org.glassfish.jersey.core + jersey-client + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey-version} + - - - com.fasterxml.jackson.core - jackson-core - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-version} - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.15 - 2.25.1 - 2.7.5 - 1.0.0 - 4.12 - + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + + junit + junit + ${junit-version} + test + + + + 1.5.15 + 2.25.1 + 2.7.5 + 1.0.0 + 4.12 + diff --git a/samples/client/petstore/java/jersey2/pom.xml b/samples/client/petstore/java/jersey2/pom.xml index 7528ca32ec5..3f5bfd600cd 100644 --- a/samples/client/petstore/java/jersey2/pom.xml +++ b/samples/client/petstore/java/jersey2/pom.xml @@ -1,266 +1,245 @@ - 4.0.0 - io.swagger - swagger-petstore-jersey2 - jar - swagger-petstore-jersey2 - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-petstore-jersey2 + jar + swagger-petstore-jersey2 + 1.0.0 + https://github.com/swagger-api/swagger-codegen + Swagger Java + + scm:git:git@github.com:swagger-api/swagger-codegen.git + scm:git:git@github.com:swagger-api/swagger-codegen.git https://github.com/swagger-api/swagger-codegen - Swagger Java - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - + + + 2.2.0 + - - - Unlicense - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - + + + Unlicense + http://www.apache.org/licenses/LICENSE-2.0.html + repo + + - - - Swagger - apiteam@swagger.io - Swagger - http://swagger.io - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - - org.apache.maven.plugins - maven-jar-plugin - 2.6 - - - - jar - test-jar - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + - - - io.swagger - swagger-annotations - ${swagger-core-version} - + + + io.swagger + swagger-annotations + ${swagger-core-version} + - - - org.glassfish.jersey.core - jersey-client - ${jersey-version} - - - org.glassfish.jersey.media - jersey-media-multipart - ${jersey-version} - - - org.glassfish.jersey.media - jersey-media-json-jackson - ${jersey-version} - + + + org.glassfish.jersey.core + jersey-client + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey-version} + - - - com.fasterxml.jackson.core - jackson-core - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-version} - - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-version} - - - - com.brsanthu - migbase64 - 2.2 - - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.15 - 2.25.1 - 2.6.4 - 1.0.0 - 4.12 - + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-version} + + + + com.brsanthu + migbase64 + 2.2 + + + + junit + junit + ${junit-version} + test + + + + 1.5.15 + 2.25.1 + 2.6.4 + 1.0.0 + 4.12 + diff --git a/samples/client/petstore/java/resteasy/pom.xml b/samples/client/petstore/java/resteasy/pom.xml index c23663bcfc6..192abc5c553 100644 --- a/samples/client/petstore/java/resteasy/pom.xml +++ b/samples/client/petstore/java/resteasy/pom.xml @@ -1,217 +1,196 @@ - 4.0.0 - io.swagger - swagger-petstore-resteasy - jar - swagger-petstore-resteasy - 1.0.0 - - scm:git:git@github.com:swagger-api/swagger-mustache.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-petstore-resteasy + jar + swagger-petstore-resteasy + 1.0.0 + + scm:git:git@github.com:swagger-api/swagger-mustache.git + scm:git:git@github.com:swagger-api/swagger-codegen.git + https://github.com/swagger-api/swagger-codegen + + + 2.2.0 + - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - - org.apache.maven.plugins - maven-jar-plugin - 2.6 - - - - jar - test-jar - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.5.1 - - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - - org.jboss.resteasy - resteasy-client - ${resteasy-version} - - - org.jboss.resteasy - resteasy-multipart-provider - ${resteasy-version} - - - - com.fasterxml.jackson.core - jackson-core - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-version} - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - - - joda-time - joda-time - ${jodatime-version} - + + org.codehaus.mojo + build-helper-maven-plugin + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.5.1 + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + + org.jboss.resteasy + resteasy-client + ${resteasy-version} + + + org.jboss.resteasy + resteasy-multipart-provider + ${resteasy-version} + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + joda-time + joda-time + ${jodatime-version} + - - - com.brsanthu - migbase64 - 2.2 - + + + com.brsanthu + migbase64 + 2.2 + - - org.jboss.resteasy - resteasy-jackson2-provider - 3.1.3.Final - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-version} - - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.15 - 3.1.3.Final - 2.6.4 - 2.9.9 - 1.0.0 - 4.12 - + + org.jboss.resteasy + resteasy-jackson2-provider + 3.1.3.Final + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-version} + + + + junit + junit + ${junit-version} + test + + + + 1.5.15 + 3.1.3.Final + 2.6.4 + 2.9.9 + 1.0.0 + 4.12 + diff --git a/samples/client/petstore/java/resttemplate-withXml/pom.xml b/samples/client/petstore/java/resttemplate-withXml/pom.xml index ae6f86b4665..2e23d7b67b7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/pom.xml +++ b/samples/client/petstore/java/resttemplate-withXml/pom.xml @@ -1,266 +1,246 @@ - 4.0.0 - io.swagger - swagger-pestore-resttemplate-withxml - jar - swagger-pestore-resttemplate-withxml - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-pestore-resttemplate-withxml + jar + swagger-pestore-resttemplate-withxml + 1.0.0 + https://github.com/swagger-api/swagger-codegen + Swagger Java + + scm:git:git@github.com:swagger-api/swagger-codegen.git + scm:git:git@github.com:swagger-api/swagger-codegen.git https://github.com/swagger-api/swagger-codegen - Swagger Java - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - + + + 2.2.0 + - - - Unlicense - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - + + + Unlicense + http://www.apache.org/licenses/LICENSE-2.0.html + repo + + - - - Swagger - apiteam@swagger.io - Swagger - http://swagger.io - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - org.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + - - - io.swagger - swagger-annotations - ${swagger-annotations-version} - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + - - - org.springframework - spring-web - ${spring-web-version} - + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + - - - com.fasterxml.jackson.core - jackson-core - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-version} - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - ${jackson-version} - + + + org.springframework + spring-web + ${spring-web-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - ${jackson-version} - + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-threetenbp-version} + - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.15 - 4.3.9.RELEASE - 2.8.9 - 2.6.4 - 1.0.0 - 4.12 - + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.5.15 + 4.3.9.RELEASE + 2.8.9 + 2.6.4 + 1.0.0 + 4.12 + diff --git a/samples/client/petstore/java/resttemplate/pom.xml b/samples/client/petstore/java/resttemplate/pom.xml index e845be65bde..0eb7db54a10 100644 --- a/samples/client/petstore/java/resttemplate/pom.xml +++ b/samples/client/petstore/java/resttemplate/pom.xml @@ -1,258 +1,238 @@ - 4.0.0 - io.swagger - swagger-petstore-resttemplate - jar - swagger-petstore-resttemplate - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-petstore-resttemplate + jar + swagger-petstore-resttemplate + 1.0.0 + https://github.com/swagger-api/swagger-codegen + Swagger Java + + scm:git:git@github.com:swagger-api/swagger-codegen.git + scm:git:git@github.com:swagger-api/swagger-codegen.git https://github.com/swagger-api/swagger-codegen - Swagger Java - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - + + + 2.2.0 + - - - Unlicense - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - + + + Unlicense + http://www.apache.org/licenses/LICENSE-2.0.html + repo + + - - - Swagger - apiteam@swagger.io - Swagger - http://swagger.io - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - org.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + - - - io.swagger - swagger-annotations - ${swagger-annotations-version} - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + - - - org.springframework - spring-web - ${spring-web-version} - + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + - - - com.fasterxml.jackson.core - jackson-core - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-version} - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - ${jackson-version} - - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - + + + org.springframework + spring-web + ${spring-web-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-threetenbp-version} + - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.15 - 4.3.9.RELEASE - 2.8.9 - 2.6.4 - 1.0.0 - 4.12 - + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.5.15 + 4.3.9.RELEASE + 2.8.9 + 2.6.4 + 1.0.0 + 4.12 + diff --git a/samples/client/petstore/java/retrofit/pom.xml b/samples/client/petstore/java/retrofit/pom.xml index 5b122647ef1..ffb62b3f28f 100644 --- a/samples/client/petstore/java/retrofit/pom.xml +++ b/samples/client/petstore/java/retrofit/pom.xml @@ -1,244 +1,224 @@ - 4.0.0 - io.swagger - swagger-petstore-retrofit - jar - swagger-petstore-retrofit - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-petstore-retrofit + jar + swagger-petstore-retrofit + 1.0.0 + https://github.com/swagger-api/swagger-codegen + Swagger Java + + scm:git:git@github.com:swagger-api/swagger-codegen.git + scm:git:git@github.com:swagger-api/swagger-codegen.git https://github.com/swagger-api/swagger-codegen - Swagger Java - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - + + + 2.2.0 + - - - Unlicense - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - + + + Unlicense + http://www.apache.org/licenses/LICENSE-2.0.html + repo + + - - - Swagger - apiteam@swagger.io - Swagger - http://swagger.io - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - com.squareup.retrofit - retrofit - ${retrofit-version} - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} - - - com.squareup.okhttp - okhttp - ${okhttp-version} - - - joda-time - joda-time - ${jodatime-version} - + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + com.squareup.retrofit + retrofit + ${retrofit-version} + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + ${oltu-version} + + + com.squareup.okhttp + okhttp + ${okhttp-version} + + + joda-time + joda-time + ${jodatime-version} + - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.15 - 1.9.0 - 2.7.5 - 2.9.9 - 1.0.1 - 1.0.0 - 4.12 - + + + junit + junit + ${junit-version} + test + + + + 1.5.15 + 1.9.0 + 2.7.5 + 2.9.9 + 1.0.1 + 1.0.0 + 4.12 + diff --git a/samples/client/petstore/java/retrofit2-play24/pom.xml b/samples/client/petstore/java/retrofit2-play24/pom.xml index 3841cd6f1e1..0156fa1d293 100644 --- a/samples/client/petstore/java/retrofit2-play24/pom.xml +++ b/samples/client/petstore/java/retrofit2-play24/pom.xml @@ -1,276 +1,257 @@ - 4.0.0 - io.swagger - swagger-java-client - jar - swagger-java-client - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-java-client + jar + swagger-java-client + 1.0.0 + https://github.com/swagger-api/swagger-codegen + Swagger Java + + scm:git:git@github.com:swagger-api/swagger-codegen.git + scm:git:git@github.com:swagger-api/swagger-codegen.git https://github.com/swagger-api/swagger-codegen - Swagger Java - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - + + + 2.2.0 + - - - Unlicense - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - + + + Unlicense + http://www.apache.org/licenses/LICENSE-2.0.html + repo + + - - - Swagger - apiteam@swagger.io - Swagger - http://swagger.io - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - org.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - com.squareup.retrofit2 - converter-gson - ${retrofit-version} - - - com.squareup.retrofit2 - retrofit - ${retrofit-version} - - - com.squareup.retrofit2 - converter-scalars - ${retrofit-version} - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} - - - io.gsonfire - gson-fire - ${gson-fire-version} - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + - - - com.squareup.retrofit2 - converter-jackson - ${retrofit-version} - - - com.fasterxml.jackson.core - jackson-core - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-version} - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - - com.typesafe.play - play-java-ws_2.11 - ${play-version} - + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + com.squareup.retrofit2 + converter-gson + ${retrofit-version} + + + com.squareup.retrofit2 + retrofit + ${retrofit-version} + + + com.squareup.retrofit2 + converter-scalars + ${retrofit-version} + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + ${oltu-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + + com.squareup.retrofit2 + converter-jackson + ${retrofit-version} + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + com.typesafe.play + play-java-ws_2.11 + ${play-version} + + - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.8 - ${java.version} - ${java.version} - 1.8.0 - 1.5.15 - 2.6.6 - 2.4.11 - 2.3.0 - 1.0.1 - 4.12 - + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.8 + ${java.version} + ${java.version} + 1.8.0 + 1.5.15 + 2.6.6 + 2.4.11 + 2.3.0 + 1.0.1 + 4.12 + diff --git a/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml b/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml index ef4896bab5e..f584c04d993 100644 --- a/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml +++ b/samples/server/petstore/java-inflector/src/main/swagger/swagger.yaml @@ -109,11 +109,11 @@ paths: type: "array" items: type: "string" - default: "available" enum: - "available" - "pending" - "sold" + default: "available" collectionFormat: "csv" responses: 200: @@ -650,10 +650,10 @@ paths: type: "array" items: type: "string" - default: "$" enum: - ">" - "$" + default: "$" - name: "enum_form_string" in: "formData" description: "Form parameter enum test (string)" @@ -671,10 +671,10 @@ paths: type: "array" items: type: "string" - default: "$" enum: - ">" - "$" + default: "$" - name: "enum_header_string" in: "header" description: "Header parameter enum test (string)" @@ -692,10 +692,10 @@ paths: type: "array" items: type: "string" - default: "$" enum: - ">" - "$" + default: "$" - name: "enum_query_string" in: "query" description: "Query parameter enum test (string)" diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes b/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes index 6a342645b5d..098144c43e0 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes +++ b/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes @@ -2,51 +2,51 @@ # This file defines all application routes (Higher priority routes first) # ~~~~ -GET /api controllers.ApiDocController.api - - -#Functions for AnotherFake API -PATCH /v2/another-fake/dummy controllers.AnotherFakeApiController.testSpecialTags() - -#Functions for Fake API -POST /v2/fake/outer/boolean controllers.FakeApiController.fakeOuterBooleanSerialize() -POST /v2/fake/outer/composite controllers.FakeApiController.fakeOuterCompositeSerialize() -POST /v2/fake/outer/number controllers.FakeApiController.fakeOuterNumberSerialize() -POST /v2/fake/outer/string controllers.FakeApiController.fakeOuterStringSerialize() -PATCH /v2/fake controllers.FakeApiController.testClientModel() -POST /v2/fake controllers.FakeApiController.testEndpointParameters() -GET /v2/fake controllers.FakeApiController.testEnumParameters() -POST /v2/fake/inline-additionalProperties controllers.FakeApiController.testInlineAdditionalProperties() -GET /v2/fake/jsonFormData controllers.FakeApiController.testJsonFormData() - -#Functions for FakeClassnameTags123 API -PATCH /v2/fake_classname_test controllers.FakeClassnameTags123ApiController.testClassname() - -#Functions for Pet API -POST /v2/pet controllers.PetApiController.addPet() -DELETE /v2/pet/:petId controllers.PetApiController.deletePet(petId: Long) -GET /v2/pet/findByStatus controllers.PetApiController.findPetsByStatus() -GET /v2/pet/findByTags controllers.PetApiController.findPetsByTags() -GET /v2/pet/:petId controllers.PetApiController.getPetById(petId: Long) -PUT /v2/pet controllers.PetApiController.updatePet() -POST /v2/pet/:petId controllers.PetApiController.updatePetWithForm(petId: Long) -POST /v2/pet/:petId/uploadImage controllers.PetApiController.uploadFile(petId: Long) - -#Functions for Store API -DELETE /v2/store/order/:orderId controllers.StoreApiController.deleteOrder(orderId: String) -GET /v2/store/inventory controllers.StoreApiController.getInventory() -GET /v2/store/order/:orderId controllers.StoreApiController.getOrderById(orderId: Long) -POST /v2/store/order controllers.StoreApiController.placeOrder() - -#Functions for User API -POST /v2/user controllers.UserApiController.createUser() -POST /v2/user/createWithArray controllers.UserApiController.createUsersWithArrayInput() -POST /v2/user/createWithList controllers.UserApiController.createUsersWithListInput() -DELETE /v2/user/:username controllers.UserApiController.deleteUser(username: String) -GET /v2/user/:username controllers.UserApiController.getUserByName(username: String) -GET /v2/user/login controllers.UserApiController.loginUser() -GET /v2/user/logout controllers.UserApiController.logoutUser() -PUT /v2/user/:username controllers.UserApiController.updateUser(username: String) + GET /api controllers.ApiDocController.api + + + #Functions for AnotherFake API + PATCH /v2/another-fake/dummy controllers.AnotherFakeApiController.testSpecialTags() + + #Functions for Fake API + POST /v2/fake/outer/boolean controllers.FakeApiController.fakeOuterBooleanSerialize() + POST /v2/fake/outer/composite controllers.FakeApiController.fakeOuterCompositeSerialize() + POST /v2/fake/outer/number controllers.FakeApiController.fakeOuterNumberSerialize() + POST /v2/fake/outer/string controllers.FakeApiController.fakeOuterStringSerialize() + PATCH /v2/fake controllers.FakeApiController.testClientModel() + POST /v2/fake controllers.FakeApiController.testEndpointParameters() + GET /v2/fake controllers.FakeApiController.testEnumParameters() + POST /v2/fake/inline-additionalProperties controllers.FakeApiController.testInlineAdditionalProperties() + GET /v2/fake/jsonFormData controllers.FakeApiController.testJsonFormData() + + #Functions for FakeClassnameTags123 API + PATCH /v2/fake_classname_test controllers.FakeClassnameTags123ApiController.testClassname() + + #Functions for Pet API + POST /v2/pet controllers.PetApiController.addPet() + DELETE /v2/pet/:petId controllers.PetApiController.deletePet(petId: Long) + GET /v2/pet/findByStatus controllers.PetApiController.findPetsByStatus() + GET /v2/pet/findByTags controllers.PetApiController.findPetsByTags() + GET /v2/pet/:petId controllers.PetApiController.getPetById(petId: Long) + PUT /v2/pet controllers.PetApiController.updatePet() + POST /v2/pet/:petId controllers.PetApiController.updatePetWithForm(petId: Long) + POST /v2/pet/:petId/uploadImage controllers.PetApiController.uploadFile(petId: Long) + + #Functions for Store API + DELETE /v2/store/order/:orderId controllers.StoreApiController.deleteOrder(orderId: String) + GET /v2/store/inventory controllers.StoreApiController.getInventory() + GET /v2/store/order/:orderId controllers.StoreApiController.getOrderById(orderId: Long) + POST /v2/store/order controllers.StoreApiController.placeOrder() + + #Functions for User API + POST /v2/user controllers.UserApiController.createUser() + POST /v2/user/createWithArray controllers.UserApiController.createUsersWithArrayInput() + POST /v2/user/createWithList controllers.UserApiController.createUsersWithListInput() + DELETE /v2/user/:username controllers.UserApiController.deleteUser(username: String) + GET /v2/user/:username controllers.UserApiController.getUserByName(username: String) + GET /v2/user/login controllers.UserApiController.loginUser() + GET /v2/user/logout controllers.UserApiController.logoutUser() + PUT /v2/user/:username controllers.UserApiController.updateUser(username: String) # Map static resources from the /public folder to the /assets URL path GET /assets/*file controllers.Assets.at(file) From 193432ef52bc8f05c5119819890ef5fbf76ebc9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Sun, 7 Jan 2018 10:21:43 -0500 Subject: [PATCH 23/65] Added optional extra JQueryAjaxSettings at the class and function level (#7238) --- .../resources/typescript-jquery/api.mustache | 16 +++- .../typescript-jquery/default/api/PetApi.ts | 86 +++++++++++++++++-- .../typescript-jquery/default/api/StoreApi.ts | 46 ++++++++-- .../typescript-jquery/default/api/UserApi.ts | 86 +++++++++++++++++-- .../typescript-jquery/npm/api/PetApi.ts | 86 +++++++++++++++++-- .../typescript-jquery/npm/api/StoreApi.ts | 46 ++++++++-- .../typescript-jquery/npm/api/UserApi.ts | 86 +++++++++++++++++-- 7 files changed, 404 insertions(+), 48 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-jquery/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-jquery/api.mustache index 004867abef9..5f4cf7db208 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-jquery/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-jquery/api.mustache @@ -22,15 +22,19 @@ import { Configuration } from '../configuration'; export class {{classname}} { protected basePath = '{{{basePath}}}'; public defaultHeaders: Array = []; + public defaultExtraJQueryAjaxSettings?: JQueryAjaxSettings = null; public configuration: Configuration = new Configuration(); - constructor(basePath?: string, configuration?: Configuration) { + constructor(basePath?: string, configuration?: Configuration, defaultExtraJQueryAjaxSettings?: JQueryAjaxSettings) { if (basePath) { this.basePath = basePath; } if (configuration) { this.configuration = configuration; } + if (defaultExtraJQueryAjaxSettings) { + this.defaultExtraJQueryAjaxSettings = defaultExtraJQueryAjaxSettings; + } } private extendObj(objA: T2, objB: T2): T1|T2 { @@ -52,7 +56,7 @@ export class {{classname}} { * @param {{paramName}} {{description}} {{/allParams}} */ - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): JQueryPromise<{ response: JQueryXHR; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }> { + public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }> { let localVarPath = this.basePath + '{{{path}}}'{{#pathParams}}.replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}}; let queryParameters: any = {}; @@ -217,6 +221,14 @@ export class {{classname}} { } {{/hasFormParams}} + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}any{{/returnType}}, textStatus: string, jqXHR: JQueryXHR) => diff --git a/samples/client/petstore/typescript-jquery/default/api/PetApi.ts b/samples/client/petstore/typescript-jquery/default/api/PetApi.ts index 7c893cfe242..7d1ab010c49 100644 --- a/samples/client/petstore/typescript-jquery/default/api/PetApi.ts +++ b/samples/client/petstore/typescript-jquery/default/api/PetApi.ts @@ -22,15 +22,19 @@ import { Configuration } from '../configuration'; export class PetApi { protected basePath = 'http://petstore.swagger.io/v2'; public defaultHeaders: Array = []; + public defaultExtraJQueryAjaxSettings?: JQueryAjaxSettings = null; public configuration: Configuration = new Configuration(); - constructor(basePath?: string, configuration?: Configuration) { + constructor(basePath?: string, configuration?: Configuration, defaultExtraJQueryAjaxSettings?: JQueryAjaxSettings) { if (basePath) { this.basePath = basePath; } if (configuration) { this.configuration = configuration; } + if (defaultExtraJQueryAjaxSettings) { + this.defaultExtraJQueryAjaxSettings = defaultExtraJQueryAjaxSettings; + } } private extendObj(objA: T2, objB: T2): T1|T2 { @@ -47,7 +51,7 @@ export class PetApi { * @summary Add a new pet to the store * @param body Pet object that needs to be added to the store */ - public addPet(body: models.Pet): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public addPet(body: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/pet'; let queryParameters: any = {}; @@ -95,6 +99,14 @@ export class PetApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -111,7 +123,7 @@ export class PetApi { * @param petId Pet id to delete * @param apiKey */ - public deletePet(petId: number, apiKey?: string): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public deletePet(petId: number, apiKey?: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; @@ -156,6 +168,14 @@ export class PetApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -171,7 +191,7 @@ export class PetApi { * @summary Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array): JQueryPromise<{ response: JQueryXHR; body: Array; }> { + public findPetsByStatus(status: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: Array; }> { let localVarPath = this.basePath + '/pet/findByStatus'; let queryParameters: any = {}; @@ -217,6 +237,14 @@ export class PetApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: Array, textStatus: string, jqXHR: JQueryXHR) => @@ -232,7 +260,7 @@ export class PetApi { * @summary Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array): JQueryPromise<{ response: JQueryXHR; body: Array; }> { + public findPetsByTags(tags: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: Array; }> { let localVarPath = this.basePath + '/pet/findByTags'; let queryParameters: any = {}; @@ -278,6 +306,14 @@ export class PetApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: Array, textStatus: string, jqXHR: JQueryXHR) => @@ -293,7 +329,7 @@ export class PetApi { * @summary Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number): JQueryPromise<{ response: JQueryXHR; body: models.Pet; }> { + public getPetById(petId: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.Pet; }> { let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; @@ -332,6 +368,14 @@ export class PetApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: models.Pet, textStatus: string, jqXHR: JQueryXHR) => @@ -347,7 +391,7 @@ export class PetApi { * @summary Update an existing pet * @param body Pet object that needs to be added to the store */ - public updatePet(body: models.Pet): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public updatePet(body: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/pet'; let queryParameters: any = {}; @@ -395,6 +439,14 @@ export class PetApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -412,7 +464,7 @@ export class PetApi { * @param name Updated name of the pet * @param status Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public updatePetWithForm(petId: number, name?: string, status?: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; @@ -473,6 +525,14 @@ export class PetApi { requestOptions.contentType = false; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -490,7 +550,7 @@ export class PetApi { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: any): JQueryPromise<{ response: JQueryXHR; body: models.ApiResponse; }> { + public uploadFile(petId: number, additionalMetadata?: string, file?: any, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.ApiResponse; }> { let localVarPath = this.basePath + '/pet/{petId}/uploadImage'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; @@ -549,6 +609,14 @@ export class PetApi { requestOptions.contentType = false; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: models.ApiResponse, textStatus: string, jqXHR: JQueryXHR) => diff --git a/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts b/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts index 7ccfc57a4d5..1a7b91c282e 100644 --- a/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts +++ b/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts @@ -22,15 +22,19 @@ import { Configuration } from '../configuration'; export class StoreApi { protected basePath = 'http://petstore.swagger.io/v2'; public defaultHeaders: Array = []; + public defaultExtraJQueryAjaxSettings?: JQueryAjaxSettings = null; public configuration: Configuration = new Configuration(); - constructor(basePath?: string, configuration?: Configuration) { + constructor(basePath?: string, configuration?: Configuration, defaultExtraJQueryAjaxSettings?: JQueryAjaxSettings) { if (basePath) { this.basePath = basePath; } if (configuration) { this.configuration = configuration; } + if (defaultExtraJQueryAjaxSettings) { + this.defaultExtraJQueryAjaxSettings = defaultExtraJQueryAjaxSettings; + } } private extendObj(objA: T2, objB: T2): T1|T2 { @@ -47,7 +51,7 @@ export class StoreApi { * @summary Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public deleteOrder(orderId: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/store/order/{orderId}'.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; @@ -81,6 +85,14 @@ export class StoreApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -95,7 +107,7 @@ export class StoreApi { * Returns a map of status codes to quantities * @summary Returns pet inventories by status */ - public getInventory(): JQueryPromise<{ response: JQueryXHR; body: { [key: string]: number; }; }> { + public getInventory(extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: { [key: string]: number; }; }> { let localVarPath = this.basePath + '/store/inventory'; let queryParameters: any = {}; @@ -128,6 +140,14 @@ export class StoreApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: { [key: string]: number; }, textStatus: string, jqXHR: JQueryXHR) => @@ -143,7 +163,7 @@ export class StoreApi { * @summary Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number): JQueryPromise<{ response: JQueryXHR; body: models.Order; }> { + public getOrderById(orderId: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.Order; }> { let localVarPath = this.basePath + '/store/order/{orderId}'.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; @@ -177,6 +197,14 @@ export class StoreApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: models.Order, textStatus: string, jqXHR: JQueryXHR) => @@ -192,7 +220,7 @@ export class StoreApi { * @summary Place an order for a pet * @param body order placed for purchasing the pet */ - public placeOrder(body: models.Order): JQueryPromise<{ response: JQueryXHR; body: models.Order; }> { + public placeOrder(body: models.Order, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.Order; }> { let localVarPath = this.basePath + '/store/order'; let queryParameters: any = {}; @@ -229,6 +257,14 @@ export class StoreApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: models.Order, textStatus: string, jqXHR: JQueryXHR) => diff --git a/samples/client/petstore/typescript-jquery/default/api/UserApi.ts b/samples/client/petstore/typescript-jquery/default/api/UserApi.ts index afb6cfd883e..3e8308dac35 100644 --- a/samples/client/petstore/typescript-jquery/default/api/UserApi.ts +++ b/samples/client/petstore/typescript-jquery/default/api/UserApi.ts @@ -22,15 +22,19 @@ import { Configuration } from '../configuration'; export class UserApi { protected basePath = 'http://petstore.swagger.io/v2'; public defaultHeaders: Array = []; + public defaultExtraJQueryAjaxSettings?: JQueryAjaxSettings = null; public configuration: Configuration = new Configuration(); - constructor(basePath?: string, configuration?: Configuration) { + constructor(basePath?: string, configuration?: Configuration, defaultExtraJQueryAjaxSettings?: JQueryAjaxSettings) { if (basePath) { this.basePath = basePath; } if (configuration) { this.configuration = configuration; } + if (defaultExtraJQueryAjaxSettings) { + this.defaultExtraJQueryAjaxSettings = defaultExtraJQueryAjaxSettings; + } } private extendObj(objA: T2, objB: T2): T1|T2 { @@ -47,7 +51,7 @@ export class UserApi { * @summary Create user * @param body Created user object */ - public createUser(body: models.User): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public createUser(body: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/user'; let queryParameters: any = {}; @@ -84,6 +88,14 @@ export class UserApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -99,7 +111,7 @@ export class UserApi { * @summary Creates list of users with given input array * @param body List of user object */ - public createUsersWithArrayInput(body: Array): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public createUsersWithArrayInput(body: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/user/createWithArray'; let queryParameters: any = {}; @@ -136,6 +148,14 @@ export class UserApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -151,7 +171,7 @@ export class UserApi { * @summary Creates list of users with given input array * @param body List of user object */ - public createUsersWithListInput(body: Array): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public createUsersWithListInput(body: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/user/createWithList'; let queryParameters: any = {}; @@ -188,6 +208,14 @@ export class UserApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -203,7 +231,7 @@ export class UserApi { * @summary Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public deleteUser(username: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; @@ -237,6 +265,14 @@ export class UserApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -252,7 +288,7 @@ export class UserApi { * @summary Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string): JQueryPromise<{ response: JQueryXHR; body: models.User; }> { + public getUserByName(username: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.User; }> { let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; @@ -286,6 +322,14 @@ export class UserApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: models.User, textStatus: string, jqXHR: JQueryXHR) => @@ -302,7 +346,7 @@ export class UserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string): JQueryPromise<{ response: JQueryXHR; body: string; }> { + public loginUser(username: string, password: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: string; }> { let localVarPath = this.basePath + '/user/login'; let queryParameters: any = {}; @@ -347,6 +391,14 @@ export class UserApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: string, textStatus: string, jqXHR: JQueryXHR) => @@ -361,7 +413,7 @@ export class UserApi { * * @summary Logs out current logged in user session */ - public logoutUser(): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public logoutUser(extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/user/logout'; let queryParameters: any = {}; @@ -390,6 +442,14 @@ export class UserApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -406,7 +466,7 @@ export class UserApi { * @param username name that need to be deleted * @param body Updated user object */ - public updateUser(username: string, body: models.User): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public updateUser(username: string, body: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; @@ -448,6 +508,14 @@ export class UserApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => diff --git a/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts b/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts index 7c893cfe242..7d1ab010c49 100644 --- a/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts +++ b/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts @@ -22,15 +22,19 @@ import { Configuration } from '../configuration'; export class PetApi { protected basePath = 'http://petstore.swagger.io/v2'; public defaultHeaders: Array = []; + public defaultExtraJQueryAjaxSettings?: JQueryAjaxSettings = null; public configuration: Configuration = new Configuration(); - constructor(basePath?: string, configuration?: Configuration) { + constructor(basePath?: string, configuration?: Configuration, defaultExtraJQueryAjaxSettings?: JQueryAjaxSettings) { if (basePath) { this.basePath = basePath; } if (configuration) { this.configuration = configuration; } + if (defaultExtraJQueryAjaxSettings) { + this.defaultExtraJQueryAjaxSettings = defaultExtraJQueryAjaxSettings; + } } private extendObj(objA: T2, objB: T2): T1|T2 { @@ -47,7 +51,7 @@ export class PetApi { * @summary Add a new pet to the store * @param body Pet object that needs to be added to the store */ - public addPet(body: models.Pet): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public addPet(body: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/pet'; let queryParameters: any = {}; @@ -95,6 +99,14 @@ export class PetApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -111,7 +123,7 @@ export class PetApi { * @param petId Pet id to delete * @param apiKey */ - public deletePet(petId: number, apiKey?: string): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public deletePet(petId: number, apiKey?: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; @@ -156,6 +168,14 @@ export class PetApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -171,7 +191,7 @@ export class PetApi { * @summary Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array): JQueryPromise<{ response: JQueryXHR; body: Array; }> { + public findPetsByStatus(status: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: Array; }> { let localVarPath = this.basePath + '/pet/findByStatus'; let queryParameters: any = {}; @@ -217,6 +237,14 @@ export class PetApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: Array, textStatus: string, jqXHR: JQueryXHR) => @@ -232,7 +260,7 @@ export class PetApi { * @summary Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array): JQueryPromise<{ response: JQueryXHR; body: Array; }> { + public findPetsByTags(tags: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: Array; }> { let localVarPath = this.basePath + '/pet/findByTags'; let queryParameters: any = {}; @@ -278,6 +306,14 @@ export class PetApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: Array, textStatus: string, jqXHR: JQueryXHR) => @@ -293,7 +329,7 @@ export class PetApi { * @summary Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number): JQueryPromise<{ response: JQueryXHR; body: models.Pet; }> { + public getPetById(petId: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.Pet; }> { let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; @@ -332,6 +368,14 @@ export class PetApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: models.Pet, textStatus: string, jqXHR: JQueryXHR) => @@ -347,7 +391,7 @@ export class PetApi { * @summary Update an existing pet * @param body Pet object that needs to be added to the store */ - public updatePet(body: models.Pet): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public updatePet(body: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/pet'; let queryParameters: any = {}; @@ -395,6 +439,14 @@ export class PetApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -412,7 +464,7 @@ export class PetApi { * @param name Updated name of the pet * @param status Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public updatePetWithForm(petId: number, name?: string, status?: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; @@ -473,6 +525,14 @@ export class PetApi { requestOptions.contentType = false; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -490,7 +550,7 @@ export class PetApi { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: any): JQueryPromise<{ response: JQueryXHR; body: models.ApiResponse; }> { + public uploadFile(petId: number, additionalMetadata?: string, file?: any, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.ApiResponse; }> { let localVarPath = this.basePath + '/pet/{petId}/uploadImage'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; @@ -549,6 +609,14 @@ export class PetApi { requestOptions.contentType = false; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: models.ApiResponse, textStatus: string, jqXHR: JQueryXHR) => diff --git a/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts b/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts index 7ccfc57a4d5..1a7b91c282e 100644 --- a/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts +++ b/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts @@ -22,15 +22,19 @@ import { Configuration } from '../configuration'; export class StoreApi { protected basePath = 'http://petstore.swagger.io/v2'; public defaultHeaders: Array = []; + public defaultExtraJQueryAjaxSettings?: JQueryAjaxSettings = null; public configuration: Configuration = new Configuration(); - constructor(basePath?: string, configuration?: Configuration) { + constructor(basePath?: string, configuration?: Configuration, defaultExtraJQueryAjaxSettings?: JQueryAjaxSettings) { if (basePath) { this.basePath = basePath; } if (configuration) { this.configuration = configuration; } + if (defaultExtraJQueryAjaxSettings) { + this.defaultExtraJQueryAjaxSettings = defaultExtraJQueryAjaxSettings; + } } private extendObj(objA: T2, objB: T2): T1|T2 { @@ -47,7 +51,7 @@ export class StoreApi { * @summary Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public deleteOrder(orderId: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/store/order/{orderId}'.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; @@ -81,6 +85,14 @@ export class StoreApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -95,7 +107,7 @@ export class StoreApi { * Returns a map of status codes to quantities * @summary Returns pet inventories by status */ - public getInventory(): JQueryPromise<{ response: JQueryXHR; body: { [key: string]: number; }; }> { + public getInventory(extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: { [key: string]: number; }; }> { let localVarPath = this.basePath + '/store/inventory'; let queryParameters: any = {}; @@ -128,6 +140,14 @@ export class StoreApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: { [key: string]: number; }, textStatus: string, jqXHR: JQueryXHR) => @@ -143,7 +163,7 @@ export class StoreApi { * @summary Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number): JQueryPromise<{ response: JQueryXHR; body: models.Order; }> { + public getOrderById(orderId: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.Order; }> { let localVarPath = this.basePath + '/store/order/{orderId}'.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; @@ -177,6 +197,14 @@ export class StoreApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: models.Order, textStatus: string, jqXHR: JQueryXHR) => @@ -192,7 +220,7 @@ export class StoreApi { * @summary Place an order for a pet * @param body order placed for purchasing the pet */ - public placeOrder(body: models.Order): JQueryPromise<{ response: JQueryXHR; body: models.Order; }> { + public placeOrder(body: models.Order, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.Order; }> { let localVarPath = this.basePath + '/store/order'; let queryParameters: any = {}; @@ -229,6 +257,14 @@ export class StoreApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: models.Order, textStatus: string, jqXHR: JQueryXHR) => diff --git a/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts b/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts index afb6cfd883e..3e8308dac35 100644 --- a/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts +++ b/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts @@ -22,15 +22,19 @@ import { Configuration } from '../configuration'; export class UserApi { protected basePath = 'http://petstore.swagger.io/v2'; public defaultHeaders: Array = []; + public defaultExtraJQueryAjaxSettings?: JQueryAjaxSettings = null; public configuration: Configuration = new Configuration(); - constructor(basePath?: string, configuration?: Configuration) { + constructor(basePath?: string, configuration?: Configuration, defaultExtraJQueryAjaxSettings?: JQueryAjaxSettings) { if (basePath) { this.basePath = basePath; } if (configuration) { this.configuration = configuration; } + if (defaultExtraJQueryAjaxSettings) { + this.defaultExtraJQueryAjaxSettings = defaultExtraJQueryAjaxSettings; + } } private extendObj(objA: T2, objB: T2): T1|T2 { @@ -47,7 +51,7 @@ export class UserApi { * @summary Create user * @param body Created user object */ - public createUser(body: models.User): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public createUser(body: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/user'; let queryParameters: any = {}; @@ -84,6 +88,14 @@ export class UserApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -99,7 +111,7 @@ export class UserApi { * @summary Creates list of users with given input array * @param body List of user object */ - public createUsersWithArrayInput(body: Array): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public createUsersWithArrayInput(body: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/user/createWithArray'; let queryParameters: any = {}; @@ -136,6 +148,14 @@ export class UserApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -151,7 +171,7 @@ export class UserApi { * @summary Creates list of users with given input array * @param body List of user object */ - public createUsersWithListInput(body: Array): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public createUsersWithListInput(body: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/user/createWithList'; let queryParameters: any = {}; @@ -188,6 +208,14 @@ export class UserApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -203,7 +231,7 @@ export class UserApi { * @summary Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public deleteUser(username: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; @@ -237,6 +265,14 @@ export class UserApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -252,7 +288,7 @@ export class UserApi { * @summary Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string): JQueryPromise<{ response: JQueryXHR; body: models.User; }> { + public getUserByName(username: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.User; }> { let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; @@ -286,6 +322,14 @@ export class UserApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: models.User, textStatus: string, jqXHR: JQueryXHR) => @@ -302,7 +346,7 @@ export class UserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string): JQueryPromise<{ response: JQueryXHR; body: string; }> { + public loginUser(username: string, password: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: string; }> { let localVarPath = this.basePath + '/user/login'; let queryParameters: any = {}; @@ -347,6 +391,14 @@ export class UserApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: string, textStatus: string, jqXHR: JQueryXHR) => @@ -361,7 +413,7 @@ export class UserApi { * * @summary Logs out current logged in user session */ - public logoutUser(): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public logoutUser(extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/user/logout'; let queryParameters: any = {}; @@ -390,6 +442,14 @@ export class UserApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => @@ -406,7 +466,7 @@ export class UserApi { * @param username name that need to be deleted * @param body Updated user object */ - public updateUser(username: string, body: models.User): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public updateUser(username: string, body: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; @@ -448,6 +508,14 @@ export class UserApi { requestOptions.contentType = headerParams['Content-Type']; } + if (extraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, extraJQueryAjaxSettings); + } + + if (this.defaultExtraJQueryAjaxSettings) { + requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); + } + let dfd = $.Deferred(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => From e51223eef1fb3b552f8bf4fc3d19120026271a4e Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 7 Jan 2018 23:46:33 +0800 Subject: [PATCH 24/65] Revert "Replaced \t with spaces (#7265)" This reverts commit 14a2c81adb337531cc842a3616e112887b28c2bb. --- .../main/java/io/swagger/codegen/DefaultCodegen.java | 11 ----------- .../codegen/languages/AbstractEiffelCodegen.java | 11 ----------- 2 files changed, 22 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 61947061a3b..1f863afb990 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -1835,17 +1835,6 @@ protected void updatePropertyForArray(CodegenProperty property, CodegenProperty property.complexType = innerProperty.baseType; } else { property.isPrimitiveType = true; - property.isBoolean = innerProperty.isBoolean; - property.isLong = innerProperty.isLong; - property.isInteger = innerProperty.isInteger; - property.isDouble = innerProperty.isDouble; - property.isFloat = innerProperty.isFloat; - property.isByteArray = innerProperty.isByteArray; - property.isBinary = innerProperty.isBinary; - property.isFile = innerProperty.isFile; - property.isDate = innerProperty.isDate; - property.isDateTime = innerProperty.isDateTime; - property.isString = innerProperty.isString; } property.items = innerProperty; // inner item is Enum diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractEiffelCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractEiffelCodegen.java index c5894e6ba3d..723e2fb1f7e 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractEiffelCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractEiffelCodegen.java @@ -584,17 +584,6 @@ protected void updatePropertyForArray(CodegenProperty property, CodegenProperty property.complexType = innerProperty.baseType; } else { property.isPrimitiveType = true; - property.isBoolean = innerProperty.isBoolean; - property.isLong = innerProperty.isLong; - property.isInteger = innerProperty.isInteger; - property.isDouble = innerProperty.isDouble; - property.isFloat = innerProperty.isFloat; - property.isByteArray = innerProperty.isByteArray; - property.isBinary = innerProperty.isBinary; - property.isFile = innerProperty.isFile; - property.isDate = innerProperty.isDate; - property.isDateTime = innerProperty.isDateTime; - property.isString = innerProperty.isString; } property.items = innerProperty; // inner item is Enum From f5adbec1ffce37e605f59d072a51a07d234e4c43 Mon Sep 17 00:00:00 2001 From: Sunrin SHIMURA <3han5chou7@gmail.com> Date: Mon, 8 Jan 2018 01:00:12 +0900 Subject: [PATCH 25/65] [Rust-Server] Use string literal based mime initialization (#7212) * Use string literal based mime initialization to avoid invalid token error * canonicalize mimetypes before checking --- .../codegen/languages/RustServerCodegen.java | 75 ++++--------------- .../resources/rust-server/mimetypes.mustache | 4 +- samples/server/petstore/rust-server/README.md | 2 +- .../petstore/rust-server/src/mimetypes.rs | 54 ++++++------- 4 files changed, 44 insertions(+), 91 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RustServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RustServerCodegen.java index 6a6725933da..e345def9add 100755 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RustServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RustServerCodegen.java @@ -440,6 +440,14 @@ public String escapeUnsafeCharacters(String input) { return input.replace("*/", "*_/").replace("/*", "/_*"); } + boolean isMimetypeXml(String mimetype) { + return mimetype.toLowerCase().startsWith("application/xml"); + } + + boolean isMimetypePlainText(String mimetype) { + return mimetype.toLowerCase().startsWith("text/plain"); + } + @Override public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, Map definitions, Swagger swagger) { CodegenOperation op = super.fromOperation(path, httpMethod, operation, definitions, swagger); @@ -528,14 +536,13 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation // if "consumes" is defined (per operation or using global definition) if (consumes != null && !consumes.isEmpty()) { List> c = new ArrayList>(); - for (String key : consumes) { + for (String mimeType : consumes) { Map mediaType = new HashMap(); - String mimeType = processMimeType(key); - if (mimeType.startsWith("Application/Xml")) { + if (isMimetypeXml(mimeType)) { additionalProperties.put("usesXml", true); consumesXml = true; - } else if (mimeType.startsWith("Text/Plain")) { + } else if (isMimetypePlainText(mimeType)) { consumesPlainText = true; } @@ -562,14 +569,13 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation boolean producesPlainText = false; if (produces != null && !produces.isEmpty()) { List> c = new ArrayList>(); - for (String key : produces) { + for (String mimeType : produces) { Map mediaType = new HashMap(); - String mimeType = processMimeType(key); - if (mimeType.startsWith("Application/Xml")) { + if (isMimetypeXml(mimeType)) { additionalProperties.put("usesXml", true); producesXml = true; - } else if (mimeType.startsWith("Text/Plain")) { + } else if (isMimetypePlainText(mimeType)) { producesPlainText = true; } @@ -1023,57 +1029,4 @@ private boolean paramHasXmlNamespace(CodegenParameter param, Map } return false; } - - private String processMimeType(String mimeType){ - // Transform mime type into a form that the hyper mime! macro can handle. - String result = ""; - - String[] split_attributes = mimeType.split(";"); - String media = split_attributes[0]; - String[] mediaTypes = media.split("/"); - - if (mediaTypes.length == 2) { - - if (mediaTypes[0].equals("*")){ - result += "Star"; - } else { - result += escapeText(escapeQuotationMark(initialCaps(mediaTypes[0]))); - } - - result += "/"; - - if (mediaTypes[1].equals("*")) { - result += "Star"; - } else { - result += escapeText(escapeQuotationMark(initialCaps(mediaTypes[1]))); - } - } else { - LOGGER.error("Failed to parse media type: " - + mimeType - + ", media types should have exactly one /"); - } - - if (split_attributes.length == 2) { - String attributes = ""; - String[] attrs = split_attributes[1].split(","); - - for (String attr : attrs) { - String[] keyValuePair =attr.split("="); - if (keyValuePair.length == 2) { - attributes += "(\"" - + escapeText(escapeQuotationMark(keyValuePair[0].trim())) - + "\")=(\"" - + escapeText(escapeQuotationMark(keyValuePair[1].trim())) - + "\")"; - } else { - LOGGER.error("Failed to parse parameter attributes: " - + split_attributes[1] - + ", attributes must be a comma separated list of 'key=value' pairs"); - } - } - result += "; " + attributes; - } - - return result; - } } diff --git a/modules/swagger-codegen/src/main/resources/rust-server/mimetypes.mustache b/modules/swagger-codegen/src/main/resources/rust-server/mimetypes.mustache index 6d71f39f164..744374ca995 100644 --- a/modules/swagger-codegen/src/main/resources/rust-server/mimetypes.mustache +++ b/modules/swagger-codegen/src/main/resources/rust-server/mimetypes.mustache @@ -6,7 +6,7 @@ pub mod responses { // The macro is called per-operation to beat the recursion limit {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{#responses}}{{#produces}}{{#-first}}{{#dataType}} /// Create Mime objects for the response content types for {{operationId}} lazy_static! { - pub static ref {{#vendorExtensions}}{{uppercase_operation_id}}_{{x-uppercaseResponseId}}{{/vendorExtensions}}: Mime = mime!({{{mediaType}}}); + pub static ref {{#vendorExtensions}}{{uppercase_operation_id}}_{{x-uppercaseResponseId}}{{/vendorExtensions}}: Mime = "{{{mediaType}}}".parse().unwrap(); } {{/dataType}}{{/-first}}{{/produces}}{{/responses}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} } @@ -15,7 +15,7 @@ pub mod requests { use hyper::mime::*; {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{#bodyParam}} /// Create Mime objects for the request content types for {{operationId}} lazy_static! { - pub static ref {{#vendorExtensions}}{{uppercase_operation_id}}{{/vendorExtensions}}: Mime = mime!({{#consumes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/consumes}}{{^consumes}}Application/Json{{/consumes}}); + pub static ref {{#vendorExtensions}}{{uppercase_operation_id}}{{/vendorExtensions}}: Mime = "{{#consumes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/consumes}}{{^consumes}}Application/Json{{/consumes}}".parse().unwrap(); } {{/bodyParam}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} } diff --git a/samples/server/petstore/rust-server/README.md b/samples/server/petstore/rust-server/README.md index 0eb6e87be59..09fa6742f17 100644 --- a/samples/server/petstore/rust-server/README.md +++ b/samples/server/petstore/rust-server/README.md @@ -13,7 +13,7 @@ To see how to make this your own, look here: [README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) - API version: 1.0.0 -- Build date: 2017-12-14T14:31:31.219+09:00 +- Build date: 2017-12-20T15:51:59.221+09:00 This autogenerated project defines an API crate `petstore_api` which contains: * An `Api` trait defining the API in Rust. diff --git a/samples/server/petstore/rust-server/src/mimetypes.rs b/samples/server/petstore/rust-server/src/mimetypes.rs index 401c05bedd5..c35afc74ff3 100644 --- a/samples/server/petstore/rust-server/src/mimetypes.rs +++ b/samples/server/petstore/rust-server/src/mimetypes.rs @@ -6,51 +6,51 @@ pub mod responses { // The macro is called per-operation to beat the recursion limit /// Create Mime objects for the response content types for TestSpecialTags lazy_static! { - pub static ref TEST_SPECIAL_TAGS_SUCCESSFUL_OPERATION: Mime = mime!(Application/Json); + pub static ref TEST_SPECIAL_TAGS_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); } /// Create Mime objects for the response content types for TestClientModel lazy_static! { - pub static ref TEST_CLIENT_MODEL_SUCCESSFUL_OPERATION: Mime = mime!(Application/Json); + pub static ref TEST_CLIENT_MODEL_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); } /// Create Mime objects for the response content types for TestClassname lazy_static! { - pub static ref TEST_CLASSNAME_SUCCESSFUL_OPERATION: Mime = mime!(Application/Json); + pub static ref TEST_CLASSNAME_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); } /// Create Mime objects for the response content types for FindPetsByStatus lazy_static! { - pub static ref FIND_PETS_BY_STATUS_SUCCESSFUL_OPERATION: Mime = mime!(Application/Xml); + pub static ref FIND_PETS_BY_STATUS_SUCCESSFUL_OPERATION: Mime = "application/xml".parse().unwrap(); } /// Create Mime objects for the response content types for FindPetsByTags lazy_static! { - pub static ref FIND_PETS_BY_TAGS_SUCCESSFUL_OPERATION: Mime = mime!(Application/Xml); + pub static ref FIND_PETS_BY_TAGS_SUCCESSFUL_OPERATION: Mime = "application/xml".parse().unwrap(); } /// Create Mime objects for the response content types for GetPetById lazy_static! { - pub static ref GET_PET_BY_ID_SUCCESSFUL_OPERATION: Mime = mime!(Application/Xml); + pub static ref GET_PET_BY_ID_SUCCESSFUL_OPERATION: Mime = "application/xml".parse().unwrap(); } /// Create Mime objects for the response content types for UploadFile lazy_static! { - pub static ref UPLOAD_FILE_SUCCESSFUL_OPERATION: Mime = mime!(Application/Json); + pub static ref UPLOAD_FILE_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); } /// Create Mime objects for the response content types for GetInventory lazy_static! { - pub static ref GET_INVENTORY_SUCCESSFUL_OPERATION: Mime = mime!(Application/Json); + pub static ref GET_INVENTORY_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); } /// Create Mime objects for the response content types for GetOrderById lazy_static! { - pub static ref GET_ORDER_BY_ID_SUCCESSFUL_OPERATION: Mime = mime!(Application/Xml); + pub static ref GET_ORDER_BY_ID_SUCCESSFUL_OPERATION: Mime = "application/xml".parse().unwrap(); } /// Create Mime objects for the response content types for PlaceOrder lazy_static! { - pub static ref PLACE_ORDER_SUCCESSFUL_OPERATION: Mime = mime!(Application/Xml); + pub static ref PLACE_ORDER_SUCCESSFUL_OPERATION: Mime = "application/xml".parse().unwrap(); } /// Create Mime objects for the response content types for GetUserByName lazy_static! { - pub static ref GET_USER_BY_NAME_SUCCESSFUL_OPERATION: Mime = mime!(Application/Xml); + pub static ref GET_USER_BY_NAME_SUCCESSFUL_OPERATION: Mime = "application/xml".parse().unwrap(); } /// Create Mime objects for the response content types for LoginUser lazy_static! { - pub static ref LOGIN_USER_SUCCESSFUL_OPERATION: Mime = mime!(Application/Xml); + pub static ref LOGIN_USER_SUCCESSFUL_OPERATION: Mime = "application/xml".parse().unwrap(); } } @@ -59,63 +59,63 @@ pub mod requests { use hyper::mime::*; /// Create Mime objects for the request content types for TestSpecialTags lazy_static! { - pub static ref TEST_SPECIAL_TAGS: Mime = mime!(Application/Json); + pub static ref TEST_SPECIAL_TAGS: Mime = "application/json".parse().unwrap(); } /// Create Mime objects for the request content types for FakeOuterBooleanSerialize lazy_static! { - pub static ref FAKE_OUTER_BOOLEAN_SERIALIZE: Mime = mime!(Application/Json); + pub static ref FAKE_OUTER_BOOLEAN_SERIALIZE: Mime = "Application/Json".parse().unwrap(); } /// Create Mime objects for the request content types for FakeOuterCompositeSerialize lazy_static! { - pub static ref FAKE_OUTER_COMPOSITE_SERIALIZE: Mime = mime!(Application/Json); + pub static ref FAKE_OUTER_COMPOSITE_SERIALIZE: Mime = "Application/Json".parse().unwrap(); } /// Create Mime objects for the request content types for FakeOuterNumberSerialize lazy_static! { - pub static ref FAKE_OUTER_NUMBER_SERIALIZE: Mime = mime!(Application/Json); + pub static ref FAKE_OUTER_NUMBER_SERIALIZE: Mime = "Application/Json".parse().unwrap(); } /// Create Mime objects for the request content types for FakeOuterStringSerialize lazy_static! { - pub static ref FAKE_OUTER_STRING_SERIALIZE: Mime = mime!(Application/Json); + pub static ref FAKE_OUTER_STRING_SERIALIZE: Mime = "Application/Json".parse().unwrap(); } /// Create Mime objects for the request content types for TestClientModel lazy_static! { - pub static ref TEST_CLIENT_MODEL: Mime = mime!(Application/Json); + pub static ref TEST_CLIENT_MODEL: Mime = "application/json".parse().unwrap(); } /// Create Mime objects for the request content types for TestInlineAdditionalProperties lazy_static! { - pub static ref TEST_INLINE_ADDITIONAL_PROPERTIES: Mime = mime!(Application/Json); + pub static ref TEST_INLINE_ADDITIONAL_PROPERTIES: Mime = "application/json".parse().unwrap(); } /// Create Mime objects for the request content types for TestClassname lazy_static! { - pub static ref TEST_CLASSNAME: Mime = mime!(Application/Json); + pub static ref TEST_CLASSNAME: Mime = "application/json".parse().unwrap(); } /// Create Mime objects for the request content types for AddPet lazy_static! { - pub static ref ADD_PET: Mime = mime!(Application/Json); + pub static ref ADD_PET: Mime = "application/json".parse().unwrap(); } /// Create Mime objects for the request content types for UpdatePet lazy_static! { - pub static ref UPDATE_PET: Mime = mime!(Application/Json); + pub static ref UPDATE_PET: Mime = "application/json".parse().unwrap(); } /// Create Mime objects for the request content types for PlaceOrder lazy_static! { - pub static ref PLACE_ORDER: Mime = mime!(Application/Json); + pub static ref PLACE_ORDER: Mime = "Application/Json".parse().unwrap(); } /// Create Mime objects for the request content types for CreateUser lazy_static! { - pub static ref CREATE_USER: Mime = mime!(Application/Json); + pub static ref CREATE_USER: Mime = "Application/Json".parse().unwrap(); } /// Create Mime objects for the request content types for CreateUsersWithArrayInput lazy_static! { - pub static ref CREATE_USERS_WITH_ARRAY_INPUT: Mime = mime!(Application/Json); + pub static ref CREATE_USERS_WITH_ARRAY_INPUT: Mime = "Application/Json".parse().unwrap(); } /// Create Mime objects for the request content types for CreateUsersWithListInput lazy_static! { - pub static ref CREATE_USERS_WITH_LIST_INPUT: Mime = mime!(Application/Json); + pub static ref CREATE_USERS_WITH_LIST_INPUT: Mime = "Application/Json".parse().unwrap(); } /// Create Mime objects for the request content types for UpdateUser lazy_static! { - pub static ref UPDATE_USER: Mime = mime!(Application/Json); + pub static ref UPDATE_USER: Mime = "Application/Json".parse().unwrap(); } } From 99823c04b95861729924bfab1106d160a37b8c8b Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 8 Jan 2018 00:13:49 +0800 Subject: [PATCH 26/65] update Swift4ModelTest.java with _id --- .../test/java/io/swagger/codegen/swift4/Swift4ModelTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/swift4/Swift4ModelTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/swift4/Swift4ModelTest.java index 3e0237a44dd..171263fb8f1 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/swift4/Swift4ModelTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/swift4/Swift4ModelTest.java @@ -39,7 +39,7 @@ public void simpleModelTest() { final CodegenProperty property1 = cm.vars.get(0); Assert.assertEquals(property1.baseName, "id"); Assert.assertEquals(property1.datatype, "Int64"); - Assert.assertEquals(property1.name, "id"); + Assert.assertEquals(property1.name, "_id"); Assert.assertNull(property1.defaultValue); Assert.assertEquals(property1.baseType, "Int64"); Assert.assertTrue(property1.hasMore); From f7779c545e03476285176f834a5eb19620243062 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 8 Jan 2018 00:20:38 +0800 Subject: [PATCH 27/65] refactor abstract scala codegen (#7334) --- .../swagger/codegen/languages/AbstractScalaCodegen.java | 8 +++++++- .../io/swagger/codegen/languages/ScalaClientCodegen.java | 6 ------ .../codegen/languages/ScalaLagomServerCodegen.java | 6 ------ .../swagger/codegen/languages/ScalatraServerCodegen.java | 7 ------- .../io/swagger/codegen/languages/ScalazClientCodegen.java | 6 ------ samples/client/petstore/scala/.swagger-codegen/VERSION | 2 +- .../src/main/scala/io/swagger/client/api/PetApi.scala | 2 ++ 7 files changed, 10 insertions(+), 27 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractScalaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractScalaCodegen.java index cf45b77527f..5628f0bc29b 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractScalaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractScalaCodegen.java @@ -211,4 +211,10 @@ protected String stripPackageName(String input) { int lastIndexOfDot = input.lastIndexOf("."); return input.substring(lastIndexOfDot + 1); } -} \ No newline at end of file + + @Override + public String escapeQuotationMark(String input) { + // remove " to avoid code injection + return input.replace("\"", ""); + } +} diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaClientCodegen.java index f28a3491f22..1c66b3a6a53 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaClientCodegen.java @@ -235,10 +235,4 @@ public String toEnumName(CodegenProperty property) { return formatIdentifier(stripPackageName(property.baseName), true); } - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } - } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaLagomServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaLagomServerCodegen.java index dcf16f399c0..ef175b5f5e0 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaLagomServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaLagomServerCodegen.java @@ -218,12 +218,6 @@ public String toModelName(final String name) { return camelizedName; } - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } - @Override public Map postProcessModelsEnum(Map objs) { objs = super.postProcessModelsEnum(objs); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalatraServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalatraServerCodegen.java index 065dd8409b5..5bc218262c2 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalatraServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalatraServerCodegen.java @@ -151,11 +151,4 @@ public Map postProcessOperations(Map objs) { return objs; } - - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } - } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalazClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalazClientCodegen.java index 3a13d269ff0..3ab3594bf3c 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalazClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalazClientCodegen.java @@ -235,12 +235,6 @@ public void execute(Template.Fragment frag, Writer out) throws IOException { public abstract String formatFragment(String fragment); } - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } - private class EnumEntryLambda extends CustomLambda { @Override public String formatFragment(String fragment) { diff --git a/samples/client/petstore/scala/.swagger-codegen/VERSION b/samples/client/petstore/scala/.swagger-codegen/VERSION index cc6612c36e0..b4308ebebb5 100644 --- a/samples/client/petstore/scala/.swagger-codegen/VERSION +++ b/samples/client/petstore/scala/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0 \ No newline at end of file +2.4.0-SNAPSHOT diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala index 7ee97e2ae40..bf3ebb47a92 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala @@ -340,6 +340,7 @@ class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends val headerParams = new mutable.HashMap[String, String] if (status == null) throw new Exception("Missing required parameter 'status' when calling PetApi->findPetsByStatus") + queryParams += "status" -> status.toString val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") @@ -357,6 +358,7 @@ class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends val headerParams = new mutable.HashMap[String, String] if (tags == null) throw new Exception("Missing required parameter 'tags' when calling PetApi->findPetsByTags") + queryParams += "tags" -> tags.toString val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") From c7f12d6c2dbab4bd672a47c79a5114ae7e98e1d7 Mon Sep 17 00:00:00 2001 From: Mehdi Jouan Date: Sun, 7 Jan 2018 17:22:06 +0100 Subject: [PATCH 28/65] [Spring][Java] fix support of long values for @Max and @Min annotations (#7227) * add support of long values for @Max and @Min annotations * run shell scripts for java and spring * fix import issue after running shell script --- .../main/resources/Java/beanValidationCore.mustache | 12 ++++++------ .../resources/JavaJaxRS/beanValidationCore.mustache | 12 ++++++------ .../JavaJaxRS/cxf-cdi/beanValidationCore.mustache | 12 ++++++------ .../JavaJaxRS/cxf/beanValidationCore.mustache | 12 ++++++------ .../JavaJaxRS/resteasy/beanValidationCore.mustache | 12 ++++++------ .../JavaJaxRS/spec/beanValidationCore.mustache | 12 ++++++------ .../resources/JavaSpring/beanValidationCore.mustache | 2 +- .../src/main/java/io/swagger/api/StoreApi.java | 10 +++++----- .../src/main/java/io/swagger/api/StoreApi.java | 10 +++++----- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../main/java/io/swagger/api/StoreApiController.java | 2 +- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../main/java/io/swagger/api/StoreApiController.java | 2 +- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../main/java/io/swagger/api/StoreApiController.java | 2 +- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../main/java/io/swagger/api/StoreApiController.java | 2 +- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../main/java/io/swagger/api/StoreApiController.java | 2 +- .../src/main/java/io/swagger/api/StoreApi.java | 2 +- .../main/java/io/swagger/api/StoreApiController.java | 2 +- 23 files changed, 61 insertions(+), 61 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/Java/beanValidationCore.mustache index db2a80d7b54..8bcdce3df16 100644 --- a/modules/swagger-codegen/src/main/resources/Java/beanValidationCore.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/beanValidationCore.mustache @@ -5,16 +5,16 @@ minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set }}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! -@Size: minItems && maxItems set +@Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! -@Size: minItems set, maxItems not +@Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! -@Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set }}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! -isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationCore.mustache index db2a80d7b54..8bcdce3df16 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationCore.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidationCore.mustache @@ -5,16 +5,16 @@ minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set }}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! -@Size: minItems && maxItems set +@Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! -@Size: minItems set, maxItems not +@Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! -@Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set }}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! -isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationCore.mustache index db2a80d7b54..8bcdce3df16 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationCore.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationCore.mustache @@ -5,16 +5,16 @@ minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set }}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! -@Size: minItems && maxItems set +@Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! -@Size: minItems set, maxItems not +@Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! -@Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set }}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! -isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache index db2a80d7b54..8bcdce3df16 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache @@ -5,16 +5,16 @@ minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set }}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! -@Size: minItems && maxItems set +@Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! -@Size: minItems set, maxItems not +@Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! -@Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set }}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! -isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache index db2a80d7b54..8bcdce3df16 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache @@ -5,16 +5,16 @@ minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set }}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! -@Size: minItems && maxItems set +@Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! -@Size: minItems set, maxItems not +@Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! -@Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set }}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! -isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache index db2a80d7b54..8bcdce3df16 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache @@ -5,16 +5,16 @@ minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set }}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! -@Size: minItems && maxItems set +@Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! -@Size: minItems set, maxItems not +@Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! -@Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set }}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! -isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationCore.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationCore.mustache index 3e7954e4a87..4b7b561ce70 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationCore.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/beanValidationCore.mustache @@ -15,6 +15,6 @@ check for integer or long / all others=decimal type with @Decimal* isInteger set }}{{#isInteger}}{{#minimum}}@Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}) {{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}}@Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}) {{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}}@Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L) {{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}}@DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}") {{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java index bd341f73670..df17ba5a45c 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java @@ -27,7 +27,7 @@ public interface StoreApi { @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) - @ApiResponses(value = { + @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping(value = "/store/order/{orderId}", @@ -40,7 +40,7 @@ public interface StoreApi { @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) - @ApiResponses(value = { + @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping(value = "/store/inventory", produces = "application/json", @@ -50,7 +50,7 @@ public interface StoreApi { @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @ApiResponses(value = { + @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) @@ -58,11 +58,11 @@ public interface StoreApi { produces = "application/json", consumes = "", method = RequestMethod.GET) - com.netflix.hystrix.HystrixCommand> getOrderById(@Min(1) @Max(5) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("orderId") Long orderId); + com.netflix.hystrix.HystrixCommand> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("orderId") Long orderId); @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) - @ApiResponses(value = { + @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping(value = "/store/order", diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java index 59c31604ecb..9f2f3590be2 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java @@ -27,7 +27,7 @@ public interface StoreApi { @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) - @ApiResponses(value = { + @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) @RequestMapping(value = "/store/order/{orderId}", @@ -40,7 +40,7 @@ public interface StoreApi { @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @Authorization(value = "api_key") }, tags={ "store", }) - @ApiResponses(value = { + @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) @RequestMapping(value = "/store/inventory", produces = "application/json", @@ -50,7 +50,7 @@ public interface StoreApi { @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @ApiResponses(value = { + @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 404, message = "Order not found") }) @@ -58,11 +58,11 @@ public interface StoreApi { produces = "application/json", consumes = "", method = RequestMethod.GET) - ResponseEntity getOrderById(@Min(1) @Max(5) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("orderId") Long orderId); + ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("orderId") Long orderId); @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) - @ApiResponses(value = { + @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order") }) @RequestMapping(value = "/store/order", diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java index e77f2de7f70..9690ed8c145 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java @@ -97,7 +97,7 @@ default CompletableFuture>> getInventory() { @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default CompletableFuture> getOrderById(@Min(1) @Max(5) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + default CompletableFuture> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { if(getObjectMapper().isPresent() && getAcceptHeader().isPresent()) { if (getAcceptHeader().get().contains("application/xml")) { try { diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java index f23d712511f..154926c7b01 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java @@ -55,7 +55,7 @@ public interface StoreApi { @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getOrderById(@Min(1) @Max(5) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId); + ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId); @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApiController.java index 6e463e1307f..bbbf021e11a 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApiController.java @@ -56,7 +56,7 @@ public ResponseEntity> getInventory() { return new ResponseEntity>(HttpStatus.NOT_IMPLEMENTED); } - public ResponseEntity getOrderById(@Min(1) @Max(5) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/xml")) { try { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/StoreApi.java index f23d712511f..154926c7b01 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/StoreApi.java @@ -55,7 +55,7 @@ public interface StoreApi { @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getOrderById(@Min(1) @Max(5) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId); + ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId); @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/StoreApiController.java index 6e463e1307f..bbbf021e11a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/StoreApiController.java @@ -56,7 +56,7 @@ public ResponseEntity> getInventory() { return new ResponseEntity>(HttpStatus.NOT_IMPLEMENTED); } - public ResponseEntity getOrderById(@Min(1) @Max(5) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/xml")) { try { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java index 40a3b4f23f3..345795a9214 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java @@ -61,7 +61,7 @@ default ResponseEntity> getInventory() { @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getOrderById(@Min(1) @Max(5) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { return getDelegate().getOrderById(orderId); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java index f23d712511f..154926c7b01 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java @@ -55,7 +55,7 @@ public interface StoreApi { @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getOrderById(@Min(1) @Max(5) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId); + ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId); @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java index 58c433d2f64..9f9cb5eb2d4 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java @@ -36,7 +36,7 @@ public ResponseEntity> getInventory() { return delegate.getInventory(); } - public ResponseEntity getOrderById(@Min(1) @Max(5) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { return delegate.getOrderById(orderId); } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java index f6d21087d1b..6dc1d03ca01 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java @@ -61,7 +61,7 @@ public interface StoreApi { @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getOrderById(@Min(1) @Max(5) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId); + ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId); @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApiController.java index 6e463e1307f..bbbf021e11a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApiController.java @@ -56,7 +56,7 @@ public ResponseEntity> getInventory() { return new ResponseEntity>(HttpStatus.NOT_IMPLEMENTED); } - public ResponseEntity getOrderById(@Min(1) @Max(5) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/xml")) { try { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/StoreApi.java index 021b7830489..be0fee9cbc1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/StoreApi.java @@ -56,7 +56,7 @@ public interface StoreApi { @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getOrderById(@Min(1) @Max(5) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId); + ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId); @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/StoreApiController.java index 1ee1125dc1b..6e777556dd3 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/StoreApiController.java @@ -57,7 +57,7 @@ public ResponseEntity> getInventory() { return new ResponseEntity>(HttpStatus.NOT_IMPLEMENTED); } - public ResponseEntity getOrderById(@Min(1) @Max(5) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/xml")) { try { diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java index f23d712511f..154926c7b01 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java @@ -55,7 +55,7 @@ public interface StoreApi { @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getOrderById(@Min(1) @Max(5) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId); + ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId); @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApiController.java index 6e463e1307f..bbbf021e11a 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApiController.java @@ -56,7 +56,7 @@ public ResponseEntity> getInventory() { return new ResponseEntity>(HttpStatus.NOT_IMPLEMENTED); } - public ResponseEntity getOrderById(@Min(1) @Max(5) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/xml")) { try { From c642d8a89b2d5239311e30b3220a989dd17f7157 Mon Sep 17 00:00:00 2001 From: Joseph Elliott Date: Mon, 8 Jan 2018 14:25:32 +0100 Subject: [PATCH 29/65] Roll back oltu_version to 1.0.0 to fix #7044 --- .../libraries/retrofit2/build.gradle.mustache | 2 +- .../Java/libraries/retrofit2/pom.mustache | 2 +- .../retrofit2-play24/.swagger-codegen/VERSION | 2 +- .../java/retrofit2-play24/build.gradle | 2 +- .../petstore/java/retrofit2-play24/pom.xml | 2 +- .../retrofit2-play25/.swagger-codegen/VERSION | 2 +- .../java/retrofit2-play25/build.gradle | 4 +- .../petstore/java/retrofit2-play25/build.sbt | 1 + .../java/retrofit2-play25/docs/FakeApi.md | 48 +- .../java/retrofit2-play25/git_push.sh | 2 +- .../petstore/java/retrofit2-play25/pom.xml | 515 +++++++++--------- .../java/io/swagger/client/api/FakeApi.java | 14 + .../model/AdditionalPropertiesClass.java | 4 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../client/model/ArrayOfNumberOnly.java | 2 +- .../io/swagger/client/model/ArrayTest.java | 6 +- .../io/swagger/client/model/EnumArrays.java | 2 +- .../java/io/swagger/client/model/MapTest.java | 4 +- ...ropertiesAndAdditionalPropertiesClass.java | 2 +- .../java/io/swagger/client/model/Pet.java | 4 +- .../java/retrofit2/.swagger-codegen/VERSION | 2 +- .../petstore/java/retrofit2/build.gradle | 2 +- .../client/petstore/java/retrofit2/pom.xml | 2 +- .../java/retrofit2rx/.swagger-codegen/VERSION | 2 +- .../petstore/java/retrofit2rx/build.gradle | 2 +- .../client/petstore/java/retrofit2rx/pom.xml | 2 +- .../retrofit2rx2/.swagger-codegen/VERSION | 2 +- .../petstore/java/retrofit2rx2/build.gradle | 2 +- .../client/petstore/java/retrofit2rx2/pom.xml | 2 +- 29 files changed, 364 insertions(+), 276 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index bc92925ac00..17ed86d4a93 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -100,7 +100,7 @@ if(hasProperty('target') && target == 'android') { } ext { - oltu_version = "1.0.1" + oltu_version = "1.0.0" retrofit_version = "2.3.0" {{#usePlayWS}} {{#play24}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache index b506ac89517..501f9331b24 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -349,7 +349,7 @@ {{#threetenbp}} 1.3.5 {{/threetenbp}} - 1.0.1 + 1.0.0 4.12 diff --git a/samples/client/petstore/java/retrofit2-play24/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2-play24/.swagger-codegen/VERSION index f9f7450d135..50794f17f1a 100644 --- a/samples/client/petstore/java/retrofit2-play24/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit2-play24/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play24/build.gradle b/samples/client/petstore/java/retrofit2-play24/build.gradle index 5ba5dc34efc..15df1acff4d 100644 --- a/samples/client/petstore/java/retrofit2-play24/build.gradle +++ b/samples/client/petstore/java/retrofit2-play24/build.gradle @@ -94,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } ext { - oltu_version = "1.0.1" + oltu_version = "1.0.0" retrofit_version = "2.3.0" jackson_version = "2.6.6" play_version = "2.4.11" diff --git a/samples/client/petstore/java/retrofit2-play24/pom.xml b/samples/client/petstore/java/retrofit2-play24/pom.xml index 3841cd6f1e1..4c6290e4811 100644 --- a/samples/client/petstore/java/retrofit2-play24/pom.xml +++ b/samples/client/petstore/java/retrofit2-play24/pom.xml @@ -270,7 +270,7 @@ 2.6.6 2.4.11 2.3.0 - 1.0.1 + 1.0.0 4.12 diff --git a/samples/client/petstore/java/retrofit2-play25/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2-play25/.swagger-codegen/VERSION index f9f7450d135..50794f17f1a 100644 --- a/samples/client/petstore/java/retrofit2-play25/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit2-play25/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play25/build.gradle b/samples/client/petstore/java/retrofit2-play25/build.gradle index 949928aa0c7..a7c63af85b6 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.gradle +++ b/samples/client/petstore/java/retrofit2-play25/build.gradle @@ -94,13 +94,14 @@ if(hasProperty('target') && target == 'android') { } ext { - oltu_version = "1.0.1" + oltu_version = "1.0.0" retrofit_version = "2.3.0" jackson_version = "2.7.8" play_version = "2.5.14" swagger_annotations_version = "1.5.15" junit_version = "4.12" threetenbp_version = "1.3.5" + json_fire_version = "1.8.0" } dependencies { @@ -109,6 +110,7 @@ dependencies { compile "com.squareup.retrofit2:converter-gson:$retrofit_version" compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" + compile "io.gsonfire:gson-fire:$json_fire_version" compile "org.threeten:threetenbp:$threetenbp_version" compile "com.typesafe.play:play-java-ws_2.11:$play_version" compile "com.squareup.retrofit2:converter-jackson:$retrofit_version" diff --git a/samples/client/petstore/java/retrofit2-play25/build.sbt b/samples/client/petstore/java/retrofit2-play25/build.sbt index c1a0220619c..1988e88ce9a 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.sbt +++ b/samples/client/petstore/java/retrofit2-play25/build.sbt @@ -19,6 +19,7 @@ lazy val root = (project in file(".")). "io.swagger" % "swagger-annotations" % "1.5.15" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", "org.threeten" % "threetenbp" % "1.3.5" % "compile", + "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) diff --git a/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md b/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md index 1467a2943d6..3e052dea273 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** fake | To test enum parameters +[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data @@ -267,7 +268,7 @@ FakeApi apiInstance = new FakeApi(); BigDecimal number = new BigDecimal(); // BigDecimal | None Double _double = 3.4D; // Double | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -byte[] _byte = _byte_example; // byte[] | None +byte[] _byte = B; // byte[] | None Integer integer = 56; // Integer | None Integer int32 = 56; // Integer | None Long int64 = 789L; // Long | None @@ -378,6 +379,51 @@ No authorization required - **Content-Type**: */* - **Accept**: */* + +# **testInlineAdditionalProperties** +> Void testInlineAdditionalProperties(param) + +test inline additionalProperties + + + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +Object param = null; // Object | request body +try { + Void result = apiInstance.testInlineAdditionalProperties(param); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **Object**| request body | + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + # **testJsonFormData** > Void testJsonFormData(param, param2) diff --git a/samples/client/petstore/java/retrofit2-play25/git_push.sh b/samples/client/petstore/java/retrofit2-play25/git_push.sh index ed374619b13..ae01b182ae9 100644 --- a/samples/client/petstore/java/retrofit2-play25/git_push.sh +++ b/samples/client/petstore/java/retrofit2-play25/git_push.sh @@ -36,7 +36,7 @@ git_remote=`git remote` if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git diff --git a/samples/client/petstore/java/retrofit2-play25/pom.xml b/samples/client/petstore/java/retrofit2-play25/pom.xml index f8c24b3fb91..8d46fd07ffd 100644 --- a/samples/client/petstore/java/retrofit2-play25/pom.xml +++ b/samples/client/petstore/java/retrofit2-play25/pom.xml @@ -1,257 +1,282 @@ - 4.0.0 - io.swagger - swagger-java-client - jar - swagger-java-client - 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-java-client + jar + swagger-java-client + 1.0.0 https://github.com/swagger-api/swagger-codegen - - - 2.2.0 - + Swagger Java + + scm:git:git@github.com:swagger-api/swagger-codegen.git + scm:git:git@github.com:swagger-api/swagger-codegen.git + https://github.com/swagger-api/swagger-codegen + - - - Unlicense - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - + + + Unlicense + http://www.apache.org/licenses/LICENSE-2.0.html + repo + + - - - Swagger - apiteam@swagger.io - Swagger - http://swagger.io - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M1 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + - - org.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + - - - + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + com.squareup.retrofit2 + converter-gson + ${retrofit-version} + + + com.squareup.retrofit2 + retrofit + ${retrofit-version} + + + com.squareup.retrofit2 + converter-scalars + ${retrofit-version} + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + ${oltu-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.threeten + threetenbp + ${threetenbp-version} + - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - com.squareup.retrofit2 - converter-gson - ${retrofit-version} - - - com.squareup.retrofit2 - retrofit - ${retrofit-version} - - - com.squareup.retrofit2 - converter-scalars - ${retrofit-version} - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} - - - org.threeten - threetenbp - ${threetenbp-version} - + + + com.squareup.retrofit2 + converter-jackson + ${retrofit-version} + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + com.typesafe.play + play-java-ws_2.11 + ${play-version} + - - - com.squareup.retrofit2 - converter-jackson - ${retrofit-version} - - - com.fasterxml.jackson.core - jackson-core - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-version} - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - - com.typesafe.play - play-java-ws_2.11 - ${play-version} - - - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.8 - ${java.version} - ${java.version} - 1.5.15 - 2.7.8 - 2.5.15 - 2.3.0 - 1.3.5 - 1.0.1 - 4.12 - + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.8 + ${java.version} + ${java.version} + 1.8.0 + 1.5.15 + 2.7.8 + 2.5.15 + 2.3.0 + 1.3.5 + 1.0.0 + 4.12 + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/FakeApi.java index 879c6ebe201..3d1b685c6d0 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/FakeApi.java @@ -126,6 +126,20 @@ CompletionStage> 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") Integer enumQueryInteger, @retrofit2.http.Field("enum_query_double") Double enumQueryDouble ); + /** + * test inline additionalProperties + * + * @param param request body (required) + * @return Call<Void> + */ + @Headers({ + "Content-Type:application/json" + }) + @POST("fake/inline-additionalProperties") + CompletionStage> testInlineAdditionalProperties( + @retrofit2.http.Body Object param + ); + /** * test json serialization of form data * diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index e2bb686e935..f03052a0c41 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -43,7 +43,7 @@ public AdditionalPropertiesClass mapProperty(Map mapProperty) { public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { if (this.mapProperty == null) { - this.mapProperty = new HashMap(); + this.mapProperty = new HashMap<>(); } this.mapProperty.put(key, mapPropertyItem); return this; @@ -69,7 +69,7 @@ public AdditionalPropertiesClass mapOfMapProperty(Map mapOfMapPropertyItem) { if (this.mapOfMapProperty == null) { - this.mapOfMapProperty = new HashMap>(); + this.mapOfMapProperty = new HashMap<>(); } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 87d66e0750d..a5f6292b7b4 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -40,7 +40,7 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 50e09468219..443501f0598 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -40,7 +40,7 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } this.arrayNumber.add(arrayNumberItem); return this; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayTest.java index b944839bc47..4934689e7dc 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayTest.java @@ -46,7 +46,7 @@ public ArrayTest arrayOfString(List arrayOfString) { public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } this.arrayOfString.add(arrayOfStringItem); return this; @@ -72,7 +72,7 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; @@ -99,7 +99,7 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumArrays.java index 2019cbae634..f3cff0ea172 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumArrays.java @@ -130,7 +130,7 @@ public EnumArrays arrayEnum(List arrayEnum) { public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } this.arrayEnum.add(arrayEnumItem); return this; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MapTest.java index 7c013ad8e69..1a15255161d 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MapTest.java @@ -78,7 +78,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -105,7 +105,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index d484a14f09c..a1865dc6e66 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -87,7 +87,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Pet.java index 145360c48a9..653a9765a66 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Pet.java @@ -41,7 +41,7 @@ public class Pet { private String name = null; @JsonProperty("photoUrls") - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") private List tags = null; @@ -173,7 +173,7 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } this.tags.add(tagsItem); return this; diff --git a/samples/client/petstore/java/retrofit2/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2/.swagger-codegen/VERSION index f9f7450d135..50794f17f1a 100644 --- a/samples/client/petstore/java/retrofit2/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit2/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2/build.gradle b/samples/client/petstore/java/retrofit2/build.gradle index be4a7349272..414cbcf9590 100644 --- a/samples/client/petstore/java/retrofit2/build.gradle +++ b/samples/client/petstore/java/retrofit2/build.gradle @@ -94,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } ext { - oltu_version = "1.0.1" + oltu_version = "1.0.0" retrofit_version = "2.3.0" swagger_annotations_version = "1.5.15" junit_version = "4.12" diff --git a/samples/client/petstore/java/retrofit2/pom.xml b/samples/client/petstore/java/retrofit2/pom.xml index 047ce41dd0d..1b52b3919cc 100644 --- a/samples/client/petstore/java/retrofit2/pom.xml +++ b/samples/client/petstore/java/retrofit2/pom.xml @@ -243,7 +243,7 @@ 1.5.15 2.3.0 1.3.5 - 1.0.1 + 1.0.0 4.12 diff --git a/samples/client/petstore/java/retrofit2rx/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2rx/.swagger-codegen/VERSION index f9f7450d135..50794f17f1a 100644 --- a/samples/client/petstore/java/retrofit2rx/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit2rx/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx/build.gradle b/samples/client/petstore/java/retrofit2rx/build.gradle index efbc57f9f81..11b1e687d5a 100644 --- a/samples/client/petstore/java/retrofit2rx/build.gradle +++ b/samples/client/petstore/java/retrofit2rx/build.gradle @@ -94,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } ext { - oltu_version = "1.0.1" + oltu_version = "1.0.0" retrofit_version = "2.3.0" swagger_annotations_version = "1.5.15" junit_version = "4.12" diff --git a/samples/client/petstore/java/retrofit2rx/pom.xml b/samples/client/petstore/java/retrofit2rx/pom.xml index 38cc4913cd2..7052f744020 100644 --- a/samples/client/petstore/java/retrofit2rx/pom.xml +++ b/samples/client/petstore/java/retrofit2rx/pom.xml @@ -254,7 +254,7 @@ 2.3.0 1.3.0 1.3.5 - 1.0.1 + 1.0.0 4.12 diff --git a/samples/client/petstore/java/retrofit2rx2/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2rx2/.swagger-codegen/VERSION index f9f7450d135..50794f17f1a 100644 --- a/samples/client/petstore/java/retrofit2rx2/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit2rx2/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx2/build.gradle b/samples/client/petstore/java/retrofit2rx2/build.gradle index 22dff04b7d1..5cfd0149906 100644 --- a/samples/client/petstore/java/retrofit2rx2/build.gradle +++ b/samples/client/petstore/java/retrofit2rx2/build.gradle @@ -94,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } ext { - oltu_version = "1.0.1" + oltu_version = "1.0.0" retrofit_version = "2.3.0" swagger_annotations_version = "1.5.15" junit_version = "4.12" diff --git a/samples/client/petstore/java/retrofit2rx2/pom.xml b/samples/client/petstore/java/retrofit2rx2/pom.xml index 2c9352e5647..3424a487ef3 100644 --- a/samples/client/petstore/java/retrofit2rx2/pom.xml +++ b/samples/client/petstore/java/retrofit2rx2/pom.xml @@ -254,7 +254,7 @@ 2.3.0 2.1.1 1.3.5 - 1.0.1 + 1.0.0 4.12 From 673be4e88f16ff374b5fe9d45f9baa6fee5bc4ee Mon Sep 17 00:00:00 2001 From: Joseph Elliott Date: Mon, 8 Jan 2018 14:41:57 +0100 Subject: [PATCH 30/65] exclude commons package from org.apache.oltu.oauth2 to provide a more long-term fix. --- .../Java/libraries/retrofit2/build.gradle.mustache | 6 ++++-- .../main/resources/Java/libraries/retrofit2/pom.mustache | 8 +++++++- .../client/petstore/java/retrofit2-play24/build.gradle | 6 ++++-- samples/client/petstore/java/retrofit2-play24/pom.xml | 9 ++++++++- .../client/petstore/java/retrofit2-play25/build.gradle | 6 ++++-- samples/client/petstore/java/retrofit2-play25/pom.xml | 9 ++++++++- samples/client/petstore/java/retrofit2/build.gradle | 6 ++++-- samples/client/petstore/java/retrofit2/pom.xml | 9 ++++++++- samples/client/petstore/java/retrofit2rx/build.gradle | 6 ++++-- samples/client/petstore/java/retrofit2rx/pom.xml | 9 ++++++++- samples/client/petstore/java/retrofit2rx2/build.gradle | 6 ++++-- samples/client/petstore/java/retrofit2rx2/pom.xml | 9 ++++++++- 12 files changed, 71 insertions(+), 18 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index 17ed86d4a93..a87e4276d6d 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -100,7 +100,7 @@ if(hasProperty('target') && target == 'android') { } ext { - oltu_version = "1.0.0" + oltu_version = "1.0.1" retrofit_version = "2.3.0" {{#usePlayWS}} {{#play24}} @@ -142,7 +142,9 @@ dependencies { compile "io.reactivex.rxjava2:rxjava:$rx_java_version" {{/useRxJava2}} compile "io.swagger:swagger-annotations:$swagger_annotations_version" - compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" + compile ("org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"){ + exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common' + } compile "io.gsonfire:gson-fire:$json_fire_version" {{#joda}} compile "joda-time:joda-time:$jodatime_version" diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache index 501f9331b24..f4b21dcea40 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -212,6 +212,12 @@ org.apache.oltu.oauth2 org.apache.oltu.oauth2.client ${oltu-version} + + + org.apache.oltu.oauth2 + common + + io.gsonfire @@ -349,7 +355,7 @@ {{#threetenbp}} 1.3.5 {{/threetenbp}} - 1.0.0 + 1.0.1 4.12 diff --git a/samples/client/petstore/java/retrofit2-play24/build.gradle b/samples/client/petstore/java/retrofit2-play24/build.gradle index 15df1acff4d..59683a42743 100644 --- a/samples/client/petstore/java/retrofit2-play24/build.gradle +++ b/samples/client/petstore/java/retrofit2-play24/build.gradle @@ -94,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } ext { - oltu_version = "1.0.0" + oltu_version = "1.0.1" retrofit_version = "2.3.0" jackson_version = "2.6.6" play_version = "2.4.11" @@ -108,7 +108,9 @@ dependencies { compile "com.squareup.retrofit2:converter-scalars:$retrofit_version" compile "com.squareup.retrofit2:converter-gson:$retrofit_version" compile "io.swagger:swagger-annotations:$swagger_annotations_version" - compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" + compile ("org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"){ + exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common' + } compile "io.gsonfire:gson-fire:$json_fire_version" compile "com.typesafe.play:play-java-ws_2.11:$play_version" compile "com.squareup.retrofit2:converter-jackson:$retrofit_version" diff --git a/samples/client/petstore/java/retrofit2-play24/pom.xml b/samples/client/petstore/java/retrofit2-play24/pom.xml index 4c6290e4811..79f69dba70c 100644 --- a/samples/client/petstore/java/retrofit2-play24/pom.xml +++ b/samples/client/petstore/java/retrofit2-play24/pom.xml @@ -208,10 +208,17 @@ converter-scalars ${retrofit-version} + org.apache.oltu.oauth2 org.apache.oltu.oauth2.client ${oltu-version} + + + org.apache.oltu.oauth2 + common + + io.gsonfire @@ -270,7 +277,7 @@ 2.6.6 2.4.11 2.3.0 - 1.0.0 + 1.0.1 4.12 diff --git a/samples/client/petstore/java/retrofit2-play25/build.gradle b/samples/client/petstore/java/retrofit2-play25/build.gradle index a7c63af85b6..a0ac15f6e7f 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.gradle +++ b/samples/client/petstore/java/retrofit2-play25/build.gradle @@ -94,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } ext { - oltu_version = "1.0.0" + oltu_version = "1.0.1" retrofit_version = "2.3.0" jackson_version = "2.7.8" play_version = "2.5.14" @@ -109,7 +109,9 @@ dependencies { compile "com.squareup.retrofit2:converter-scalars:$retrofit_version" compile "com.squareup.retrofit2:converter-gson:$retrofit_version" compile "io.swagger:swagger-annotations:$swagger_annotations_version" - compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" + compile ("org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"){ + exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common' + } compile "io.gsonfire:gson-fire:$json_fire_version" compile "org.threeten:threetenbp:$threetenbp_version" compile "com.typesafe.play:play-java-ws_2.11:$play_version" diff --git a/samples/client/petstore/java/retrofit2-play25/pom.xml b/samples/client/petstore/java/retrofit2-play25/pom.xml index 8d46fd07ffd..1ea6ea2b5e6 100644 --- a/samples/client/petstore/java/retrofit2-play25/pom.xml +++ b/samples/client/petstore/java/retrofit2-play25/pom.xml @@ -208,10 +208,17 @@ converter-scalars ${retrofit-version} + org.apache.oltu.oauth2 org.apache.oltu.oauth2.client ${oltu-version} + + + org.apache.oltu.oauth2 + common + + io.gsonfire @@ -276,7 +283,7 @@ 2.5.15 2.3.0 1.3.5 - 1.0.0 + 1.0.1 4.12 diff --git a/samples/client/petstore/java/retrofit2/build.gradle b/samples/client/petstore/java/retrofit2/build.gradle index 414cbcf9590..90add11d366 100644 --- a/samples/client/petstore/java/retrofit2/build.gradle +++ b/samples/client/petstore/java/retrofit2/build.gradle @@ -94,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } ext { - oltu_version = "1.0.0" + oltu_version = "1.0.1" retrofit_version = "2.3.0" swagger_annotations_version = "1.5.15" junit_version = "4.12" @@ -107,7 +107,9 @@ dependencies { compile "com.squareup.retrofit2:converter-scalars:$retrofit_version" compile "com.squareup.retrofit2:converter-gson:$retrofit_version" compile "io.swagger:swagger-annotations:$swagger_annotations_version" - compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" + compile ("org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"){ + exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common' + } compile "io.gsonfire:gson-fire:$json_fire_version" compile "org.threeten:threetenbp:$threetenbp_version" diff --git a/samples/client/petstore/java/retrofit2/pom.xml b/samples/client/petstore/java/retrofit2/pom.xml index 1b52b3919cc..8110b9d6922 100644 --- a/samples/client/petstore/java/retrofit2/pom.xml +++ b/samples/client/petstore/java/retrofit2/pom.xml @@ -208,10 +208,17 @@ converter-scalars ${retrofit-version} + org.apache.oltu.oauth2 org.apache.oltu.oauth2.client ${oltu-version} + + + org.apache.oltu.oauth2 + common + + io.gsonfire @@ -243,7 +250,7 @@ 1.5.15 2.3.0 1.3.5 - 1.0.0 + 1.0.1 4.12 diff --git a/samples/client/petstore/java/retrofit2rx/build.gradle b/samples/client/petstore/java/retrofit2rx/build.gradle index 11b1e687d5a..6f88b83d779 100644 --- a/samples/client/petstore/java/retrofit2rx/build.gradle +++ b/samples/client/petstore/java/retrofit2rx/build.gradle @@ -94,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } ext { - oltu_version = "1.0.0" + oltu_version = "1.0.1" retrofit_version = "2.3.0" swagger_annotations_version = "1.5.15" junit_version = "4.12" @@ -110,7 +110,9 @@ dependencies { compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version" compile "io.reactivex:rxjava:$rx_java_version" compile "io.swagger:swagger-annotations:$swagger_annotations_version" - compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" + compile ("org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"){ + exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common' + } compile "io.gsonfire:gson-fire:$json_fire_version" compile "org.threeten:threetenbp:$threetenbp_version" diff --git a/samples/client/petstore/java/retrofit2rx/pom.xml b/samples/client/petstore/java/retrofit2rx/pom.xml index 7052f744020..76b9d465125 100644 --- a/samples/client/petstore/java/retrofit2rx/pom.xml +++ b/samples/client/petstore/java/retrofit2rx/pom.xml @@ -208,10 +208,17 @@ converter-scalars ${retrofit-version} + org.apache.oltu.oauth2 org.apache.oltu.oauth2.client ${oltu-version} + + + org.apache.oltu.oauth2 + common + + io.gsonfire @@ -254,7 +261,7 @@ 2.3.0 1.3.0 1.3.5 - 1.0.0 + 1.0.1 4.12 diff --git a/samples/client/petstore/java/retrofit2rx2/build.gradle b/samples/client/petstore/java/retrofit2rx2/build.gradle index 5cfd0149906..a325e4476d1 100644 --- a/samples/client/petstore/java/retrofit2rx2/build.gradle +++ b/samples/client/petstore/java/retrofit2rx2/build.gradle @@ -94,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } ext { - oltu_version = "1.0.0" + oltu_version = "1.0.1" retrofit_version = "2.3.0" swagger_annotations_version = "1.5.15" junit_version = "4.12" @@ -110,7 +110,9 @@ dependencies { compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0' compile "io.reactivex.rxjava2:rxjava:$rx_java_version" compile "io.swagger:swagger-annotations:$swagger_annotations_version" - compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" + compile ("org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version"){ + exclude group:'org.apache.oltu.oauth2' , module: 'org.apache.oltu.oauth2.common' + } compile "io.gsonfire:gson-fire:$json_fire_version" compile "org.threeten:threetenbp:$threetenbp_version" diff --git a/samples/client/petstore/java/retrofit2rx2/pom.xml b/samples/client/petstore/java/retrofit2rx2/pom.xml index 3424a487ef3..4a1bf76bc85 100644 --- a/samples/client/petstore/java/retrofit2rx2/pom.xml +++ b/samples/client/petstore/java/retrofit2rx2/pom.xml @@ -208,10 +208,17 @@ converter-scalars ${retrofit-version} + org.apache.oltu.oauth2 org.apache.oltu.oauth2.client ${oltu-version} + + + org.apache.oltu.oauth2 + common + + io.gsonfire @@ -254,7 +261,7 @@ 2.3.0 2.1.1 1.3.5 - 1.0.0 + 1.0.1 4.12 From ebf4efe3eabe4da73a3119e8e24b11d97ac5180f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Wed, 10 Jan 2018 00:15:49 -0500 Subject: [PATCH 31/65] Fix issue #6867 : The apiPackage option was ignored (#7316) * Fix issue #6867 : The apiPackage option is ignored in the template for Java Play Framework. * use openjdk7 in travis to ensure it works with jdk7 --- ...java-play-framework-petstore-server-all.sh | 3 +- ...rk-petstore-server-api-package-override.sh | 31 + .../languages/JavaPlayFrameworkCodegen.java | 2 +- .../apiDocController.mustache | 2 +- .../JavaPlayFramework/module.mustache | 2 +- .../JavaPlayFramework/routes.mustache | 4 +- .../.swagger-codegen-ignore | 23 + .../.swagger-codegen/VERSION | 1 + .../LICENSE | 8 + .../README | 4 + .../app/Module.java | 13 + .../app/apimodels/Category.java | 96 ++ .../app/apimodels/ModelApiResponse.java | 118 +++ .../app/apimodels/Order.java | 219 +++++ .../app/apimodels/Pet.java | 238 +++++ .../app/apimodels/Tag.java | 96 ++ .../app/apimodels/User.java | 228 +++++ .../puppies/store/apis/ApiDocController.java | 15 + .../puppies/store/apis/PetApiController.java | 176 ++++ .../store/apis/PetApiControllerImp.java | 59 ++ .../apis/PetApiControllerImpInterface.java | 32 + .../store/apis/StoreApiController.java | 81 ++ .../store/apis/StoreApiControllerImp.java | 37 + .../apis/StoreApiControllerImpInterface.java | 23 + .../puppies/store/apis/UserApiController.java | 149 +++ .../store/apis/UserApiControllerImp.java | 56 ++ .../apis/UserApiControllerImpInterface.java | 31 + .../app/swagger/ApiCall.java | 27 + .../app/swagger/ErrorHandler.java | 49 + .../app/swagger/SwaggerUtils.java | 103 ++ .../build.sbt | 11 + .../conf/application.conf | 374 ++++++++ .../conf/logback.xml | 41 + .../conf/routes | 36 + .../project/build.properties | 1 + .../project/plugins.sbt | 2 + .../public/swagger.json | 908 ++++++++++++++++++ .../.swagger-codegen/VERSION | 2 +- .../.swagger-codegen/VERSION | 2 +- .../.swagger-codegen/VERSION | 2 +- .../.swagger-codegen/VERSION | 2 +- .../.swagger-codegen/VERSION | 2 +- .../.swagger-codegen/VERSION | 2 +- .../.swagger-codegen/VERSION | 2 +- .../.swagger-codegen/VERSION | 2 +- 45 files changed, 3301 insertions(+), 14 deletions(-) create mode 100644 bin/java-play-framework-petstore-server-api-package-override.sh create mode 100644 samples/server/petstore/java-play-framework-api-package-override/.swagger-codegen-ignore create mode 100644 samples/server/petstore/java-play-framework-api-package-override/.swagger-codegen/VERSION create mode 100644 samples/server/petstore/java-play-framework-api-package-override/LICENSE create mode 100644 samples/server/petstore/java-play-framework-api-package-override/README create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/Module.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/ApiDocController.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImpInterface.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImpInterface.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/swagger/ApiCall.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/swagger/ErrorHandler.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/app/swagger/SwaggerUtils.java create mode 100644 samples/server/petstore/java-play-framework-api-package-override/build.sbt create mode 100644 samples/server/petstore/java-play-framework-api-package-override/conf/application.conf create mode 100644 samples/server/petstore/java-play-framework-api-package-override/conf/logback.xml create mode 100644 samples/server/petstore/java-play-framework-api-package-override/conf/routes create mode 100644 samples/server/petstore/java-play-framework-api-package-override/project/build.properties create mode 100644 samples/server/petstore/java-play-framework-api-package-override/project/plugins.sbt create mode 100644 samples/server/petstore/java-play-framework-api-package-override/public/swagger.json diff --git a/bin/java-play-framework-petstore-server-all.sh b/bin/java-play-framework-petstore-server-all.sh index b8dfe47694f..be254313308 100755 --- a/bin/java-play-framework-petstore-server-all.sh +++ b/bin/java-play-framework-petstore-server-all.sh @@ -7,4 +7,5 @@ ./bin/java-play-framework-petstore-server-no-interface.sh ./bin/java-play-framework-petstore-server-no-swagger-ui.sh ./bin/java-play-framework-petstore-server-no-wrap-calls.sh -./bin/java-play-framework-petstore-server-fake-endpoints.sh \ No newline at end of file +./bin/java-play-framework-petstore-server-fake-endpoints.sh +./bin/java-play-framework-petstore-server-api-package-override.sh \ No newline at end of file diff --git a/bin/java-play-framework-petstore-server-api-package-override.sh b/bin/java-play-framework-petstore-server-api-package-override.sh new file mode 100644 index 00000000000..48a757aaf06 --- /dev/null +++ b/bin/java-play-framework-petstore-server-api-package-override.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaPlayFramework -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l java-play-framework -o samples/server/petstore/java-play-framework-api-package-override -DhideGenerationTimestamp=true,apiPackage=com.puppies.store.apis" + +java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java index 45aa089a97e..ccd82d0d3eb 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java @@ -168,7 +168,7 @@ public void processOpts() { if(this.useSwaggerUI) { //App/Controllers supportingFiles.add(new SupportingFile("swagger.mustache", "public", "swagger.json")); - supportingFiles.add(new SupportingFile("apiDocController.mustache", "app/controllers", "ApiDocController.java")); + supportingFiles.add(new SupportingFile("apiDocController.mustache", String.format("app/%s", apiPackage.replace(".", File.separator)), "ApiDocController.java")); } //We remove the default api.mustache that is used diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/apiDocController.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/apiDocController.mustache index 53536fd2418..8985d9fba8b 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/apiDocController.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/apiDocController.mustache @@ -1,4 +1,4 @@ -package controllers; +package {{apiPackage}}; import javax.inject.*; import play.mvc.*; diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/module.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/module.mustache index 4dae1f944e7..7556aa23896 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/module.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/module.mustache @@ -1,6 +1,6 @@ import com.google.inject.AbstractModule; -import controllers.*; +import {{apiPackage}}.*; public class Module extends AbstractModule { diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/routes.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/routes.mustache index 2c3ac1b218d..10ef66b1d9a 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/routes.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/routes.mustache @@ -3,7 +3,7 @@ # ~~~~ {{#useSwaggerUI}} -GET /api controllers.ApiDocController.api +GET /api {{apiPackage}}.ApiDocController.api {{/useSwaggerUI}} {{#apiInfo}} @@ -12,7 +12,7 @@ GET /api controllers.ApiDocController.api #Functions for {{{baseName}}} API {{#operations}} {{#operation}} -{{httpMethod}} {{{contextPath}}}{{{path}}} controllers.{{classname}}Controller.{{operationId}}({{#pathParams}}{{paramName}}: {{#isUuid}}java.util.UUID{{/isUuid}}{{^isUuid}}{{{dataType}}}{{/isUuid}}{{#hasMore}}, {{/hasMore}}{{/pathParams}}) +{{httpMethod}} {{{contextPath}}}{{{path}}} {{apiPackage}}.{{classname}}Controller.{{operationId}}({{#pathParams}}{{paramName}}: {{#isUuid}}java.util.UUID{{/isUuid}}{{^isUuid}}{{{dataType}}}{{/isUuid}}{{#hasMore}}, {{/hasMore}}{{/pathParams}}) {{/operation}} {{/operations}} {{/apis}} diff --git a/samples/server/petstore/java-play-framework-api-package-override/.swagger-codegen-ignore b/samples/server/petstore/java-play-framework-api-package-override/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/java-play-framework-api-package-override/.swagger-codegen/VERSION b/samples/server/petstore/java-play-framework-api-package-override/.swagger-codegen/VERSION new file mode 100644 index 00000000000..cc6612c36e0 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-api-package-override/LICENSE b/samples/server/petstore/java-play-framework-api-package-override/LICENSE new file mode 100644 index 00000000000..4baedcb95f3 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/LICENSE @@ -0,0 +1,8 @@ +This software is licensed under the Apache 2 license, quoted below. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with +the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +language governing permissions and limitations under the License. \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-api-package-override/README b/samples/server/petstore/java-play-framework-api-package-override/README new file mode 100644 index 00000000000..2fce02950d2 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/README @@ -0,0 +1,4 @@ +This is your new Play application +================================= + +This file will be packaged with your application when using `activator dist`. \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/Module.java b/samples/server/petstore/java-play-framework-api-package-override/app/Module.java new file mode 100644 index 00000000000..bc45d304460 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/Module.java @@ -0,0 +1,13 @@ +import com.google.inject.AbstractModule; + +import com.puppies.store.apis.*; + +public class Module extends AbstractModule { + + @Override + protected void configure() { + bind(PetApiControllerImpInterface.class).to(PetApiControllerImp.class); + bind(StoreApiControllerImpInterface.class).to(StoreApiControllerImp.class); + bind(UserApiControllerImpInterface.class).to(UserApiControllerImp.class); + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java new file mode 100644 index 00000000000..9f0206575f5 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java @@ -0,0 +1,96 @@ +package apimodels; + +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * A category for a pet + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class Category { + @JsonProperty("id") + private Long id = null; + + @JsonProperty("name") + private String name = null; + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Category name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(id, category.id) && + Objects.equals(name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java new file mode 100644 index 00000000000..07493e84825 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java @@ -0,0 +1,118 @@ +package apimodels; + +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * Describes the result of uploading an image resource + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class ModelApiResponse { + @JsonProperty("code") + private Integer code = null; + + @JsonProperty("type") + private String type = null; + + @JsonProperty("message") + private String message = null; + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(code, _apiResponse.code) && + Objects.equals(type, _apiResponse.type) && + Objects.equals(message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java new file mode 100644 index 00000000000..cdc21f722c9 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java @@ -0,0 +1,219 @@ +package apimodels; + +import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * An order for a pets from the pet store + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class Order { + @JsonProperty("id") + private Long id = null; + + @JsonProperty("petId") + private Long petId = null; + + @JsonProperty("quantity") + private Integer quantity = null; + + @JsonProperty("shipDate") + private OffsetDateTime shipDate = null; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private final String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("status") + private StatusEnum status = null; + + @JsonProperty("complete") + private Boolean complete = false; + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + **/ + public Long getPetId() { + return petId; + } + + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + @Valid + public OffsetDateTime getShipDate() { + return shipDate; + } + + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * @return status + **/ + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + **/ + public Boolean isComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(id, order.id) && + Objects.equals(petId, order.petId) && + Objects.equals(quantity, order.quantity) && + Objects.equals(shipDate, order.shipDate) && + Objects.equals(status, order.status) && + Objects.equals(complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java new file mode 100644 index 00000000000..5e5ff376294 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java @@ -0,0 +1,238 @@ +package apimodels; + +import apimodels.Category; +import apimodels.Tag; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * A pet for sale in the pet store + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class Pet { + @JsonProperty("id") + private Long id = null; + + @JsonProperty("category") + private Category category = null; + + @JsonProperty("name") + private String name = null; + + @JsonProperty("photoUrls") + private List photoUrls = new ArrayList<>(); + + @JsonProperty("tags") + private List tags = null; + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private final String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + @JsonProperty("status") + private StatusEnum status = null; + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @Valid + public Category getCategory() { + return category; + } + + public void setCategory(Category category) { + this.category = category; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @NotNull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @NotNull + public List getPhotoUrls() { + return photoUrls; + } + + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (tags == null) { + tags = new ArrayList<>(); + } + tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + @Valid + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + **/ + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(id, pet.id) && + Objects.equals(category, pet.category) && + Objects.equals(name, pet.name) && + Objects.equals(photoUrls, pet.photoUrls) && + Objects.equals(tags, pet.tags) && + Objects.equals(status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java new file mode 100644 index 00000000000..15a8774252a --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java @@ -0,0 +1,96 @@ +package apimodels; + +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * A tag for a pet + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class Tag { + @JsonProperty("id") + private Long id = null; + + @JsonProperty("name") + private String name = null; + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(id, tag.id) && + Objects.equals(name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java new file mode 100644 index 00000000000..689de768893 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java @@ -0,0 +1,228 @@ +package apimodels; + +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * A User who is purchasing from the pet store + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class User { + @JsonProperty("id") + private Long id = null; + + @JsonProperty("username") + private String username = null; + + @JsonProperty("firstName") + private String firstName = null; + + @JsonProperty("lastName") + private String lastName = null; + + @JsonProperty("email") + private String email = null; + + @JsonProperty("password") + private String password = null; + + @JsonProperty("phone") + private String phone = null; + + @JsonProperty("userStatus") + private Integer userStatus = null; + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + **/ + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + **/ + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(id, user.id) && + Objects.equals(username, user.username) && + Objects.equals(firstName, user.firstName) && + Objects.equals(lastName, user.lastName) && + Objects.equals(email, user.email) && + Objects.equals(password, user.password) && + Objects.equals(phone, user.phone) && + Objects.equals(userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/ApiDocController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/ApiDocController.java new file mode 100644 index 00000000000..3840561c7a6 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/ApiDocController.java @@ -0,0 +1,15 @@ +package com.puppies.store.apis; + +import javax.inject.*; +import play.mvc.*; + +public class ApiDocController extends Controller { + + @Inject + private ApiDocController() { + } + + public Result api() { + return redirect("/assets/lib/swagger-ui/index.html?/url=/assets/swagger.json"); + } +} diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java new file mode 100644 index 00000000000..344edc3a8fa --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java @@ -0,0 +1,176 @@ +package com.puppies.store.apis; + +import java.io.InputStream; +import apimodels.ModelApiResponse; +import apimodels.Pet; + +import play.mvc.Controller; +import play.mvc.Result; +import play.mvc.Http; +import java.util.List; +import java.util.Map; +import java.util.ArrayList; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.JsonNode; +import com.google.inject.Inject; +import java.io.File; +import swagger.SwaggerUtils; +import com.fasterxml.jackson.core.type.TypeReference; + +import javax.validation.constraints.*; +import play.Configuration; + +import swagger.SwaggerUtils.ApiAction; + + +public class PetApiController extends Controller { + + private final PetApiControllerImpInterface imp; + private final ObjectMapper mapper; + private final Configuration configuration; + + @Inject + private PetApiController(Configuration configuration, PetApiControllerImpInterface imp) { + this.imp = imp; + mapper = new ObjectMapper(); + this.configuration = configuration; + } + + + @ApiAction + public Result addPet() throws Exception { + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + if (configuration.getBoolean("useInputBeanValidation")) { + SwaggerUtils.validate(body); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } + imp.addPet(body); + return ok(); + } + + @ApiAction + public Result deletePet(Long petId) throws Exception { + String valueapiKey = request().getHeader("api_key"); + String apiKey; + if (valueapiKey != null) { + apiKey = valueapiKey; + } else { + apiKey = null; + } + imp.deletePet(petId, apiKey); + return ok(); + } + + @ApiAction + public Result findPetsByStatus() throws Exception { + String[] statusArray = request().queryString().get("status"); + if (statusArray == null) { + throw new IllegalArgumentException("'status' parameter is required"); + } + List statusList = SwaggerUtils.parametersToList("csv", statusArray); + List status = new ArrayList(); + for (String curParam : statusList) { + //noinspection UseBulkOperation + status.add(curParam); + } + List obj = imp.findPetsByStatus(status); + if (configuration.getBoolean("useOutputBeanValidation")) { + for (Pet curItem : obj) { + SwaggerUtils.validate(curItem); + } + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); + } + + @ApiAction + public Result findPetsByTags() throws Exception { + String[] tagsArray = request().queryString().get("tags"); + if (tagsArray == null) { + throw new IllegalArgumentException("'tags' parameter is required"); + } + List tagsList = SwaggerUtils.parametersToList("csv", tagsArray); + List tags = new ArrayList(); + for (String curParam : tagsList) { + //noinspection UseBulkOperation + tags.add(curParam); + } + List obj = imp.findPetsByTags(tags); + if (configuration.getBoolean("useOutputBeanValidation")) { + for (Pet curItem : obj) { + SwaggerUtils.validate(curItem); + } + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); + } + + @ApiAction + public Result getPetById(Long petId) throws Exception { + Pet obj = imp.getPetById(petId); + if (configuration.getBoolean("useOutputBeanValidation")) { + SwaggerUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); + } + + @ApiAction + public Result updatePet() throws Exception { + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); + if (configuration.getBoolean("useInputBeanValidation")) { + SwaggerUtils.validate(body); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } + imp.updatePet(body); + return ok(); + } + + @ApiAction + public Result updatePetWithForm(Long petId) throws Exception { + String valuename = (request().body().asMultipartFormData().asFormUrlEncoded().get("name"))[0]; + String name; + if (valuename != null) { + name = valuename; + } else { + name = null; + } + String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; + String status; + if (valuestatus != null) { + status = valuestatus; + } else { + status = null; + } + imp.updatePetWithForm(petId, name, status); + return ok(); + } + + @ApiAction + public Result uploadFile(Long petId) throws Exception { + String valueadditionalMetadata = (request().body().asMultipartFormData().asFormUrlEncoded().get("additionalMetadata"))[0]; + String additionalMetadata; + if (valueadditionalMetadata != null) { + additionalMetadata = valueadditionalMetadata; + } else { + additionalMetadata = null; + } + Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); + ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); + if (configuration.getBoolean("useOutputBeanValidation")) { + SwaggerUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); + } +} diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java new file mode 100644 index 00000000000..8b6dde9c2d1 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java @@ -0,0 +1,59 @@ +package com.puppies.store.apis; + +import java.io.InputStream; +import apimodels.ModelApiResponse; +import apimodels.Pet; + +import play.mvc.Http; +import java.util.List; +import java.util.ArrayList; +import java.util.HashMap; +import java.io.FileInputStream; +import javax.validation.constraints.*; + +public class PetApiControllerImp implements PetApiControllerImpInterface { + @Override + public void addPet(Pet body) throws Exception { + //Do your magic!!! + } + + @Override + public void deletePet(Long petId, String apiKey) throws Exception { + //Do your magic!!! + } + + @Override + public List findPetsByStatus( @NotNull List status) throws Exception { + //Do your magic!!! + return new ArrayList(); + } + + @Override + public List findPetsByTags( @NotNull List tags) throws Exception { + //Do your magic!!! + return new ArrayList(); + } + + @Override + public Pet getPetById(Long petId) throws Exception { + //Do your magic!!! + return new Pet(); + } + + @Override + public void updatePet(Pet body) throws Exception { + //Do your magic!!! + } + + @Override + public void updatePetWithForm(Long petId, String name, String status) throws Exception { + //Do your magic!!! + } + + @Override + public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception { + //Do your magic!!! + return new ModelApiResponse(); + } + +} diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImpInterface.java new file mode 100644 index 00000000000..39679e11f45 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImpInterface.java @@ -0,0 +1,32 @@ +package com.puppies.store.apis; + +import java.io.InputStream; +import apimodels.ModelApiResponse; +import apimodels.Pet; + +import play.mvc.Http; +import java.util.List; +import java.util.ArrayList; +import java.util.HashMap; + +import javax.validation.constraints.*; + +@SuppressWarnings("RedundantThrows") +public interface PetApiControllerImpInterface { + void addPet(Pet body) throws Exception; + + void deletePet(Long petId, String apiKey) throws Exception; + + List findPetsByStatus( @NotNull List status) throws Exception; + + List findPetsByTags( @NotNull List tags) throws Exception; + + Pet getPetById(Long petId) throws Exception; + + void updatePet(Pet body) throws Exception; + + void updatePetWithForm(Long petId, String name, String status) throws Exception; + + ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception; + +} diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java new file mode 100644 index 00000000000..65fdd7d8ed1 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java @@ -0,0 +1,81 @@ +package com.puppies.store.apis; + +import java.util.Map; +import apimodels.Order; + +import play.mvc.Controller; +import play.mvc.Result; +import play.mvc.Http; +import java.util.List; +import java.util.Map; +import java.util.ArrayList; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.JsonNode; +import com.google.inject.Inject; +import java.io.File; +import swagger.SwaggerUtils; +import com.fasterxml.jackson.core.type.TypeReference; + +import javax.validation.constraints.*; +import play.Configuration; + +import swagger.SwaggerUtils.ApiAction; + + +public class StoreApiController extends Controller { + + private final StoreApiControllerImpInterface imp; + private final ObjectMapper mapper; + private final Configuration configuration; + + @Inject + private StoreApiController(Configuration configuration, StoreApiControllerImpInterface imp) { + this.imp = imp; + mapper = new ObjectMapper(); + this.configuration = configuration; + } + + + @ApiAction + public Result deleteOrder(String orderId) throws Exception { + imp.deleteOrder(orderId); + return ok(); + } + + @ApiAction + public Result getInventory() throws Exception { + Map obj = imp.getInventory(); + JsonNode result = mapper.valueToTree(obj); + return ok(result); + } + + @ApiAction + public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { + Order obj = imp.getOrderById(orderId); + if (configuration.getBoolean("useOutputBeanValidation")) { + SwaggerUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); + } + + @ApiAction + public Result placeOrder() throws Exception { + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); + if (configuration.getBoolean("useInputBeanValidation")) { + SwaggerUtils.validate(body); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } + Order obj = imp.placeOrder(body); + if (configuration.getBoolean("useOutputBeanValidation")) { + SwaggerUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); + } +} diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java new file mode 100644 index 00000000000..fe2cf4f6808 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java @@ -0,0 +1,37 @@ +package com.puppies.store.apis; + +import java.util.Map; +import apimodels.Order; + +import play.mvc.Http; +import java.util.List; +import java.util.ArrayList; +import java.util.HashMap; +import java.io.FileInputStream; +import javax.validation.constraints.*; + +public class StoreApiControllerImp implements StoreApiControllerImpInterface { + @Override + public void deleteOrder(String orderId) throws Exception { + //Do your magic!!! + } + + @Override + public Map getInventory() throws Exception { + //Do your magic!!! + return new HashMap(); + } + + @Override + public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { + //Do your magic!!! + return new Order(); + } + + @Override + public Order placeOrder(Order body) throws Exception { + //Do your magic!!! + return new Order(); + } + +} diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImpInterface.java new file mode 100644 index 00000000000..4f2aadae998 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImpInterface.java @@ -0,0 +1,23 @@ +package com.puppies.store.apis; + +import java.util.Map; +import apimodels.Order; + +import play.mvc.Http; +import java.util.List; +import java.util.ArrayList; +import java.util.HashMap; + +import javax.validation.constraints.*; + +@SuppressWarnings("RedundantThrows") +public interface StoreApiControllerImpInterface { + void deleteOrder(String orderId) throws Exception; + + Map getInventory() throws Exception; + + Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; + + Order placeOrder(Order body) throws Exception; + +} diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java new file mode 100644 index 00000000000..90ef06663a7 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java @@ -0,0 +1,149 @@ +package com.puppies.store.apis; + +import java.util.List; +import apimodels.User; + +import play.mvc.Controller; +import play.mvc.Result; +import play.mvc.Http; +import java.util.List; +import java.util.Map; +import java.util.ArrayList; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.JsonNode; +import com.google.inject.Inject; +import java.io.File; +import swagger.SwaggerUtils; +import com.fasterxml.jackson.core.type.TypeReference; + +import javax.validation.constraints.*; +import play.Configuration; + +import swagger.SwaggerUtils.ApiAction; + + +public class UserApiController extends Controller { + + private final UserApiControllerImpInterface imp; + private final ObjectMapper mapper; + private final Configuration configuration; + + @Inject + private UserApiController(Configuration configuration, UserApiControllerImpInterface imp) { + this.imp = imp; + mapper = new ObjectMapper(); + this.configuration = configuration; + } + + + @ApiAction + public Result createUser() throws Exception { + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + if (configuration.getBoolean("useInputBeanValidation")) { + SwaggerUtils.validate(body); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } + imp.createUser(body); + return ok(); + } + + @ApiAction + public Result createUsersWithArrayInput() throws Exception { + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + if (configuration.getBoolean("useInputBeanValidation")) { + for (User curItem : body) { + SwaggerUtils.validate(curItem); + } + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } + imp.createUsersWithArrayInput(body); + return ok(); + } + + @ApiAction + public Result createUsersWithListInput() throws Exception { + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); + if (configuration.getBoolean("useInputBeanValidation")) { + for (User curItem : body) { + SwaggerUtils.validate(curItem); + } + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } + imp.createUsersWithListInput(body); + return ok(); + } + + @ApiAction + public Result deleteUser(String username) throws Exception { + imp.deleteUser(username); + return ok(); + } + + @ApiAction + public Result getUserByName(String username) throws Exception { + User obj = imp.getUserByName(username); + if (configuration.getBoolean("useOutputBeanValidation")) { + SwaggerUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); + } + + @ApiAction + public Result loginUser() throws Exception { + String valueusername = request().getQueryString("username"); + String username; + if (valueusername != null) { + username = valueusername; + } else { + throw new IllegalArgumentException("'username' parameter is required"); + } + String valuepassword = request().getQueryString("password"); + String password; + if (valuepassword != null) { + password = valuepassword; + } else { + throw new IllegalArgumentException("'password' parameter is required"); + } + String obj = imp.loginUser(username, password); + JsonNode result = mapper.valueToTree(obj); + return ok(result); + } + + @ApiAction + public Result logoutUser() throws Exception { + imp.logoutUser(); + return ok(); + } + + @ApiAction + public Result updateUser(String username) throws Exception { + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); + if (configuration.getBoolean("useInputBeanValidation")) { + SwaggerUtils.validate(body); + } + } else { + throw new IllegalArgumentException("'body' parameter is required"); + } + imp.updateUser(username, body); + return ok(); + } +} diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java new file mode 100644 index 00000000000..d53c2a82c11 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java @@ -0,0 +1,56 @@ +package com.puppies.store.apis; + +import java.util.List; +import apimodels.User; + +import play.mvc.Http; +import java.util.List; +import java.util.ArrayList; +import java.util.HashMap; +import java.io.FileInputStream; +import javax.validation.constraints.*; + +public class UserApiControllerImp implements UserApiControllerImpInterface { + @Override + public void createUser(User body) throws Exception { + //Do your magic!!! + } + + @Override + public void createUsersWithArrayInput(List body) throws Exception { + //Do your magic!!! + } + + @Override + public void createUsersWithListInput(List body) throws Exception { + //Do your magic!!! + } + + @Override + public void deleteUser(String username) throws Exception { + //Do your magic!!! + } + + @Override + public User getUserByName(String username) throws Exception { + //Do your magic!!! + return new User(); + } + + @Override + public String loginUser( @NotNull String username, @NotNull String password) throws Exception { + //Do your magic!!! + return new String(); + } + + @Override + public void logoutUser() throws Exception { + //Do your magic!!! + } + + @Override + public void updateUser(String username, User body) throws Exception { + //Do your magic!!! + } + +} diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java new file mode 100644 index 00000000000..4904073cbc2 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java @@ -0,0 +1,31 @@ +package com.puppies.store.apis; + +import java.util.List; +import apimodels.User; + +import play.mvc.Http; +import java.util.List; +import java.util.ArrayList; +import java.util.HashMap; + +import javax.validation.constraints.*; + +@SuppressWarnings("RedundantThrows") +public interface UserApiControllerImpInterface { + void createUser(User body) throws Exception; + + void createUsersWithArrayInput(List body) throws Exception; + + void createUsersWithListInput(List body) throws Exception; + + void deleteUser(String username) throws Exception; + + User getUserByName(String username) throws Exception; + + String loginUser( @NotNull String username, @NotNull String password) throws Exception; + + void logoutUser() throws Exception; + + void updateUser(String username, User body) throws Exception; + +} diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/swagger/ApiCall.java b/samples/server/petstore/java-play-framework-api-package-override/app/swagger/ApiCall.java new file mode 100644 index 00000000000..2ca308045b6 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/swagger/ApiCall.java @@ -0,0 +1,27 @@ +package swagger; + +import com.google.inject.Inject; +import play.mvc.Action; +import play.mvc.Http; +import play.mvc.Result; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; + +public class ApiCall extends Action { + + @Inject + private ApiCall() {} + + public CompletionStage call(Http.Context ctx) { + try { + //TODO: Do stuff you want to handle with each API call (metrics, logging, etc..) + return delegate.call(ctx); + } catch (Throwable t) { + //TODO: log the error in your metric + + //We rethrow this error so it will be caught in the ErrorHandler + throw t; + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/swagger/ErrorHandler.java b/samples/server/petstore/java-play-framework-api-package-override/app/swagger/ErrorHandler.java new file mode 100644 index 00000000000..2c813411a5e --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/swagger/ErrorHandler.java @@ -0,0 +1,49 @@ +package swagger; + + +import play.*; +import play.api.OptionalSourceMapper; +import play.api.UsefulException; +import play.api.routing.Router; +import play.http.DefaultHttpErrorHandler; +import play.mvc.Http.*; +import play.mvc.*; + +import javax.inject.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; +import static play.mvc.Results.*; + +@Singleton +public class ErrorHandler extends DefaultHttpErrorHandler { + + @Inject + public ErrorHandler(Configuration configuration, Environment environment, OptionalSourceMapper sourceMapper, Provider routes) { + super(configuration, environment, sourceMapper, routes); + } + + @Override + protected CompletionStage onDevServerError(RequestHeader request, UsefulException exception) { + return CompletableFuture.completedFuture( + handleExceptions(exception) + ); + } + + @Override + protected CompletionStage onProdServerError(RequestHeader request, UsefulException exception) { + return CompletableFuture.completedFuture( + handleExceptions(exception) + ); + } + + @Override + protected void logServerError(RequestHeader request, UsefulException usefulException) { + //Since the error is already handled, we don't want to print anything on the console + //But if you want to have the error printed in the console, just delete this override + } + + private Result handleExceptions(Throwable t) { + //TODO: Handle exception that need special response (return a special apimodel, notFound(), etc..) + return ok(); + } +} diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/swagger/SwaggerUtils.java b/samples/server/petstore/java-play-framework-api-package-override/app/swagger/SwaggerUtils.java new file mode 100644 index 00000000000..d4900e02167 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/app/swagger/SwaggerUtils.java @@ -0,0 +1,103 @@ +package swagger; + +import play.mvc.With; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.text.SimpleDateFormat; +import java.util.*; + +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; +import javax.validation.ValidatorFactory; + +public class SwaggerUtils { + + @With(ApiCall.class) + @Target({ ElementType.TYPE, ElementType.METHOD }) + @Retention(RetentionPolicy.RUNTIME) + public @interface ApiAction { + } + + public static void validate(T obj) { + ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); + Validator validator = factory.getValidator(); + Set> constraintViolations = validator.validate(obj); + if (constraintViolations.size() > 0) { + StringBuilder errors = new StringBuilder(); + for (ConstraintViolation contraintes : constraintViolations) { + errors.append(String.format("%s.%s %s\n", + contraintes.getRootBeanClass().getSimpleName(), + contraintes.getPropertyPath(), + contraintes.getMessage())); + } + throw new RuntimeException("Bean validation : " + errors); + } + } + + public static List parametersToList(String collectionFormat, String[] values){ + List params = new ArrayList<>(); + + if (values == null) { + return params; + } + + if (values.length >= 1 && collectionFormat.equals("multi")) { + params.addAll(Arrays.asList(values)); + } else { + collectionFormat = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // default: csv + + String delimiter = ","; + + switch(collectionFormat) { + case "csv": { + delimiter = ","; + break; + } + case "ssv": { + delimiter = " "; + break; + } + case "tsv": { + delimiter = "\t"; + break; + } + case "pipes": { + delimiter = "|"; + break; + } + } + + params = Arrays.asList(values[0].split(delimiter)); + } + + return params; + } + + public static String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDatetime((Date) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection)param) { + if (b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + + return b.toString(); + } else { + return String.valueOf(param); + } + } + + public static String formatDatetime(Date date) { + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-api-package-override/build.sbt b/samples/server/petstore/java-play-framework-api-package-override/build.sbt new file mode 100644 index 00000000000..e425cf8cfe6 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/build.sbt @@ -0,0 +1,11 @@ +name := """swagger-java-playframework""" + +version := "1.0-SNAPSHOT" + +lazy val root = (project in file(".")).enablePlugins(PlayJava) + +scalaVersion := "2.12.2" + +libraryDependencies += "org.webjars" % "swagger-ui" % "3.1.5" +libraryDependencies += "javax.validation" % "validation-api" % "1.1.0.Final" +libraryDependencies += guice diff --git a/samples/server/petstore/java-play-framework-api-package-override/conf/application.conf b/samples/server/petstore/java-play-framework-api-package-override/conf/application.conf new file mode 100644 index 00000000000..bcd07672dc1 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/conf/application.conf @@ -0,0 +1,374 @@ +# This is the main configuration file for the application. +# https://www.playframework.com/documentation/latest/ConfigFile +# ~~~~~ +# Play uses HOCON as its configuration file format. HOCON has a number +# of advantages over other config formats, but there are two things that +# can be used when modifying settings. +# +# You can include other configuration files in this main application.conf file: +#include "extra-config.conf" +# +# You can declare variables and substitute for them: +#mykey = ${some.value} +# +# And if an environment variable exists when there is no other subsitution, then +# HOCON will fall back to substituting environment variable: +#mykey = ${JAVA_HOME} + +play.filters.headers.contentSecurityPolicy=null + +# When using bean validation with the swagger api, the validator will check that every constraint is respected +# This is very useful when testing but could add a lot of overhead if you return a lot of data. Benchmark have +# shown that the time it takes to validate is exponential. +# If this is a concern in your application, or if you don't want to validate the output coming from your API for +# respecting its contract, set the "output" property below to "false". Since there is not a lot of data as input for +# an endpoint, I highly suggest you let the "input" property set to true. +useInputBeanValidation=true +useOutputBeanValidation=true + +play.http.errorHandler="swagger.ErrorHandler" + +## Akka +# https://www.playframework.com/documentation/latest/ScalaAkka#Configuration +# https://www.playframework.com/documentation/latest/JavaAkka#Configuration +# ~~~~~ +# Play uses Akka internally and exposes Akka Streams and actors in Websockets and +# other streaming HTTP responses. +akka { +# "akka.log-config-on-start" is extraordinarily useful because it log the complete +# configuration at INFO level, including defaults and overrides, so it s worth +# putting at the very top. +# +# Put the following in your conf/logback.xml file: +# +# +# +# And then uncomment this line to debug the configuration. +# +#log-config-on-start = true +} + +## Secret key +# http://www.playframework.com/documentation/latest/ApplicationSecret +# ~~~~~ +# The secret key is used to sign Play's session cookie. +# This must be changed for production, but we don't recommend you change it in this file. +play.http.secret.key = "changeme" + +## Modules +# https://www.playframework.com/documentation/latest/Modules +# ~~~~~ +# Control which modules are loaded when Play starts. Note that modules are +# the replacement for "GlobalSettings", which are deprecated in 2.5.x. +# Please see https://www.playframework.com/documentation/latest/GlobalSettings +# for more information. +# +# You can also extend Play functionality by using one of the publically available +# Play modules: https://playframework.com/documentation/latest/ModuleDirectory +play.modules { +# By default, Play will load any class called Module that is defined +# in the root package (the "app" directory), or you can define them +# explicitly below. +# If there are any built-in modules that you want to disable, you can list them here. +} + +play.assets { +path = "/public" +urlPrefix = "/assets" +} + +## IDE +# https://www.playframework.com/documentation/latest/IDE +# ~~~~~ +# Depending on your IDE, you can add a hyperlink for errors that will jump you +# directly to the code location in the IDE in dev mode. The following line makes +# use of the IntelliJ IDEA REST interface: +#play.editor="http://localhost:63342/api/file/?file=%s&line=%s" + +## Internationalisation +# https://www.playframework.com/documentation/latest/JavaI18N +# https://www.playframework.com/documentation/latest/ScalaI18N +# ~~~~~ +# Play comes with its own i18n settings, which allow the user's preferred language +# to map through to internal messages, or allow the language to be stored in a cookie. +play.i18n { +# The application languages +langs = [ "en" ] + +# Whether the language cookie should be secure or not +#langCookieSecure = true + +# Whether the HTTP only attribute of the cookie should be set to true +#langCookieHttpOnly = true +} + +## Play HTTP settings +# ~~~~~ +play.http { +## Router +# https://www.playframework.com/documentation/latest/JavaRouting +# https://www.playframework.com/documentation/latest/ScalaRouting +# ~~~~~ +# Define the Router object to use for this application. +# This router will be looked up first when the application is starting up, +# so make sure this is the entry point. +# Furthermore, it's assumed your route file is named properly. +# So for an application router like `my.application.Router`, +# you may need to define a router file `conf/my.application.routes`. +# Default to Routes in the root package (aka "apps" folder) (and conf/routes) +#router = my.application.Router + +## Action Creator +# https://www.playframework.com/documentation/latest/JavaActionCreator +# ~~~~~ +#actionCreator = null + +## ErrorHandler +# https://www.playframework.com/documentation/latest/JavaRouting +# https://www.playframework.com/documentation/latest/ScalaRouting +# ~~~~~ +# If null, will attempt to load a class called ErrorHandler in the root package, +#errorHandler = null + +## Filters +# https://www.playframework.com/documentation/latest/ScalaHttpFilters +# https://www.playframework.com/documentation/latest/JavaHttpFilters +# ~~~~~ +# Filters run code on every request. They can be used to perform +# common logic for all your actions, e.g. adding common headers. +# Defaults to "Filters" in the root package (aka "apps" folder) +# Alternatively you can explicitly register a class here. +#filters = my.application.Filters + +## Session & Flash +# https://www.playframework.com/documentation/latest/JavaSessionFlash +# https://www.playframework.com/documentation/latest/ScalaSessionFlash +# ~~~~~ +session { +# Sets the cookie to be sent only over HTTPS. +#secure = true + +# Sets the cookie to be accessed only by the server. +#httpOnly = true + +# Sets the max-age field of the cookie to 5 minutes. +# NOTE: this only sets when the browser will discard the cookie. Play will consider any +# cookie value with a valid signature to be a valid session forever. To implement a server side session timeout, +# you need to put a timestamp in the session and check it at regular intervals to possibly expire it. +#maxAge = 300 + +# Sets the domain on the session cookie. +#domain = "example.com" +} + +flash { +# Sets the cookie to be sent only over HTTPS. +#secure = true + +# Sets the cookie to be accessed only by the server. +#httpOnly = true +} +} + +## Netty Provider +# https://www.playframework.com/documentation/latest/SettingsNetty +# ~~~~~ +play.server.netty { +# Whether the Netty wire should be logged +#log.wire = true + +# If you run Play on Linux, you can use Netty's native socket transport +# for higher performance with less garbage. +#transport = "native" +} + +## WS (HTTP Client) +# https://www.playframework.com/documentation/latest/ScalaWS#Configuring-WS +# ~~~~~ +# The HTTP client primarily used for REST APIs. The default client can be +# configured directly, but you can also create different client instances +# with customized settings. You must enable this by adding to build.sbt: +# +# libraryDependencies += ws // or javaWs if using java +# +play.ws { +# Sets HTTP requests not to follow 302 requests +#followRedirects = false + +# Sets the maximum number of open HTTP connections for the client. +#ahc.maxConnectionsTotal = 50 + +## WS SSL +# https://www.playframework.com/documentation/latest/WsSSL +# ~~~~~ +ssl { +# Configuring HTTPS with Play WS does not require programming. You can +# set up both trustManager and keyManager for mutual authentication, and +# turn on JSSE debugging in development with a reload. +#debug.handshake = true +#trustManager = { +# stores = [ +# { type = "JKS", path = "exampletrust.jks" } +# ] +#} +} +} + +## Cache +# https://www.playframework.com/documentation/latest/JavaCache +# https://www.playframework.com/documentation/latest/ScalaCache +# ~~~~~ +# Play comes with an integrated cache API that can reduce the operational +# overhead of repeated requests. You must enable this by adding to build.sbt: +# +# libraryDependencies += cache +# +play.cache { +# If you want to bind several caches, you can bind the individually +#bindCaches = ["db-cache", "user-cache", "session-cache"] +} + +## Filters +# https://www.playframework.com/documentation/latest/Filters +# ~~~~~ +# There are a number of built-in filters that can be enabled and configured +# to give Play greater security. You must enable this by adding to build.sbt: +# +# libraryDependencies += filters +# +play.filters { +## CORS filter configuration +# https://www.playframework.com/documentation/latest/CorsFilter +# ~~~~~ +# CORS is a protocol that allows web applications to make requests from the browser +# across different domains. +# NOTE: You MUST apply the CORS configuration before the CSRF filter, as CSRF has +# dependencies on CORS settings. +cors { +# Filter paths by a whitelist of path prefixes +#pathPrefixes = ["/some/path", ...] + +# The allowed origins. If null, all origins are allowed. +#allowedOrigins = ["http://www.example.com"] + +# The allowed HTTP methods. If null, all methods are allowed +#allowedHttpMethods = ["GET", "POST"] +} + +## CSRF Filter +# https://www.playframework.com/documentation/latest/ScalaCsrf#Applying-a-global-CSRF-filter +# https://www.playframework.com/documentation/latest/JavaCsrf#Applying-a-global-CSRF-filter +# ~~~~~ +# Play supports multiple methods for verifying that a request is not a CSRF request. +# The primary mechanism is a CSRF token. This token gets placed either in the query string +# or body of every form submitted, and also gets placed in the users session. +# Play then verifies that both tokens are present and match. +csrf { +# Sets the cookie to be sent only over HTTPS +#cookie.secure = true + +# Defaults to CSRFErrorHandler in the root package. +#errorHandler = MyCSRFErrorHandler +} + +## Security headers filter configuration +# https://www.playframework.com/documentation/latest/SecurityHeaders +# ~~~~~ +# Defines security headers that prevent XSS attacks. +# If enabled, then all options are set to the below configuration by default: +play.filters.headers { + +# The X-Frame-Options header. If null, the header is not set. +#frameOptions = "DENY" + +# The X-XSS-Protection header. If null, the header is not set. +#xssProtection = "1; mode=block" + +# The X-Content-Type-Options header. If null, the header is not set. +#contentTypeOptions = "nosniff" + +# The X-Permitted-Cross-Domain-Policies header. If null, the header is not set. +#permittedCrossDomainPolicies = "master-only" + +# The Content-Security-Policy header. If null, the header is not set. +contentSecurityPolicy = "default-src 'self'" + +# The Referrer-Policy header. If null, the header is not set. +#referrerPolicy = "origin-when-cross-origin, strict-origin-when-cross-origin" + +# If true, allow an action to use .withHeaders to replace one or more of the above headers +#allowActionSpecificHeaders = false +} + +## Allowed hosts filter configuration +# https://www.playframework.com/documentation/latest/AllowedHostsFilter +# ~~~~~ +# Play provides a filter that lets you configure which hosts can access your application. +# This is useful to prevent cache poisoning attacks. +hosts { +# Allow requests to example.com, its subdomains, and localhost:9000. +#allowed = [".example.com", "localhost:9000"] +} +} + +## Evolutions +# https://www.playframework.com/documentation/latest/Evolutions +# ~~~~~ +# Evolutions allows database scripts to be automatically run on startup in dev mode +# for database migrations. You must enable this by adding to build.sbt: +# +# libraryDependencies += evolutions +# +play.evolutions { +# You can disable evolutions for a specific datasource if necessary +#db.default.enabled = false +} + +## Database Connection Pool +# https://www.playframework.com/documentation/latest/SettingsJDBC +# ~~~~~ +# Play doesn't require a JDBC database to run, but you can easily enable one. +# +# libraryDependencies += jdbc +# +play.db { +# The combination of these two settings results in "db.default" as the +# default JDBC pool: +#config = "db" +#default = "default" + +# Play uses HikariCP as the default connection pool. You can override +# settings by changing the prototype: +prototype { +# Sets a fixed JDBC connection pool size of 50 +#hikaricp.minimumIdle = 50 +#hikaricp.maximumPoolSize = 50 +} +} + +## JDBC Datasource +# https://www.playframework.com/documentation/latest/JavaDatabase +# https://www.playframework.com/documentation/latest/ScalaDatabase +# ~~~~~ +# Once JDBC datasource is set up, you can work with several different +# database options: +# +# Slick (Scala preferred option): https://www.playframework.com/documentation/latest/PlaySlick +# JPA (Java preferred option): https://playframework.com/documentation/latest/JavaJPA +# EBean: https://playframework.com/documentation/latest/JavaEbean +# Anorm: https://www.playframework.com/documentation/latest/ScalaAnorm +# +db { +# You can declare as many datasources as you want. +# By convention, the default datasource is named `default` + +# https://www.playframework.com/documentation/latest/Developing-with-the-H2-Database +#default.driver = org.h2.Driver +#default.url = "jdbc:h2:mem:play" +#default.username = sa +#default.password = "" + +# You can turn on SQL logging for any datasource +# https://www.playframework.com/documentation/latest/Highlights25#Logging-SQL-statements +#default.logSql=true +} diff --git a/samples/server/petstore/java-play-framework-api-package-override/conf/logback.xml b/samples/server/petstore/java-play-framework-api-package-override/conf/logback.xml new file mode 100644 index 00000000000..01f301ab73a --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/conf/logback.xml @@ -0,0 +1,41 @@ + + + + + + + ${application.home:-.}/logs/application.log + + %date [%level] from %logger in %thread - %message%n%xException + + + + + + %coloredLevel %logger{15} - %message%n%xException{10} + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/server/petstore/java-play-framework-api-package-override/conf/routes b/samples/server/petstore/java-play-framework-api-package-override/conf/routes new file mode 100644 index 00000000000..9c9448118a9 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/conf/routes @@ -0,0 +1,36 @@ +# Routes +# This file defines all application routes (Higher priority routes first) +# ~~~~ + +GET /api com.puppies.store.apis.ApiDocController.api + + +#Functions for Pet API +POST /v2/pet com.puppies.store.apis.PetApiController.addPet() +DELETE /v2/pet/:petId com.puppies.store.apis.PetApiController.deletePet(petId: Long) +GET /v2/pet/findByStatus com.puppies.store.apis.PetApiController.findPetsByStatus() +GET /v2/pet/findByTags com.puppies.store.apis.PetApiController.findPetsByTags() +GET /v2/pet/:petId com.puppies.store.apis.PetApiController.getPetById(petId: Long) +PUT /v2/pet com.puppies.store.apis.PetApiController.updatePet() +POST /v2/pet/:petId com.puppies.store.apis.PetApiController.updatePetWithForm(petId: Long) +POST /v2/pet/:petId/uploadImage com.puppies.store.apis.PetApiController.uploadFile(petId: Long) + +#Functions for Store API +DELETE /v2/store/order/:orderId com.puppies.store.apis.StoreApiController.deleteOrder(orderId: String) +GET /v2/store/inventory com.puppies.store.apis.StoreApiController.getInventory() +GET /v2/store/order/:orderId com.puppies.store.apis.StoreApiController.getOrderById(orderId: Long) +POST /v2/store/order com.puppies.store.apis.StoreApiController.placeOrder() + +#Functions for User API +POST /v2/user com.puppies.store.apis.UserApiController.createUser() +POST /v2/user/createWithArray com.puppies.store.apis.UserApiController.createUsersWithArrayInput() +POST /v2/user/createWithList com.puppies.store.apis.UserApiController.createUsersWithListInput() +DELETE /v2/user/:username com.puppies.store.apis.UserApiController.deleteUser(username: String) +GET /v2/user/:username com.puppies.store.apis.UserApiController.getUserByName(username: String) +GET /v2/user/login com.puppies.store.apis.UserApiController.loginUser() +GET /v2/user/logout com.puppies.store.apis.UserApiController.logoutUser() +PUT /v2/user/:username com.puppies.store.apis.UserApiController.updateUser(username: String) + +# Map static resources from the /public folder to the /assets URL path +GET /assets/*file controllers.Assets.at(file) +GET /versionedAssets/*file controllers.Assets.versioned(file) \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-api-package-override/project/build.properties b/samples/server/petstore/java-play-framework-api-package-override/project/build.properties new file mode 100644 index 00000000000..cf19fd026fd --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/project/build.properties @@ -0,0 +1 @@ +sbt.version=0.13.15 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-api-package-override/project/plugins.sbt b/samples/server/petstore/java-play-framework-api-package-override/project/plugins.sbt new file mode 100644 index 00000000000..66fbf368ae6 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/project/plugins.sbt @@ -0,0 +1,2 @@ +// The Play plugin +addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.3") diff --git a/samples/server/petstore/java-play-framework-api-package-override/public/swagger.json b/samples/server/petstore/java-play-framework-api-package-override/public/swagger.json new file mode 100644 index 00000000000..0f5defa6026 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/public/swagger.json @@ -0,0 +1,908 @@ +{ + "swagger" : "2.0", + "info" : { + "description" : "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "version" : "1.0.0", + "title" : "Swagger Petstore", + "termsOfService" : "http://swagger.io/terms/", + "contact" : { + "email" : "apiteam@swagger.io" + }, + "license" : { + "name" : "Apache-2.0", + "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "host" : "petstore.swagger.io", + "basePath" : "/v2", + "tags" : [ { + "name" : "pet", + "description" : "Everything about your Pets", + "externalDocs" : { + "description" : "Find out more", + "url" : "http://swagger.io" + } + }, { + "name" : "store", + "description" : "Access to Petstore orders" + }, { + "name" : "user", + "description" : "Operations about user", + "externalDocs" : { + "description" : "Find out more about our store", + "url" : "http://swagger.io" + } + } ], + "schemes" : [ "http" ], + "paths" : { + "/pet" : { + "post" : { + "tags" : [ "pet" ], + "summary" : "Add a new pet to the store", + "description" : "", + "operationId" : "addPet", + "consumes" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Pet object that needs to be added to the store", + "required" : true, + "schema" : { + "$ref" : "#/definitions/Pet" + } + } ], + "responses" : { + "405" : { + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-contentType" : "application/json", + "x-accepts" : "application/json" + }, + "put" : { + "tags" : [ "pet" ], + "summary" : "Update an existing pet", + "description" : "", + "operationId" : "updatePet", + "consumes" : [ "application/json", "application/xml" ], + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Pet object that needs to be added to the store", + "required" : true, + "schema" : { + "$ref" : "#/definitions/Pet" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Pet not found" + }, + "405" : { + "description" : "Validation exception" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-contentType" : "application/json", + "x-accepts" : "application/json" + } + }, + "/pet/findByStatus" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Finds Pets by status", + "description" : "Multiple status values can be provided with comma separated strings", + "operationId" : "findPetsByStatus", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "status", + "in" : "query", + "description" : "Status values that need to be considered for filter", + "required" : true, + "type" : "array", + "items" : { + "type" : "string", + "default" : "available", + "enum" : [ "available", "pending", "sold" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Pet" + } + } + }, + "400" : { + "description" : "Invalid status value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-accepts" : "application/json" + } + }, + "/pet/findByTags" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Finds Pets by tags", + "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + "operationId" : "findPetsByTags", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "tags", + "in" : "query", + "description" : "Tags to filter by", + "required" : true, + "type" : "array", + "items" : { + "type" : "string" + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Pet" + } + } + }, + "400" : { + "description" : "Invalid tag value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "deprecated" : true, + "x-accepts" : "application/json" + } + }, + "/pet/{petId}" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Find pet by ID", + "description" : "Returns a single pet", + "operationId" : "getPetById", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet to return", + "required" : true, + "type" : "integer", + "format" : "int64" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Pet" + } + }, + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Pet not found" + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "x-accepts" : "application/json" + }, + "post" : { + "tags" : [ "pet" ], + "summary" : "Updates a pet in the store with form data", + "description" : "", + "operationId" : "updatePetWithForm", + "consumes" : [ "application/x-www-form-urlencoded" ], + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet that needs to be updated", + "required" : true, + "type" : "integer", + "format" : "int64" + }, { + "name" : "name", + "in" : "formData", + "description" : "Updated name of the pet", + "required" : false, + "type" : "string" + }, { + "name" : "status", + "in" : "formData", + "description" : "Updated status of the pet", + "required" : false, + "type" : "string" + } ], + "responses" : { + "405" : { + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-contentType" : "application/x-www-form-urlencoded", + "x-accepts" : "application/json" + }, + "delete" : { + "tags" : [ "pet" ], + "summary" : "Deletes a pet", + "description" : "", + "operationId" : "deletePet", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "api_key", + "in" : "header", + "required" : false, + "type" : "string" + }, { + "name" : "petId", + "in" : "path", + "description" : "Pet id to delete", + "required" : true, + "type" : "integer", + "format" : "int64" + } ], + "responses" : { + "400" : { + "description" : "Invalid pet value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-accepts" : "application/json" + } + }, + "/pet/{petId}/uploadImage" : { + "post" : { + "tags" : [ "pet" ], + "summary" : "uploads an image", + "description" : "", + "operationId" : "uploadFile", + "consumes" : [ "multipart/form-data" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet to update", + "required" : true, + "type" : "integer", + "format" : "int64" + }, { + "name" : "additionalMetadata", + "in" : "formData", + "description" : "Additional data to pass to server", + "required" : false, + "type" : "string" + }, { + "name" : "file", + "in" : "formData", + "description" : "file to upload", + "required" : false, + "type" : "file" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ApiResponse" + } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-contentType" : "multipart/form-data", + "x-accepts" : "application/json" + } + }, + "/store/inventory" : { + "get" : { + "tags" : [ "store" ], + "summary" : "Returns pet inventories by status", + "description" : "Returns a map of status codes to quantities", + "operationId" : "getInventory", + "produces" : [ "application/json" ], + "parameters" : [ ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "integer", + "format" : "int32" + } + } + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "x-accepts" : "application/json" + } + }, + "/store/order" : { + "post" : { + "tags" : [ "store" ], + "summary" : "Place an order for a pet", + "description" : "", + "operationId" : "placeOrder", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "order placed for purchasing the pet", + "required" : true, + "schema" : { + "$ref" : "#/definitions/Order" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Order" + } + }, + "400" : { + "description" : "Invalid Order" + } + }, + "x-contentType" : "application/json", + "x-accepts" : "application/json" + } + }, + "/store/order/{orderId}" : { + "get" : { + "tags" : [ "store" ], + "summary" : "Find purchase order by ID", + "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId" : "getOrderById", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "orderId", + "in" : "path", + "description" : "ID of pet that needs to be fetched", + "required" : true, + "type" : "integer", + "maximum" : 5, + "minimum" : 1, + "format" : "int64" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/Order" + } + }, + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Order not found" + } + }, + "x-accepts" : "application/json" + }, + "delete" : { + "tags" : [ "store" ], + "summary" : "Delete purchase order by ID", + "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + "operationId" : "deleteOrder", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "orderId", + "in" : "path", + "description" : "ID of the order that needs to be deleted", + "required" : true, + "type" : "string" + } ], + "responses" : { + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Order not found" + } + }, + "x-accepts" : "application/json" + } + }, + "/user" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Create user", + "description" : "This can only be done by the logged in user.", + "operationId" : "createUser", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "Created user object", + "required" : true, + "schema" : { + "$ref" : "#/definitions/User" + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "x-contentType" : "application/json", + "x-accepts" : "application/json" + } + }, + "/user/createWithArray" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Creates list of users with given input array", + "description" : "", + "operationId" : "createUsersWithArrayInput", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "List of user object", + "required" : true, + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/User" + } + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "x-contentType" : "application/json", + "x-accepts" : "application/json" + } + }, + "/user/createWithList" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Creates list of users with given input array", + "description" : "", + "operationId" : "createUsersWithListInput", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "description" : "List of user object", + "required" : true, + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/User" + } + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "x-contentType" : "application/json", + "x-accepts" : "application/json" + } + }, + "/user/login" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Logs user into the system", + "description" : "", + "operationId" : "loginUser", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "username", + "in" : "query", + "description" : "The user name for login", + "required" : true, + "type" : "string" + }, { + "name" : "password", + "in" : "query", + "description" : "The password for login in clear text", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "string" + }, + "headers" : { + "X-Rate-Limit" : { + "type" : "integer", + "format" : "int32", + "description" : "calls per hour allowed by the user" + }, + "X-Expires-After" : { + "type" : "string", + "format" : "date-time", + "description" : "date in UTC when toekn expires" + } + } + }, + "400" : { + "description" : "Invalid username/password supplied" + } + }, + "x-accepts" : "application/json" + } + }, + "/user/logout" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Logs out current logged in user session", + "description" : "", + "operationId" : "logoutUser", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ ], + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "x-accepts" : "application/json" + } + }, + "/user/{username}" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Get user by user name", + "description" : "", + "operationId" : "getUserByName", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The name that needs to be fetched. Use user1 for testing. ", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/User" + } + }, + "400" : { + "description" : "Invalid username supplied" + }, + "404" : { + "description" : "User not found" + } + }, + "x-accepts" : "application/json" + }, + "put" : { + "tags" : [ "user" ], + "summary" : "Updated user", + "description" : "This can only be done by the logged in user.", + "operationId" : "updateUser", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "name that need to be deleted", + "required" : true, + "type" : "string" + }, { + "in" : "body", + "name" : "body", + "description" : "Updated user object", + "required" : true, + "schema" : { + "$ref" : "#/definitions/User" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid user supplied" + }, + "404" : { + "description" : "User not found" + } + }, + "x-contentType" : "application/json", + "x-accepts" : "application/json" + }, + "delete" : { + "tags" : [ "user" ], + "summary" : "Delete user", + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The name that needs to be deleted", + "required" : true, + "type" : "string" + } ], + "responses" : { + "400" : { + "description" : "Invalid username supplied" + }, + "404" : { + "description" : "User not found" + } + }, + "x-accepts" : "application/json" + } + } + }, + "securityDefinitions" : { + "petstore_auth" : { + "type" : "oauth2", + "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", + "flow" : "implicit", + "scopes" : { + "write:pets" : "modify pets in your account", + "read:pets" : "read your pets" + } + }, + "api_key" : { + "type" : "apiKey", + "name" : "api_key", + "in" : "header" + } + }, + "definitions" : { + "Order" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "petId" : { + "type" : "integer", + "format" : "int64" + }, + "quantity" : { + "type" : "integer", + "format" : "int32" + }, + "shipDate" : { + "type" : "string", + "format" : "date-time" + }, + "status" : { + "type" : "string", + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ] + }, + "complete" : { + "type" : "boolean", + "default" : false + } + }, + "title" : "Pet Order", + "description" : "An order for a pets from the pet store", + "example" : { + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" + }, + "xml" : { + "name" : "Order" + } + }, + "Category" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet category", + "description" : "A category for a pet", + "example" : { + "name" : "name", + "id" : 6 + }, + "xml" : { + "name" : "Category" + } + }, + "User" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "username" : { + "type" : "string" + }, + "firstName" : { + "type" : "string" + }, + "lastName" : { + "type" : "string" + }, + "email" : { + "type" : "string" + }, + "password" : { + "type" : "string" + }, + "phone" : { + "type" : "string" + }, + "userStatus" : { + "type" : "integer", + "format" : "int32", + "description" : "User Status" + } + }, + "title" : "a User", + "description" : "A User who is purchasing from the pet store", + "example" : { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" + }, + "xml" : { + "name" : "User" + } + }, + "Tag" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet Tag", + "description" : "A tag for a pet", + "example" : { + "name" : "name", + "id" : 1 + }, + "xml" : { + "name" : "Tag" + } + }, + "Pet" : { + "type" : "object", + "required" : [ "name", "photoUrls" ], + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "category" : { + "$ref" : "#/definitions/Category" + }, + "name" : { + "type" : "string", + "example" : "doggie" + }, + "photoUrls" : { + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + }, + "items" : { + "type" : "string" + } + }, + "tags" : { + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + }, + "items" : { + "$ref" : "#/definitions/Tag" + } + }, + "status" : { + "type" : "string", + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ] + } + }, + "title" : "a Pet", + "description" : "A pet for sale in the pet store", + "example" : { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" + }, + "xml" : { + "name" : "Pet" + } + }, + "ApiResponse" : { + "type" : "object", + "properties" : { + "code" : { + "type" : "integer", + "format" : "int32" + }, + "type" : { + "type" : "string" + }, + "message" : { + "type" : "string" + } + }, + "title" : "An uploaded response", + "description" : "Describes the result of uploading an image resource", + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + } + } + }, + "externalDocs" : { + "description" : "Find out more about Swagger", + "url" : "http://swagger.io" + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-controller-only/.swagger-codegen/VERSION b/samples/server/petstore/java-play-framework-controller-only/.swagger-codegen/VERSION index f9f7450d135..cc6612c36e0 100644 --- a/samples/server/petstore/java-play-framework-controller-only/.swagger-codegen/VERSION +++ b/samples/server/petstore/java-play-framework-controller-only/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.0 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/.swagger-codegen/VERSION b/samples/server/petstore/java-play-framework-fake-endpoints/.swagger-codegen/VERSION index f9f7450d135..cc6612c36e0 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/.swagger-codegen/VERSION +++ b/samples/server/petstore/java-play-framework-fake-endpoints/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.0 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/.swagger-codegen/VERSION b/samples/server/petstore/java-play-framework-no-bean-validation/.swagger-codegen/VERSION index f9f7450d135..cc6612c36e0 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/.swagger-codegen/VERSION +++ b/samples/server/petstore/java-play-framework-no-bean-validation/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.0 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/.swagger-codegen/VERSION b/samples/server/petstore/java-play-framework-no-exception-handling/.swagger-codegen/VERSION index f9f7450d135..cc6612c36e0 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/.swagger-codegen/VERSION +++ b/samples/server/petstore/java-play-framework-no-exception-handling/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.0 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-interface/.swagger-codegen/VERSION b/samples/server/petstore/java-play-framework-no-interface/.swagger-codegen/VERSION index f9f7450d135..cc6612c36e0 100644 --- a/samples/server/petstore/java-play-framework-no-interface/.swagger-codegen/VERSION +++ b/samples/server/petstore/java-play-framework-no-interface/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.0 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/.swagger-codegen/VERSION b/samples/server/petstore/java-play-framework-no-swagger-ui/.swagger-codegen/VERSION index f9f7450d135..cc6612c36e0 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/.swagger-codegen/VERSION +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.0 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/.swagger-codegen/VERSION b/samples/server/petstore/java-play-framework-no-wrap-calls/.swagger-codegen/VERSION index f9f7450d135..cc6612c36e0 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/.swagger-codegen/VERSION +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.0 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework/.swagger-codegen/VERSION b/samples/server/petstore/java-play-framework/.swagger-codegen/VERSION index f9f7450d135..cc6612c36e0 100644 --- a/samples/server/petstore/java-play-framework/.swagger-codegen/VERSION +++ b/samples/server/petstore/java-play-framework/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.0 \ No newline at end of file From 1bb9207c9bf3079bf64050aadd21ab4735511db3 Mon Sep 17 00:00:00 2001 From: Five & Done Date: Wed, 10 Jan 2018 20:48:37 -0800 Subject: [PATCH 32/65] Standardize all isRestfulxxx methods. (#7352) * [Scala] Fix async helper methods when body is optional (#7274) * [Scala] Fix async helper methods when body is optional Closes #7272 * Update petstore sample * Standardize all isRestfulxxx methods. Change 'equals' method to 'equalsIgnoreCase' for isRestfulIndex method in Operations. This matches isRestfulCreate, isRestfulShow, isRestfulDestroy --- .../src/main/java/io/swagger/codegen/CodegenOperation.java | 2 +- modules/swagger-codegen/src/main/resources/scala/api.mustache | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java index 71597b6fc8f..d62aca3b527 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java @@ -111,7 +111,7 @@ public boolean getHasExamples() { * @return true if act as Restful index method, false otherwise */ public boolean isRestfulIndex() { - return "GET".equals(httpMethod) && "".equals(pathWithoutBaseName()); + return "GET".equalsIgnoreCase(httpMethod) && "".equals(pathWithoutBaseName()); } /** diff --git a/modules/swagger-codegen/src/main/resources/scala/api.mustache b/modules/swagger-codegen/src/main/resources/scala/api.mustache index 32b8ff5fa51..68caa44bf68 100644 --- a/modules/swagger-codegen/src/main/resources/scala/api.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/api.mustache @@ -95,7 +95,7 @@ class {{classname}}AsyncHelper(client: TransportClient, config: SwaggerConfig) e {{#operation}} def {{operationId}}({{#allParams}}{{^required}}{{paramName}}: Option[{{dataType}}] = {{#defaultValue}}Some({{defaultValue}}){{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{#hasMore}},{{/hasMore}} {{/required}}{{#required}}{{paramName}}: {{dataType}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#hasMore}}, - {{/hasMore}}{{/required}}{{/allParams}})(implicit reader: ClientResponseReader[{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}]{{#bodyParams}}, writer: RequestWriter[{{dataType}}]{{/bodyParams}}){{#returnType}}: Future[{{returnType}}]{{/returnType}}{{^returnType}}: Future[Unit]{{/returnType}} = { + {{/hasMore}}{{/required}}{{/allParams}})(implicit reader: ClientResponseReader[{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}]{{#bodyParams}}, writer: RequestWriter[{{^required}}Option[{{dataType}}]{{/required}}{{#required}}{{dataType}}{{/required}}]{{/bodyParams}}){{#returnType}}: Future[{{returnType}}]{{/returnType}}{{^returnType}}: Future[Unit]{{/returnType}} = { // create path and map variables val path = (addFmt("{{path}}"){{#pathParams}} replaceAll("\\{" + "{{baseName}}" + "\\}", {{paramName}}.toString){{/pathParams}}) From 72abb20f2e76534edd9e94beb57875e9c16faae7 Mon Sep 17 00:00:00 2001 From: antihax Date: Sun, 14 Jan 2018 03:00:17 -0600 Subject: [PATCH 33/65] [Go] Fix operation files clobbering model files. [2.4.0] (#7337) * Prevent operation files clobbering model files. * Update Tests --- .../codegen/languages/AbstractGoCodegen.java | 8 +- .../codegen/languages/GoClientCodegen.java | 4 +- .../{api_client.mustache => client.mustache} | 0 ...pi_response.mustache => response.mustache} | 0 .../go/go-petstore/.swagger-codegen/VERSION | 2 +- .../petstore/go/go-petstore/api/swagger.yaml | 8 +- ...nother_fake_api.go => api_another_fake.go} | 0 .../petstore/go/go-petstore/api_client.go | 441 ------------------ .../go-petstore/{fake_api.go => api_fake.go} | 0 ...3_api.go => api_fake_classname_tags123.go} | 0 .../go/go-petstore/{pet_api.go => api_pet.go} | 0 .../{store_api.go => api_store.go} | 0 .../go-petstore/{user_api.go => api_user.go} | 0 .../client/petstore/go/go-petstore/client.go | 430 ++++++++++++++++- ...o => model_additional_properties_class.go} | 0 .../{animal.go => model_animal.go} | 0 .../{animal_farm.go => model_animal_farm.go} | 0 ...=> model_array_of_array_of_number_only.go} | 0 ..._only.go => model_array_of_number_only.go} | 0 .../{array_test.go => model_array_test.go} | 0 ...italization.go => model_capitalization.go} | 0 .../go/go-petstore/{cat.go => model_cat.go} | 0 .../{category.go => model_category.go} | 0 .../{class_model.go => model_class_model.go} | 0 .../petstore/go/go-petstore/model_client.go | 15 + .../go/go-petstore/{dog.go => model_dog.go} | 0 .../{enum_arrays.go => model_enum_arrays.go} | 0 .../{enum_class.go => model_enum_class.go} | 0 .../{enum_test.go => model_enum_test.go} | 0 .../{format_test.go => model_format_test.go} | 0 ...ad_only.go => model_has_only_read_only.go} | 0 .../go/go-petstore/{list.go => model_list.go} | 0 .../{map_test.go => model_map_test.go} | 0 ...erties_and_additional_properties_class.go} | 0 .../go/go-petstore/{name.go => model_name.go} | 0 .../{number_only.go => model_number_only.go} | 0 .../go-petstore/{order.go => model_order.go} | 0 ...uter_boolean.go => model_outer_boolean.go} | 0 ..._composite.go => model_outer_composite.go} | 0 .../{outer_enum.go => model_outer_enum.go} | 0 ...{outer_number.go => model_outer_number.go} | 0 ...{outer_string.go => model_outer_string.go} | 0 .../go/go-petstore/{pet.go => model_pet.go} | 0 ...only_first.go => model_read_only_first.go} | 0 ...el_name.go => model_special_model_name.go} | 0 .../go/go-petstore/{tag.go => model_tag.go} | 0 .../go/go-petstore/{user.go => model_user.go} | 0 .../{api_response.go => response.go} | 0 .../go-api-server/.swagger-codegen/VERSION | 2 +- .../petstore/go-api-server/api/swagger.yaml | 2 +- .../petstore/go-api-server/go/README.md | 1 - .../go/{pet_api.go => api_pet.go} | 0 .../go/{store_api.go => api_store.go} | 0 .../go/{user_api.go => api_user.go} | 0 ...{api_response.go => model_api_response.go} | 0 .../go/{category.go => model_category.go} | 0 .../go/{order.go => model_order.go} | 0 .../go-api-server/go/{pet.go => model_pet.go} | 0 .../go-api-server/go/{tag.go => model_tag.go} | 0 .../go/{user.go => model_user.go} | 0 60 files changed, 458 insertions(+), 455 deletions(-) rename modules/swagger-codegen/src/main/resources/go/{api_client.mustache => client.mustache} (100%) rename modules/swagger-codegen/src/main/resources/go/{api_response.mustache => response.mustache} (100%) rename samples/client/petstore/go/go-petstore/{another_fake_api.go => api_another_fake.go} (100%) delete mode 100644 samples/client/petstore/go/go-petstore/api_client.go rename samples/client/petstore/go/go-petstore/{fake_api.go => api_fake.go} (100%) rename samples/client/petstore/go/go-petstore/{fake_classname_tags123_api.go => api_fake_classname_tags123.go} (100%) rename samples/client/petstore/go/go-petstore/{pet_api.go => api_pet.go} (100%) rename samples/client/petstore/go/go-petstore/{store_api.go => api_store.go} (100%) rename samples/client/petstore/go/go-petstore/{user_api.go => api_user.go} (100%) rename samples/client/petstore/go/go-petstore/{additional_properties_class.go => model_additional_properties_class.go} (100%) rename samples/client/petstore/go/go-petstore/{animal.go => model_animal.go} (100%) rename samples/client/petstore/go/go-petstore/{animal_farm.go => model_animal_farm.go} (100%) rename samples/client/petstore/go/go-petstore/{array_of_array_of_number_only.go => model_array_of_array_of_number_only.go} (100%) rename samples/client/petstore/go/go-petstore/{array_of_number_only.go => model_array_of_number_only.go} (100%) rename samples/client/petstore/go/go-petstore/{array_test.go => model_array_test.go} (100%) rename samples/client/petstore/go/go-petstore/{capitalization.go => model_capitalization.go} (100%) rename samples/client/petstore/go/go-petstore/{cat.go => model_cat.go} (100%) rename samples/client/petstore/go/go-petstore/{category.go => model_category.go} (100%) rename samples/client/petstore/go/go-petstore/{class_model.go => model_class_model.go} (100%) create mode 100644 samples/client/petstore/go/go-petstore/model_client.go rename samples/client/petstore/go/go-petstore/{dog.go => model_dog.go} (100%) rename samples/client/petstore/go/go-petstore/{enum_arrays.go => model_enum_arrays.go} (100%) rename samples/client/petstore/go/go-petstore/{enum_class.go => model_enum_class.go} (100%) rename samples/client/petstore/go/go-petstore/{enum_test.go => model_enum_test.go} (100%) rename samples/client/petstore/go/go-petstore/{format_test.go => model_format_test.go} (100%) rename samples/client/petstore/go/go-petstore/{has_only_read_only.go => model_has_only_read_only.go} (100%) rename samples/client/petstore/go/go-petstore/{list.go => model_list.go} (100%) rename samples/client/petstore/go/go-petstore/{map_test.go => model_map_test.go} (100%) rename samples/client/petstore/go/go-petstore/{mixed_properties_and_additional_properties_class.go => model_mixed_properties_and_additional_properties_class.go} (100%) rename samples/client/petstore/go/go-petstore/{name.go => model_name.go} (100%) rename samples/client/petstore/go/go-petstore/{number_only.go => model_number_only.go} (100%) rename samples/client/petstore/go/go-petstore/{order.go => model_order.go} (100%) rename samples/client/petstore/go/go-petstore/{outer_boolean.go => model_outer_boolean.go} (100%) rename samples/client/petstore/go/go-petstore/{outer_composite.go => model_outer_composite.go} (100%) rename samples/client/petstore/go/go-petstore/{outer_enum.go => model_outer_enum.go} (100%) rename samples/client/petstore/go/go-petstore/{outer_number.go => model_outer_number.go} (100%) rename samples/client/petstore/go/go-petstore/{outer_string.go => model_outer_string.go} (100%) rename samples/client/petstore/go/go-petstore/{pet.go => model_pet.go} (100%) rename samples/client/petstore/go/go-petstore/{read_only_first.go => model_read_only_first.go} (100%) rename samples/client/petstore/go/go-petstore/{special_model_name.go => model_special_model_name.go} (100%) rename samples/client/petstore/go/go-petstore/{tag.go => model_tag.go} (100%) rename samples/client/petstore/go/go-petstore/{user.go => model_user.go} (100%) rename samples/client/petstore/go/go-petstore/{api_response.go => response.go} (100%) rename samples/server/petstore/go-api-server/go/{pet_api.go => api_pet.go} (100%) rename samples/server/petstore/go-api-server/go/{store_api.go => api_store.go} (100%) rename samples/server/petstore/go-api-server/go/{user_api.go => api_user.go} (100%) rename samples/server/petstore/go-api-server/go/{api_response.go => model_api_response.go} (100%) rename samples/server/petstore/go-api-server/go/{category.go => model_category.go} (100%) rename samples/server/petstore/go-api-server/go/{order.go => model_order.go} (100%) rename samples/server/petstore/go-api-server/go/{pet.go => model_pet.go} (100%) rename samples/server/petstore/go-api-server/go/{tag.go => model_tag.go} (100%) rename samples/server/petstore/go-api-server/go/{user.go => model_user.go} (100%) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractGoCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractGoCodegen.java index 73d99e60a28..0dda8be7438 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractGoCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractGoCodegen.java @@ -152,11 +152,15 @@ public String toParamName(String name) { public String toModelName(String name) { // camelize the model name // phone_number => PhoneNumber - return camelize(toModelFilename(name)); + return camelize(toModel(name)); } @Override public String toModelFilename(String name) { + return toModel("model_" + name); + } + + public String toModel(String name) { if (!StringUtils.isEmpty(modelNamePrefix)) { name = modelNamePrefix + "_" + name; } @@ -188,7 +192,7 @@ public String toApiFilename(String name) { name = name.replaceAll("-", "_"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. // e.g. PetApi.go => pet_api.go - return underscore(name) + "_api"; + return "api_" + underscore(name); } /** diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java index 8ee82ceb485..74d743bcf11 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java @@ -92,8 +92,8 @@ public void processOpts() { supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.go")); - supportingFiles.add(new SupportingFile("api_client.mustache", "", "api_client.go")); - supportingFiles.add(new SupportingFile("api_response.mustache", "", "api_response.go")); + supportingFiles.add(new SupportingFile("client.mustache", "", "client.go")); + supportingFiles.add(new SupportingFile("response.mustache", "", "response.go")); supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml")); } diff --git a/modules/swagger-codegen/src/main/resources/go/api_client.mustache b/modules/swagger-codegen/src/main/resources/go/client.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/go/api_client.mustache rename to modules/swagger-codegen/src/main/resources/go/client.mustache diff --git a/modules/swagger-codegen/src/main/resources/go/api_response.mustache b/modules/swagger-codegen/src/main/resources/go/response.mustache similarity index 100% rename from modules/swagger-codegen/src/main/resources/go/api_response.mustache rename to modules/swagger-codegen/src/main/resources/go/response.mustache diff --git a/samples/client/petstore/go/go-petstore/.swagger-codegen/VERSION b/samples/client/petstore/go/go-petstore/.swagger-codegen/VERSION index f9f7450d135..855ff9501eb 100644 --- a/samples/client/petstore/go/go-petstore/.swagger-codegen/VERSION +++ b/samples/client/petstore/go/go-petstore/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore/api/swagger.yaml b/samples/client/petstore/go/go-petstore/api/swagger.yaml index 7edbe6eb94a..2875d7c7c1e 100644 --- a/samples/client/petstore/go/go-petstore/api/swagger.yaml +++ b/samples/client/petstore/go/go-petstore/api/swagger.yaml @@ -107,11 +107,11 @@ paths: type: "array" items: type: "string" - default: "available" enum: - "available" - "pending" - "sold" + default: "available" collectionFormat: "csv" x-exportParamName: "Status" responses: @@ -634,10 +634,10 @@ paths: type: "array" items: type: "string" - default: "$" enum: - ">" - "$" + default: "$" x-exportParamName: "EnumFormStringArray" - name: "enum_form_string" in: "formData" @@ -657,10 +657,10 @@ paths: type: "array" items: type: "string" - default: "$" enum: - ">" - "$" + default: "$" x-exportParamName: "EnumHeaderStringArray" - name: "enum_header_string" in: "header" @@ -680,10 +680,10 @@ paths: type: "array" items: type: "string" - default: "$" enum: - ">" - "$" + default: "$" x-exportParamName: "EnumQueryStringArray" - name: "enum_query_string" in: "query" diff --git a/samples/client/petstore/go/go-petstore/another_fake_api.go b/samples/client/petstore/go/go-petstore/api_another_fake.go similarity index 100% rename from samples/client/petstore/go/go-petstore/another_fake_api.go rename to samples/client/petstore/go/go-petstore/api_another_fake.go diff --git a/samples/client/petstore/go/go-petstore/api_client.go b/samples/client/petstore/go/go-petstore/api_client.go deleted file mode 100644 index d2f8f3092c3..00000000000 --- a/samples/client/petstore/go/go-petstore/api_client.go +++ /dev/null @@ -1,441 +0,0 @@ -/* - * 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: \" \\ - * - * API version: 1.0.0 - * Contact: apiteam@swagger.io - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package petstore - -import ( - "bytes" - "encoding/json" - "encoding/xml" - "errors" - "fmt" - "io" - "mime/multipart" - "net/http" - "net/url" - "os" - "path/filepath" - "reflect" - "regexp" - "strconv" - "strings" - "time" - "unicode/utf8" - - "golang.org/x/net/context" - "golang.org/x/oauth2" -) - -var ( - jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") - xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") -) - -// APIClient manages communication with the Swagger Petstore API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - - AnotherFakeApi *AnotherFakeApiService - - FakeApi *FakeApiService - - FakeClassnameTags123Api *FakeClassnameTags123ApiService - - PetApi *PetApiService - - StoreApi *StoreApiService - - UserApi *UserApiService -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.HTTPClient == nil { - cfg.HTTPClient = http.DefaultClient - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.AnotherFakeApi = (*AnotherFakeApiService)(&c.common) - c.FakeApi = (*FakeApiService)(&c.common) - c.FakeClassnameTags123Api = (*FakeClassnameTags123ApiService)(&c.common) - c.PetApi = (*PetApiService)(&c.common) - c.StoreApi = (*StoreApiService)(&c.common) - c.UserApi = (*UserApiService)(&c.common) - - return c -} - -func atoi(in string) (int, error) { - return strconv.Atoi(in) -} - -// selectHeaderContentType select a content type from the available list. -func selectHeaderContentType(contentTypes []string) string { - if len(contentTypes) == 0 { - return "" - } - if contains(contentTypes, "application/json") { - return "application/json" - } - return contentTypes[0] // use the first content type specified in 'consumes' -} - -// selectHeaderAccept join all accept types and return -func selectHeaderAccept(accepts []string) string { - if len(accepts) == 0 { - return "" - } - - if contains(accepts, "application/json") { - return "application/json" - } - - return strings.Join(accepts, ",") -} - -// contains is a case insenstive match, finding needle in a haystack -func contains(haystack []string, needle string) bool { - for _, a := range haystack { - if strings.ToLower(a) == strings.ToLower(needle) { - return true - } - } - return false -} - -// Verify optional parameters are of the correct type. -func typeCheckParameter(obj interface{}, expected string, name string) error { - // Make sure there is an object. - if obj == nil { - return nil - } - - // Check the type is as expected. - if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) - } - return nil -} - -// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. -func parameterToString(obj interface{}, collectionFormat string) string { - var delimiter string - - switch collectionFormat { - case "pipes": - delimiter = "|" - case "ssv": - delimiter = " " - case "tsv": - delimiter = "\t" - case "csv": - delimiter = "," - } - - if reflect.TypeOf(obj).Kind() == reflect.Slice { - return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") - } - - return fmt.Sprintf("%v", obj) -} - -// callAPI do the request. -func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - return c.cfg.HTTPClient.Do(request) -} - -// Change base path to allow switching to mocks -func (c *APIClient) ChangeBasePath(path string) { - c.cfg.BasePath = path -} - -// prepareRequest build the request -func (c *APIClient) prepareRequest( - ctx context.Context, - path string, method string, - postBody interface{}, - headerParams map[string]string, - queryParams url.Values, - formParams url.Values, - fileName string, - fileBytes []byte) (localVarRequest *http.Request, err error) { - - var body *bytes.Buffer - - // Detect postBody type and post. - if postBody != nil { - contentType := headerParams["Content-Type"] - if contentType == "" { - contentType = detectContentType(postBody) - headerParams["Content-Type"] = contentType - } - - body, err = setBody(postBody, contentType) - if err != nil { - return nil, err - } - } - - // add form parameters and file if available. - if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { - if body != nil { - return nil, errors.New("Cannot specify postBody and multipart form at the same time.") - } - body = &bytes.Buffer{} - w := multipart.NewWriter(body) - - for k, v := range formParams { - for _, iv := range v { - if strings.HasPrefix(k, "@") { // file - err = addFile(w, k[1:], iv) - if err != nil { - return nil, err - } - } else { // form value - w.WriteField(k, iv) - } - } - } - if len(fileBytes) > 0 && fileName != "" { - w.Boundary() - //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile("file", filepath.Base(fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(fileBytes) - if err != nil { - return nil, err - } - // Set the Boundary in the Content-Type - headerParams["Content-Type"] = w.FormDataContentType() - } - - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - w.Close() - } - - // Setup path and query parameters - url, err := url.Parse(path) - if err != nil { - return nil, err - } - - // Adding Query Param - query := url.Query() - for k, v := range queryParams { - for _, iv := range v { - query.Add(k, iv) - } - } - - // Encode the parameters. - url.RawQuery = query.Encode() - - // Generate a new request - if body != nil { - localVarRequest, err = http.NewRequest(method, url.String(), body) - } else { - localVarRequest, err = http.NewRequest(method, url.String(), nil) - } - if err != nil { - return nil, err - } - - // add header parameters, if any - if len(headerParams) > 0 { - headers := http.Header{} - for h, v := range headerParams { - headers.Set(h, v) - } - localVarRequest.Header = headers - } - - // Override request host, if applicable - if c.cfg.Host != "" { - localVarRequest.Host = c.cfg.Host - } - - // Add the user agent to the request. - localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - - if ctx != nil { - // add context to the request - localVarRequest = localVarRequest.WithContext(ctx) - - // Walk through any authentication. - - // OAuth2 authentication - if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { - // We were able to grab an oauth2 token from the context - var latestToken *oauth2.Token - if latestToken, err = tok.Token(); err != nil { - return nil, err - } - - latestToken.SetAuthHeader(localVarRequest) - } - - // Basic HTTP Authentication - if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { - localVarRequest.SetBasicAuth(auth.UserName, auth.Password) - } - - // AccessToken Authentication - if auth, ok := ctx.Value(ContextAccessToken).(string); ok { - localVarRequest.Header.Add("Authorization", "Bearer "+auth) - } - } - - for header, value := range c.cfg.DefaultHeader { - localVarRequest.Header.Add(header, value) - } - - return localVarRequest, nil -} - -// Add a file to the multipart request -func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(path) - if err != nil { - return err - } - defer file.Close() - - part, err := w.CreateFormFile(fieldName, filepath.Base(path)) - if err != nil { - return err - } - _, err = io.Copy(part, file) - - return err -} - -// Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) error { - return fmt.Errorf(format, a...) -} - -// Set request body from an interface{} -func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { - if bodyBuf == nil { - bodyBuf = &bytes.Buffer{} - } - - if reader, ok := body.(io.Reader); ok { - _, err = bodyBuf.ReadFrom(reader) - } else if b, ok := body.([]byte); ok { - _, err = bodyBuf.Write(b) - } else if s, ok := body.(string); ok { - _, err = bodyBuf.WriteString(s) - } else if jsonCheck.MatchString(contentType) { - err = json.NewEncoder(bodyBuf).Encode(body) - } else if xmlCheck.MatchString(contentType) { - xml.NewEncoder(bodyBuf).Encode(body) - } - - if err != nil { - return nil, err - } - - if bodyBuf.Len() == 0 { - err = fmt.Errorf("Invalid body type %s\n", contentType) - return nil, err - } - return bodyBuf, nil -} - -// detectContentType method is used to figure out `Request.Body` content type for request header -func detectContentType(body interface{}) string { - contentType := "text/plain; charset=utf-8" - kind := reflect.TypeOf(body).Kind() - - switch kind { - case reflect.Struct, reflect.Map, reflect.Ptr: - contentType = "application/json; charset=utf-8" - case reflect.String: - contentType = "text/plain; charset=utf-8" - default: - if b, ok := body.([]byte); ok { - contentType = http.DetectContentType(b) - } else if kind == reflect.Slice { - contentType = "application/json; charset=utf-8" - } - } - - return contentType -} - -// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go -type cacheControl map[string]string - -func parseCacheControl(headers http.Header) cacheControl { - cc := cacheControl{} - ccHeader := headers.Get("Cache-Control") - for _, part := range strings.Split(ccHeader, ",") { - part = strings.Trim(part, " ") - if part == "" { - continue - } - if strings.ContainsRune(part, '=') { - keyval := strings.Split(part, "=") - cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") - } else { - cc[part] = "" - } - } - return cc -} - -// CacheExpires helper function to determine remaining time before repeating a request. -func CacheExpires(r *http.Response) time.Time { - // Figure out when the cache expires. - var expires time.Time - now, err := time.Parse(time.RFC1123, r.Header.Get("date")) - if err != nil { - return time.Now() - } - respCacheControl := parseCacheControl(r.Header) - - if maxAge, ok := respCacheControl["max-age"]; ok { - lifetime, err := time.ParseDuration(maxAge + "s") - if err != nil { - expires = now - } - expires = now.Add(lifetime) - } else { - expiresHeader := r.Header.Get("Expires") - if expiresHeader != "" { - expires, err = time.Parse(time.RFC1123, expiresHeader) - if err != nil { - expires = now - } - } - } - return expires -} - -func strlen(s string) int { - return utf8.RuneCountInString(s) -} diff --git a/samples/client/petstore/go/go-petstore/fake_api.go b/samples/client/petstore/go/go-petstore/api_fake.go similarity index 100% rename from samples/client/petstore/go/go-petstore/fake_api.go rename to samples/client/petstore/go/go-petstore/api_fake.go diff --git a/samples/client/petstore/go/go-petstore/fake_classname_tags123_api.go b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go similarity index 100% rename from samples/client/petstore/go/go-petstore/fake_classname_tags123_api.go rename to samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go diff --git a/samples/client/petstore/go/go-petstore/pet_api.go b/samples/client/petstore/go/go-petstore/api_pet.go similarity index 100% rename from samples/client/petstore/go/go-petstore/pet_api.go rename to samples/client/petstore/go/go-petstore/api_pet.go diff --git a/samples/client/petstore/go/go-petstore/store_api.go b/samples/client/petstore/go/go-petstore/api_store.go similarity index 100% rename from samples/client/petstore/go/go-petstore/store_api.go rename to samples/client/petstore/go/go-petstore/api_store.go diff --git a/samples/client/petstore/go/go-petstore/user_api.go b/samples/client/petstore/go/go-petstore/api_user.go similarity index 100% rename from samples/client/petstore/go/go-petstore/user_api.go rename to samples/client/petstore/go/go-petstore/api_user.go diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index fb393f1f9ce..d2f8f3092c3 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -10,6 +10,432 @@ package petstore -type Client struct { - Client string `json:"client,omitempty"` +import ( + "bytes" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "mime/multipart" + "net/http" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "golang.org/x/net/context" + "golang.org/x/oauth2" +) + +var ( + jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") + xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") +) + +// APIClient manages communication with the Swagger Petstore API v1.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + AnotherFakeApi *AnotherFakeApiService + + FakeApi *FakeApiService + + FakeClassnameTags123Api *FakeClassnameTags123ApiService + + PetApi *PetApiService + + StoreApi *StoreApiService + + UserApi *UserApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.AnotherFakeApi = (*AnotherFakeApiService)(&c.common) + c.FakeApi = (*FakeApiService)(&c.common) + c.FakeClassnameTags123Api = (*FakeClassnameTags123ApiService)(&c.common) + c.PetApi = (*PetApiService)(&c.common) + c.StoreApi = (*StoreApiService)(&c.common) + c.UserApi = (*UserApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insenstive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. +func parameterToString(obj interface{}, collectionFormat string) string { + var delimiter string + + switch collectionFormat { + case "pipes": + delimiter = "|" + case "ssv": + delimiter = " " + case "tsv": + delimiter = "\t" + case "csv": + delimiter = "," + } + + if reflect.TypeOf(obj).Kind() == reflect.Slice { + return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } + + return fmt.Sprintf("%v", obj) +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + return c.cfg.HTTPClient.Do(request) +} + +// Change base path to allow switching to mocks +func (c *APIClient) ChangeBasePath(path string) { + c.cfg.BasePath = path +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + fileName string, + fileBytes []byte) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + if len(fileBytes) > 0 && fileName != "" { + w.Boundary() + //_, fileNm := filepath.Split(fileName) + part, err := w.CreateFormFile("file", filepath.Base(fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(fileBytes) + if err != nil { + return nil, err + } + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + } + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = query.Encode() + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers.Set(h, v) + } + localVarRequest.Header = headers + } + + // Override request host, if applicable + if c.cfg.Host != "" { + localVarRequest.Host = c.cfg.Host + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + + return localVarRequest, nil +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("Invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } + expires = now.Add(lifetime) + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) } diff --git a/samples/client/petstore/go/go-petstore/additional_properties_class.go b/samples/client/petstore/go/go-petstore/model_additional_properties_class.go similarity index 100% rename from samples/client/petstore/go/go-petstore/additional_properties_class.go rename to samples/client/petstore/go/go-petstore/model_additional_properties_class.go diff --git a/samples/client/petstore/go/go-petstore/animal.go b/samples/client/petstore/go/go-petstore/model_animal.go similarity index 100% rename from samples/client/petstore/go/go-petstore/animal.go rename to samples/client/petstore/go/go-petstore/model_animal.go diff --git a/samples/client/petstore/go/go-petstore/animal_farm.go b/samples/client/petstore/go/go-petstore/model_animal_farm.go similarity index 100% rename from samples/client/petstore/go/go-petstore/animal_farm.go rename to samples/client/petstore/go/go-petstore/model_animal_farm.go diff --git a/samples/client/petstore/go/go-petstore/array_of_array_of_number_only.go b/samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go similarity index 100% rename from samples/client/petstore/go/go-petstore/array_of_array_of_number_only.go rename to samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go diff --git a/samples/client/petstore/go/go-petstore/array_of_number_only.go b/samples/client/petstore/go/go-petstore/model_array_of_number_only.go similarity index 100% rename from samples/client/petstore/go/go-petstore/array_of_number_only.go rename to samples/client/petstore/go/go-petstore/model_array_of_number_only.go diff --git a/samples/client/petstore/go/go-petstore/array_test.go b/samples/client/petstore/go/go-petstore/model_array_test.go similarity index 100% rename from samples/client/petstore/go/go-petstore/array_test.go rename to samples/client/petstore/go/go-petstore/model_array_test.go diff --git a/samples/client/petstore/go/go-petstore/capitalization.go b/samples/client/petstore/go/go-petstore/model_capitalization.go similarity index 100% rename from samples/client/petstore/go/go-petstore/capitalization.go rename to samples/client/petstore/go/go-petstore/model_capitalization.go diff --git a/samples/client/petstore/go/go-petstore/cat.go b/samples/client/petstore/go/go-petstore/model_cat.go similarity index 100% rename from samples/client/petstore/go/go-petstore/cat.go rename to samples/client/petstore/go/go-petstore/model_cat.go diff --git a/samples/client/petstore/go/go-petstore/category.go b/samples/client/petstore/go/go-petstore/model_category.go similarity index 100% rename from samples/client/petstore/go/go-petstore/category.go rename to samples/client/petstore/go/go-petstore/model_category.go diff --git a/samples/client/petstore/go/go-petstore/class_model.go b/samples/client/petstore/go/go-petstore/model_class_model.go similarity index 100% rename from samples/client/petstore/go/go-petstore/class_model.go rename to samples/client/petstore/go/go-petstore/model_class_model.go diff --git a/samples/client/petstore/go/go-petstore/model_client.go b/samples/client/petstore/go/go-petstore/model_client.go new file mode 100644 index 00000000000..fb393f1f9ce --- /dev/null +++ b/samples/client/petstore/go/go-petstore/model_client.go @@ -0,0 +1,15 @@ +/* + * 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: \" \\ + * + * API version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package petstore + +type Client struct { + Client string `json:"client,omitempty"` +} diff --git a/samples/client/petstore/go/go-petstore/dog.go b/samples/client/petstore/go/go-petstore/model_dog.go similarity index 100% rename from samples/client/petstore/go/go-petstore/dog.go rename to samples/client/petstore/go/go-petstore/model_dog.go diff --git a/samples/client/petstore/go/go-petstore/enum_arrays.go b/samples/client/petstore/go/go-petstore/model_enum_arrays.go similarity index 100% rename from samples/client/petstore/go/go-petstore/enum_arrays.go rename to samples/client/petstore/go/go-petstore/model_enum_arrays.go diff --git a/samples/client/petstore/go/go-petstore/enum_class.go b/samples/client/petstore/go/go-petstore/model_enum_class.go similarity index 100% rename from samples/client/petstore/go/go-petstore/enum_class.go rename to samples/client/petstore/go/go-petstore/model_enum_class.go diff --git a/samples/client/petstore/go/go-petstore/enum_test.go b/samples/client/petstore/go/go-petstore/model_enum_test.go similarity index 100% rename from samples/client/petstore/go/go-petstore/enum_test.go rename to samples/client/petstore/go/go-petstore/model_enum_test.go diff --git a/samples/client/petstore/go/go-petstore/format_test.go b/samples/client/petstore/go/go-petstore/model_format_test.go similarity index 100% rename from samples/client/petstore/go/go-petstore/format_test.go rename to samples/client/petstore/go/go-petstore/model_format_test.go diff --git a/samples/client/petstore/go/go-petstore/has_only_read_only.go b/samples/client/petstore/go/go-petstore/model_has_only_read_only.go similarity index 100% rename from samples/client/petstore/go/go-petstore/has_only_read_only.go rename to samples/client/petstore/go/go-petstore/model_has_only_read_only.go diff --git a/samples/client/petstore/go/go-petstore/list.go b/samples/client/petstore/go/go-petstore/model_list.go similarity index 100% rename from samples/client/petstore/go/go-petstore/list.go rename to samples/client/petstore/go/go-petstore/model_list.go diff --git a/samples/client/petstore/go/go-petstore/map_test.go b/samples/client/petstore/go/go-petstore/model_map_test.go similarity index 100% rename from samples/client/petstore/go/go-petstore/map_test.go rename to samples/client/petstore/go/go-petstore/model_map_test.go diff --git a/samples/client/petstore/go/go-petstore/mixed_properties_and_additional_properties_class.go b/samples/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go similarity index 100% rename from samples/client/petstore/go/go-petstore/mixed_properties_and_additional_properties_class.go rename to samples/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go diff --git a/samples/client/petstore/go/go-petstore/name.go b/samples/client/petstore/go/go-petstore/model_name.go similarity index 100% rename from samples/client/petstore/go/go-petstore/name.go rename to samples/client/petstore/go/go-petstore/model_name.go diff --git a/samples/client/petstore/go/go-petstore/number_only.go b/samples/client/petstore/go/go-petstore/model_number_only.go similarity index 100% rename from samples/client/petstore/go/go-petstore/number_only.go rename to samples/client/petstore/go/go-petstore/model_number_only.go diff --git a/samples/client/petstore/go/go-petstore/order.go b/samples/client/petstore/go/go-petstore/model_order.go similarity index 100% rename from samples/client/petstore/go/go-petstore/order.go rename to samples/client/petstore/go/go-petstore/model_order.go diff --git a/samples/client/petstore/go/go-petstore/outer_boolean.go b/samples/client/petstore/go/go-petstore/model_outer_boolean.go similarity index 100% rename from samples/client/petstore/go/go-petstore/outer_boolean.go rename to samples/client/petstore/go/go-petstore/model_outer_boolean.go diff --git a/samples/client/petstore/go/go-petstore/outer_composite.go b/samples/client/petstore/go/go-petstore/model_outer_composite.go similarity index 100% rename from samples/client/petstore/go/go-petstore/outer_composite.go rename to samples/client/petstore/go/go-petstore/model_outer_composite.go diff --git a/samples/client/petstore/go/go-petstore/outer_enum.go b/samples/client/petstore/go/go-petstore/model_outer_enum.go similarity index 100% rename from samples/client/petstore/go/go-petstore/outer_enum.go rename to samples/client/petstore/go/go-petstore/model_outer_enum.go diff --git a/samples/client/petstore/go/go-petstore/outer_number.go b/samples/client/petstore/go/go-petstore/model_outer_number.go similarity index 100% rename from samples/client/petstore/go/go-petstore/outer_number.go rename to samples/client/petstore/go/go-petstore/model_outer_number.go diff --git a/samples/client/petstore/go/go-petstore/outer_string.go b/samples/client/petstore/go/go-petstore/model_outer_string.go similarity index 100% rename from samples/client/petstore/go/go-petstore/outer_string.go rename to samples/client/petstore/go/go-petstore/model_outer_string.go diff --git a/samples/client/petstore/go/go-petstore/pet.go b/samples/client/petstore/go/go-petstore/model_pet.go similarity index 100% rename from samples/client/petstore/go/go-petstore/pet.go rename to samples/client/petstore/go/go-petstore/model_pet.go diff --git a/samples/client/petstore/go/go-petstore/read_only_first.go b/samples/client/petstore/go/go-petstore/model_read_only_first.go similarity index 100% rename from samples/client/petstore/go/go-petstore/read_only_first.go rename to samples/client/petstore/go/go-petstore/model_read_only_first.go diff --git a/samples/client/petstore/go/go-petstore/special_model_name.go b/samples/client/petstore/go/go-petstore/model_special_model_name.go similarity index 100% rename from samples/client/petstore/go/go-petstore/special_model_name.go rename to samples/client/petstore/go/go-petstore/model_special_model_name.go diff --git a/samples/client/petstore/go/go-petstore/tag.go b/samples/client/petstore/go/go-petstore/model_tag.go similarity index 100% rename from samples/client/petstore/go/go-petstore/tag.go rename to samples/client/petstore/go/go-petstore/model_tag.go diff --git a/samples/client/petstore/go/go-petstore/user.go b/samples/client/petstore/go/go-petstore/model_user.go similarity index 100% rename from samples/client/petstore/go/go-petstore/user.go rename to samples/client/petstore/go/go-petstore/model_user.go diff --git a/samples/client/petstore/go/go-petstore/api_response.go b/samples/client/petstore/go/go-petstore/response.go similarity index 100% rename from samples/client/petstore/go/go-petstore/api_response.go rename to samples/client/petstore/go/go-petstore/response.go diff --git a/samples/server/petstore/go-api-server/.swagger-codegen/VERSION b/samples/server/petstore/go-api-server/.swagger-codegen/VERSION index f9f7450d135..855ff9501eb 100644 --- a/samples/server/petstore/go-api-server/.swagger-codegen/VERSION +++ b/samples/server/petstore/go-api-server/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-api-server/api/swagger.yaml b/samples/server/petstore/go-api-server/api/swagger.yaml index 33babbaaeca..e7316ede7bf 100644 --- a/samples/server/petstore/go-api-server/api/swagger.yaml +++ b/samples/server/petstore/go-api-server/api/swagger.yaml @@ -108,11 +108,11 @@ paths: type: "array" items: type: "string" - default: "available" enum: - "available" - "pending" - "sold" + default: "available" collectionFormat: "csv" x-exportParamName: "Status" responses: diff --git a/samples/server/petstore/go-api-server/go/README.md b/samples/server/petstore/go-api-server/go/README.md index 81e395ff5a9..100f2503789 100644 --- a/samples/server/petstore/go-api-server/go/README.md +++ b/samples/server/petstore/go-api-server/go/README.md @@ -13,7 +13,6 @@ To see how to make this your own, look here: [README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) - API version: 1.0.0 -- Build date: 2017-12-20T21:53:07.200Z ### Running the server diff --git a/samples/server/petstore/go-api-server/go/pet_api.go b/samples/server/petstore/go-api-server/go/api_pet.go similarity index 100% rename from samples/server/petstore/go-api-server/go/pet_api.go rename to samples/server/petstore/go-api-server/go/api_pet.go diff --git a/samples/server/petstore/go-api-server/go/store_api.go b/samples/server/petstore/go-api-server/go/api_store.go similarity index 100% rename from samples/server/petstore/go-api-server/go/store_api.go rename to samples/server/petstore/go-api-server/go/api_store.go diff --git a/samples/server/petstore/go-api-server/go/user_api.go b/samples/server/petstore/go-api-server/go/api_user.go similarity index 100% rename from samples/server/petstore/go-api-server/go/user_api.go rename to samples/server/petstore/go-api-server/go/api_user.go diff --git a/samples/server/petstore/go-api-server/go/api_response.go b/samples/server/petstore/go-api-server/go/model_api_response.go similarity index 100% rename from samples/server/petstore/go-api-server/go/api_response.go rename to samples/server/petstore/go-api-server/go/model_api_response.go diff --git a/samples/server/petstore/go-api-server/go/category.go b/samples/server/petstore/go-api-server/go/model_category.go similarity index 100% rename from samples/server/petstore/go-api-server/go/category.go rename to samples/server/petstore/go-api-server/go/model_category.go diff --git a/samples/server/petstore/go-api-server/go/order.go b/samples/server/petstore/go-api-server/go/model_order.go similarity index 100% rename from samples/server/petstore/go-api-server/go/order.go rename to samples/server/petstore/go-api-server/go/model_order.go diff --git a/samples/server/petstore/go-api-server/go/pet.go b/samples/server/petstore/go-api-server/go/model_pet.go similarity index 100% rename from samples/server/petstore/go-api-server/go/pet.go rename to samples/server/petstore/go-api-server/go/model_pet.go diff --git a/samples/server/petstore/go-api-server/go/tag.go b/samples/server/petstore/go-api-server/go/model_tag.go similarity index 100% rename from samples/server/petstore/go-api-server/go/tag.go rename to samples/server/petstore/go-api-server/go/model_tag.go diff --git a/samples/server/petstore/go-api-server/go/user.go b/samples/server/petstore/go-api-server/go/model_user.go similarity index 100% rename from samples/server/petstore/go-api-server/go/user.go rename to samples/server/petstore/go-api-server/go/model_user.go From 0f6696089fbd2bd1e869133ef3e4db3afa6eaa1f Mon Sep 17 00:00:00 2001 From: Euan Kemp Date: Sun, 14 Jan 2018 01:05:18 -0800 Subject: [PATCH 34/65] [Go] Use consistent indentation in readme (#7336) * [Go] Use consistent indentation in readme * [Go] Regenerate petstore sample --- .../src/main/resources/go/README.mustache | 46 +++++++-------- .../client/petstore/go/go-petstore/README.md | 58 +++++++++---------- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/go/README.mustache b/modules/swagger-codegen/src/main/resources/go/README.mustache index e56e410ff6a..0b2c0bdd42b 100644 --- a/modules/swagger-codegen/src/main/resources/go/README.mustache +++ b/modules/swagger-codegen/src/main/resources/go/README.mustache @@ -19,8 +19,8 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) ## Installation Put the package under your project folder and add the following in import: -``` - "./{{packageName}}" +```golang +import "./{{packageName}}" ``` ## Documentation for API Endpoints @@ -45,23 +45,23 @@ Class | Method | HTTP request | Description {{#isApiKey}}- **Type**: API key Example -``` - auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{ - Key: "APIKEY", - Prefix: "Bearer", // Omit if not necessary. - }) - r, err := client.Service.Operation(auth, args) +```golang +auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{ + Key: "APIKEY", + Prefix: "Bearer", // Omit if not necessary. +}) +r, err := client.Service.Operation(auth, args) ``` {{/isApiKey}} {{#isBasic}}- **Type**: HTTP basic authentication Example -``` - auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ - UserName: "username", - Password: "password", - }) - r, err := client.Service.Operation(auth, args) +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) ``` {{/isBasic}} {{#isOAuth}}- **Type**: OAuth @@ -72,20 +72,20 @@ Example {{/scopes}} Example -``` - auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") - r, err := client.Service.Operation(auth, args) +```golang +auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") +r, err := client.Service.Operation(auth, args) ``` Or via OAuth2 module to automatically refresh tokens and perform user authentication. -``` - import "golang.org/x/oauth2" +```golang +import "golang.org/x/oauth2" - / .. Perform OAuth2 round trip request and obtain a token .. // +/* Perform OAuth2 round trip request and obtain a token */ - tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) - auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) - r, err := client.Service.Operation(auth, args) +tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) +auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) +r, err := client.Service.Operation(auth, args) ``` {{/isOAuth}} {{/authMethods}} diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index 7f58f0ccd5e..35dea62225e 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -11,8 +11,8 @@ This API client was generated by the [swagger-codegen](https://github.com/swagge ## Installation Put the package under your project folder and add the following in import: -``` - "./petstore" +```golang +import "./petstore" ``` ## Documentation for API Endpoints @@ -100,34 +100,34 @@ Class | Method | HTTP request | Description - **Type**: API key Example -``` - auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{ - Key: "APIKEY", - Prefix: "Bearer", // Omit if not necessary. - }) - r, err := client.Service.Operation(auth, args) +```golang +auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{ + Key: "APIKEY", + Prefix: "Bearer", // Omit if not necessary. +}) +r, err := client.Service.Operation(auth, args) ``` ## api_key_query - **Type**: API key Example -``` - auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{ - Key: "APIKEY", - Prefix: "Bearer", // Omit if not necessary. - }) - r, err := client.Service.Operation(auth, args) +```golang +auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{ + Key: "APIKEY", + Prefix: "Bearer", // Omit if not necessary. +}) +r, err := client.Service.Operation(auth, args) ``` ## http_basic_test - **Type**: HTTP basic authentication Example -``` - auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ - UserName: "username", - Password: "password", - }) - r, err := client.Service.Operation(auth, args) +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) ``` ## petstore_auth - **Type**: OAuth @@ -138,20 +138,20 @@ Example - **read:pets**: read your pets Example -``` - auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") - r, err := client.Service.Operation(auth, args) +```golang +auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") +r, err := client.Service.Operation(auth, args) ``` Or via OAuth2 module to automatically refresh tokens and perform user authentication. -``` - import "golang.org/x/oauth2" +```golang +import "golang.org/x/oauth2" - / .. Perform OAuth2 round trip request and obtain a token .. // +/* Perform OAuth2 round trip request and obtain a token */ - tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) - auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) - r, err := client.Service.Operation(auth, args) +tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) +auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) +r, err := client.Service.Operation(auth, args) ``` ## Author From 9e06f7063f3826a9e5207d319b1743a3f6fae96f Mon Sep 17 00:00:00 2001 From: sneumann Date: Sun, 14 Jan 2018 10:14:35 +0100 Subject: [PATCH 35/65] Fix assignment of new object instance to variable (#7379) * #7359 Fix - use reflection to instantiate non-generated class (#7360) * add tests for java vertx petstore * add swagger example to README.md (#7368) * Fix assignment of new object instance to variable Fixes `Error in foobar$fromJSONString(s) : object 'CategoryObject' not found` Discussion in https://github.com/swagger-api/swagger-codegen/issues/6520#issuecomment-357132746 , thanks @wing328 for encouraging. --- README.md | 1 + bin/java-vertx-rx-petstore-server.sh | 2 +- .../JavaVertXServer/apiVerticle.mustache | 13 ++++++- .../src/main/resources/r/model.mustache | 2 +- pom.xml.circleci | 4 +- .../java-vertx/async/.swagger-codegen/VERSION | 2 +- .../server/petstore/java-vertx/async/pom.xml | 35 +++++++++--------- .../server/api/verticle/PetApiVerticle.java | 13 ++++++- .../server/api/verticle/StoreApiVerticle.java | 13 ++++++- .../server/api/verticle/UserApiVerticle.java | 13 ++++++- .../java-vertx/rx/.swagger-codegen/VERSION | 2 +- samples/server/petstore/java-vertx/rx/pom.xml | 37 +++++++++---------- .../server/api/verticle/PetApiVerticle.java | 13 ++++++- .../server/api/verticle/StoreApiVerticle.java | 13 ++++++- .../server/api/verticle/UserApiVerticle.java | 13 ++++++- 15 files changed, 120 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 0135cd50397..2581682674b 100644 --- a/README.md +++ b/README.md @@ -929,6 +929,7 @@ Presentations/Videos/Tutorials/Books - 2017/12/07 - [API-driven development with OpenAPI and Swagger, Part 2](https://www.itworld.com/article/3199190/apis/api-driven-development-with-openapi-and-swagger-part-2.html) by Matthew Tyson - 2017/12/29 - [REST APIs代码生成指南](https://gumroad.com/l/swagger_codegen_beginner_zh)(eBook) by [William Cheng](https://github.com/wing328), [Xin Meng](https://github.com/xmeng1) - 2017/12/21 - [Using Protocol Buffer to Generate SDK at Hootsuite](http://code.hootsuite.com/using-protocol-buffer-to-generate-sdk-at-hoosuite/?lipi=urn%3Ali%3Apage%3Ad_flagship3_messaging%3By4ATz3SDRXyvXJJ14LQysQ%3D%3D) by [Joy Zhang](https://www.linkedin.com/in/joy8zhang/) +- 2018/01/11 - [Swagger 工具箱介绍及代码自动生成示例](https://github.com/qct/swagger-example) by [qct](https://github.com/qct) # Swagger Codegen Core Team diff --git a/bin/java-vertx-rx-petstore-server.sh b/bin/java-vertx-rx-petstore-server.sh index f569df51cc6..92c7c355081 100755 --- a/bin/java-vertx-rx-petstore-server.sh +++ b/bin/java-vertx-rx-petstore-server.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l java-vertx -o samples/server/petstore/java-vertx/rx -DvertxSwaggerRouterVersion=1.2.0,rxInterface=true" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l java-vertx --artifact-id swagger-java-vertx-rx-server -o samples/server/petstore/java-vertx/rx -DvertxSwaggerRouterVersion=1.2.0,rxInterface=true" java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen/src/main/resources/JavaVertXServer/apiVerticle.mustache b/modules/swagger-codegen/src/main/resources/JavaVertXServer/apiVerticle.mustache index 715e7aa11f3..74b976f66a7 100644 --- a/modules/swagger-codegen/src/main/resources/JavaVertXServer/apiVerticle.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaVertXServer/apiVerticle.mustache @@ -19,8 +19,17 @@ public class {{classname}}Verticle extends AbstractVerticle { {{#operations}}{{#operation}}{{#vendorExtensions}}final static String {{x-serviceid-varname}} = "{{x-serviceid}}"; {{/vendorExtensions}}{{/operation}}{{/operations}} - //TODO : create Implementation - {{classname}} service = new {{classname}}Impl(); + final {{classname}} service; + + public {{classname}}Verticle() { + try { + Class serviceImplClass = getClass().getClassLoader().loadClass("{{package}}.{{classname}}Impl"); + service = ({{classname}})serviceImplClass.newInstance(); + } catch (Exception e) { + logUnexpectedError("{{classname}}Verticle constructor", e); + throw new RuntimeException(e); + } + } @Override public void start() throws Exception { diff --git a/modules/swagger-codegen/src/main/resources/r/model.mustache b/modules/swagger-codegen/src/main/resources/r/model.mustache index 94ae74085e2..af5b5cc9ecc 100644 --- a/modules/swagger-codegen/src/main/resources/r/model.mustache +++ b/modules/swagger-codegen/src/main/resources/r/model.mustache @@ -127,7 +127,7 @@ self$`{{baseName}}` <- lapply({{classname}}Object$`{{baseName}}`, function(x) {{datatype}}$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE))) {{/isListContainer}} {{^isListContainer}} - {{datatype}}Object -> {{datatype}}$new() + {{datatype}}Object <- {{datatype}}$new() self$`{{baseName}}` <- {{datatype}}Object$fromJSON(jsonlite::toJSON({{classname}}Object${{baseName}}, auto_unbox = TRUE)) {{/isListContainer}} {{/isPrimitiveType}} diff --git a/pom.xml.circleci b/pom.xml.circleci index f54ae23d6d2..fe24e2bfaea 100644 --- a/pom.xml.circleci +++ b/pom.xml.circleci @@ -843,8 +843,10 @@ samples/client/petstore/go + samples/server/petstore/java-vertx/rx + samples/server/petstore/java-vertx/async samples/server/petstore/java-inflector - samples/server/petstore/java-pkmst + samples/server/petstore/java-pkmst samples/server/petstore/java-play-framework samples/server/petstore/undertow samples/server/petstore/jaxrs/jersey1 diff --git a/samples/server/petstore/java-vertx/async/.swagger-codegen/VERSION b/samples/server/petstore/java-vertx/async/.swagger-codegen/VERSION index f9f7450d135..50794f17f1a 100644 --- a/samples/server/petstore/java-vertx/async/.swagger-codegen/VERSION +++ b/samples/server/petstore/java-vertx/async/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/async/pom.xml b/samples/server/petstore/java-vertx/async/pom.xml index 8e1a96f88ef..ba6f38e39d9 100644 --- a/samples/server/petstore/java-vertx/async/pom.xml +++ b/samples/server/petstore/java-vertx/async/pom.xml @@ -15,7 +15,7 @@ 4.12 3.4.1 3.3 - 1.2.0 + 1.4.0 2.3 2.7.4 @@ -28,25 +28,24 @@ test - - io.vertx - vertx-unit - ${vertx.version} - test - - - com.github.phiz71 - vertx-swagger-router - ${vertx-swagger-router.version} - + io.vertx + vertx-unit + ${vertx.version} + test + - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-datatype-jsr310.version} - + + com.github.phiz71 + vertx-swagger-router + ${vertx-swagger-router.version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-datatype-jsr310.version} + @@ -88,4 +87,4 @@ - \ No newline at end of file + diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java b/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java index fb3c20944f1..f97369e6ad3 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java @@ -28,8 +28,17 @@ public class PetApiVerticle extends AbstractVerticle { final static String UPDATEPETWITHFORM_SERVICE_ID = "updatePetWithForm"; final static String UPLOADFILE_SERVICE_ID = "uploadFile"; - //TODO : create Implementation - PetApi service = new PetApiImpl(); + final PetApi service; + + public PetApiVerticle() { + try { + Class serviceImplClass = getClass().getClassLoader().loadClass("io.swagger.server.api.verticle.PetApiImpl"); + service = (PetApi)serviceImplClass.newInstance(); + } catch (Exception e) { + logUnexpectedError("PetApiVerticle constructor", e); + throw new RuntimeException(e); + } + } @Override public void start() throws Exception { diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java b/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java index 9299a08e013..cc11fa49a2c 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java @@ -22,8 +22,17 @@ public class StoreApiVerticle extends AbstractVerticle { final static String GETORDERBYID_SERVICE_ID = "getOrderById"; final static String PLACEORDER_SERVICE_ID = "placeOrder"; - //TODO : create Implementation - StoreApi service = new StoreApiImpl(); + final StoreApi service; + + public StoreApiVerticle() { + try { + Class serviceImplClass = getClass().getClassLoader().loadClass("io.swagger.server.api.verticle.StoreApiImpl"); + service = (StoreApi)serviceImplClass.newInstance(); + } catch (Exception e) { + logUnexpectedError("StoreApiVerticle constructor", e); + throw new RuntimeException(e); + } + } @Override public void start() throws Exception { diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java b/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java index 0ad1f5eb980..70070fd59b4 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java @@ -26,8 +26,17 @@ public class UserApiVerticle extends AbstractVerticle { final static String LOGOUTUSER_SERVICE_ID = "logoutUser"; final static String UPDATEUSER_SERVICE_ID = "updateUser"; - //TODO : create Implementation - UserApi service = new UserApiImpl(); + final UserApi service; + + public UserApiVerticle() { + try { + Class serviceImplClass = getClass().getClassLoader().loadClass("io.swagger.server.api.verticle.UserApiImpl"); + service = (UserApi)serviceImplClass.newInstance(); + } catch (Exception e) { + logUnexpectedError("UserApiVerticle constructor", e); + throw new RuntimeException(e); + } + } @Override public void start() throws Exception { diff --git a/samples/server/petstore/java-vertx/rx/.swagger-codegen/VERSION b/samples/server/petstore/java-vertx/rx/.swagger-codegen/VERSION index f9f7450d135..50794f17f1a 100644 --- a/samples/server/petstore/java-vertx/rx/.swagger-codegen/VERSION +++ b/samples/server/petstore/java-vertx/rx/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/rx/pom.xml b/samples/server/petstore/java-vertx/rx/pom.xml index 8e1a96f88ef..ac1842d1aaa 100644 --- a/samples/server/petstore/java-vertx/rx/pom.xml +++ b/samples/server/petstore/java-vertx/rx/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.swagger - swagger-java-vertx-server + swagger-java-vertx-server-rx 1.0.0-SNAPSHOT jar @@ -15,7 +15,7 @@ 4.12 3.4.1 3.3 - 1.2.0 + 1.4.0 2.3 2.7.4 @@ -28,25 +28,24 @@ test - - io.vertx - vertx-unit - ${vertx.version} - test - - - com.github.phiz71 - vertx-swagger-router - ${vertx-swagger-router.version} - + io.vertx + vertx-unit + ${vertx.version} + test + - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-datatype-jsr310.version} - + + com.github.phiz71 + vertx-swagger-router + ${vertx-swagger-router.version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-datatype-jsr310.version} + @@ -88,4 +87,4 @@ - \ No newline at end of file + diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java b/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java index 6eada5ae461..1b7e08c336e 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java @@ -28,8 +28,17 @@ public class PetApiVerticle extends AbstractVerticle { final static String UPDATEPETWITHFORM_SERVICE_ID = "updatePetWithForm"; final static String UPLOADFILE_SERVICE_ID = "uploadFile"; - //TODO : create Implementation - PetApi service = new PetApiImpl(); + final PetApi service; + + public PetApiVerticle() { + try { + Class serviceImplClass = getClass().getClassLoader().loadClass("io.swagger.server.api.verticle.PetApiImpl"); + service = (PetApi)serviceImplClass.newInstance(); + } catch (Exception e) { + logUnexpectedError("PetApiVerticle constructor", e); + throw new RuntimeException(e); + } + } @Override public void start() throws Exception { diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java b/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java index b648fef0593..67353e8ac87 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java @@ -22,8 +22,17 @@ public class StoreApiVerticle extends AbstractVerticle { final static String GETORDERBYID_SERVICE_ID = "getOrderById"; final static String PLACEORDER_SERVICE_ID = "placeOrder"; - //TODO : create Implementation - StoreApi service = new StoreApiImpl(); + final StoreApi service; + + public StoreApiVerticle() { + try { + Class serviceImplClass = getClass().getClassLoader().loadClass("io.swagger.server.api.verticle.StoreApiImpl"); + service = (StoreApi)serviceImplClass.newInstance(); + } catch (Exception e) { + logUnexpectedError("StoreApiVerticle constructor", e); + throw new RuntimeException(e); + } + } @Override public void start() throws Exception { diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java b/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java index 0bdd10a153b..a6d8f69da06 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java @@ -26,8 +26,17 @@ public class UserApiVerticle extends AbstractVerticle { final static String LOGOUTUSER_SERVICE_ID = "logoutUser"; final static String UPDATEUSER_SERVICE_ID = "updateUser"; - //TODO : create Implementation - UserApi service = new UserApiImpl(); + final UserApi service; + + public UserApiVerticle() { + try { + Class serviceImplClass = getClass().getClassLoader().loadClass("io.swagger.server.api.verticle.UserApiImpl"); + service = (UserApi)serviceImplClass.newInstance(); + } catch (Exception e) { + logUnexpectedError("UserApiVerticle constructor", e); + throw new RuntimeException(e); + } + } @Override public void start() throws Exception { From fb73b8c4de892c8ca50f8490e8b592ed96274f55 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 14 Jan 2018 17:18:40 +0800 Subject: [PATCH 36/65] update r petstore samples --- samples/client/petstore/r_test/.swagger-codegen/VERSION | 2 +- samples/client/petstore/r_test/R/Pet.r | 2 +- samples/client/petstore/r_test/git_push.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/client/petstore/r_test/.swagger-codegen/VERSION b/samples/client/petstore/r_test/.swagger-codegen/VERSION index f9f7450d135..855ff9501eb 100644 --- a/samples/client/petstore/r_test/.swagger-codegen/VERSION +++ b/samples/client/petstore/r_test/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/r_test/R/Pet.r b/samples/client/petstore/r_test/R/Pet.r index 777589993f5..4841762b029 100644 --- a/samples/client/petstore/r_test/R/Pet.r +++ b/samples/client/petstore/r_test/R/Pet.r @@ -127,7 +127,7 @@ Pet <- R6::R6Class( fromJSONString = function(PetJson) { PetObject <- jsonlite::fromJSON(PetJson) self$`id` <- PetObject$`id` - CategoryObject -> Category$new() + CategoryObject <- Category$new() self$`category` <- CategoryObject$fromJSON(jsonlite::toJSON(PetObject$category, auto_unbox = TRUE)) self$`name` <- PetObject$`name` self$`photoUrls` <- PetObject$`photoUrls` diff --git a/samples/client/petstore/r_test/git_push.sh b/samples/client/petstore/r_test/git_push.sh index ed374619b13..ae01b182ae9 100644 --- a/samples/client/petstore/r_test/git_push.sh +++ b/samples/client/petstore/r_test/git_push.sh @@ -36,7 +36,7 @@ git_remote=`git remote` if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git From 90859575ebfea800dde93a498e1439011963d6cf Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Sun, 14 Jan 2018 10:37:37 +0100 Subject: [PATCH 37/65] Fixing variable name typo (instane -> instance) (#7353) --- .../src/main/resources/Javascript/model_test.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Javascript/model_test.mustache b/modules/swagger-codegen/src/main/resources/Javascript/model_test.mustache index 2b43b338812..fc856b01043 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/model_test.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/model_test.mustache @@ -44,7 +44,7 @@ describe('{{classname}}', function() { it('should create an instance of {{classname}}', function() { // uncomment below and update the code to test {{classname}} - //var instane = new {{moduleName}}.{{classname}}(); + //var instance = new {{moduleName}}.{{classname}}(); //expect(instance).to.be.a({{moduleName}}.{{classname}}); }); @@ -53,7 +53,7 @@ {{#vars}} it('should have the property {{name}} (base name: "{{baseName}}")', function() { // uncomment below and update the code to test the property {{name}} - //var instane = new {{moduleName}}.{{classname}}(); + //var instance = new {{moduleName}}.{{classname}}(); //expect(instance).to.be(); }); From 429b96ae7e22a57c2a408a4cf59d7fd87f1909eb Mon Sep 17 00:00:00 2001 From: Ben Mordue Date: Sun, 14 Jan 2018 09:39:32 +0000 Subject: [PATCH 38/65] [JAVA] equals and hashCode for models with byte[] and binary strings (#7341) * equals and hashCode methods for POJOs with byte array vars * Also fix equals and hashCode for binary vars * Ran script to update samples --- .../swagger-codegen/src/main/resources/Java/model.mustache | 1 + .../swagger-codegen/src/main/resources/Java/pojo.mustache | 4 ++-- .../io/swagger/client/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/io/swagger/client/model/Animal.java | 1 + .../src/main/java/io/swagger/client/model/AnimalFarm.java | 1 + .../io/swagger/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/io/swagger/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/ArrayTest.java | 1 + .../main/java/io/swagger/client/model/Capitalization.java | 1 + .../feign/src/main/java/io/swagger/client/model/Cat.java | 1 + .../src/main/java/io/swagger/client/model/Category.java | 1 + .../src/main/java/io/swagger/client/model/ClassModel.java | 1 + .../src/main/java/io/swagger/client/model/Client.java | 1 + .../feign/src/main/java/io/swagger/client/model/Dog.java | 1 + .../src/main/java/io/swagger/client/model/EnumArrays.java | 1 + .../src/main/java/io/swagger/client/model/EnumClass.java | 1 + .../src/main/java/io/swagger/client/model/EnumTest.java | 1 + .../src/main/java/io/swagger/client/model/FormatTest.java | 7 ++++--- .../main/java/io/swagger/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/io/swagger/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/io/swagger/client/model/Model200Response.java | 1 + .../java/io/swagger/client/model/ModelApiResponse.java | 1 + .../src/main/java/io/swagger/client/model/ModelReturn.java | 1 + .../feign/src/main/java/io/swagger/client/model/Name.java | 1 + .../src/main/java/io/swagger/client/model/NumberOnly.java | 1 + .../feign/src/main/java/io/swagger/client/model/Order.java | 1 + .../main/java/io/swagger/client/model/OuterComposite.java | 1 + .../src/main/java/io/swagger/client/model/OuterEnum.java | 1 + .../feign/src/main/java/io/swagger/client/model/Pet.java | 1 + .../main/java/io/swagger/client/model/ReadOnlyFirst.java | 1 + .../java/io/swagger/client/model/SpecialModelName.java | 1 + .../feign/src/main/java/io/swagger/client/model/Tag.java | 1 + .../feign/src/main/java/io/swagger/client/model/User.java | 1 + .../io/swagger/client/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/io/swagger/client/model/Animal.java | 1 + .../src/main/java/io/swagger/client/model/AnimalFarm.java | 1 + .../io/swagger/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/io/swagger/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/ArrayTest.java | 1 + .../main/java/io/swagger/client/model/Capitalization.java | 1 + .../src/main/java/io/swagger/client/model/Cat.java | 1 + .../src/main/java/io/swagger/client/model/Category.java | 1 + .../src/main/java/io/swagger/client/model/ClassModel.java | 1 + .../src/main/java/io/swagger/client/model/Client.java | 1 + .../src/main/java/io/swagger/client/model/Dog.java | 1 + .../src/main/java/io/swagger/client/model/EnumArrays.java | 1 + .../src/main/java/io/swagger/client/model/EnumClass.java | 1 + .../src/main/java/io/swagger/client/model/EnumTest.java | 1 + .../src/main/java/io/swagger/client/model/FormatTest.java | 7 ++++--- .../main/java/io/swagger/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/io/swagger/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/io/swagger/client/model/Model200Response.java | 1 + .../java/io/swagger/client/model/ModelApiResponse.java | 1 + .../src/main/java/io/swagger/client/model/ModelReturn.java | 1 + .../src/main/java/io/swagger/client/model/Name.java | 1 + .../src/main/java/io/swagger/client/model/NumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/Order.java | 1 + .../main/java/io/swagger/client/model/OuterComposite.java | 1 + .../src/main/java/io/swagger/client/model/OuterEnum.java | 1 + .../src/main/java/io/swagger/client/model/Pet.java | 1 + .../main/java/io/swagger/client/model/ReadOnlyFirst.java | 1 + .../java/io/swagger/client/model/SpecialModelName.java | 1 + .../src/main/java/io/swagger/client/model/Tag.java | 1 + .../src/main/java/io/swagger/client/model/User.java | 1 + .../io/swagger/client/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/io/swagger/client/model/Animal.java | 1 + .../src/main/java/io/swagger/client/model/AnimalFarm.java | 1 + .../io/swagger/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/io/swagger/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/ArrayTest.java | 1 + .../main/java/io/swagger/client/model/Capitalization.java | 1 + .../jersey1/src/main/java/io/swagger/client/model/Cat.java | 1 + .../src/main/java/io/swagger/client/model/Category.java | 1 + .../src/main/java/io/swagger/client/model/ClassModel.java | 1 + .../src/main/java/io/swagger/client/model/Client.java | 1 + .../jersey1/src/main/java/io/swagger/client/model/Dog.java | 1 + .../src/main/java/io/swagger/client/model/EnumArrays.java | 1 + .../src/main/java/io/swagger/client/model/EnumClass.java | 1 + .../src/main/java/io/swagger/client/model/EnumTest.java | 1 + .../src/main/java/io/swagger/client/model/FormatTest.java | 7 ++++--- .../main/java/io/swagger/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/io/swagger/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/io/swagger/client/model/Model200Response.java | 1 + .../java/io/swagger/client/model/ModelApiResponse.java | 1 + .../src/main/java/io/swagger/client/model/ModelReturn.java | 1 + .../src/main/java/io/swagger/client/model/Name.java | 1 + .../src/main/java/io/swagger/client/model/NumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/Order.java | 1 + .../main/java/io/swagger/client/model/OuterComposite.java | 1 + .../src/main/java/io/swagger/client/model/OuterEnum.java | 1 + .../jersey1/src/main/java/io/swagger/client/model/Pet.java | 1 + .../main/java/io/swagger/client/model/ReadOnlyFirst.java | 1 + .../java/io/swagger/client/model/SpecialModelName.java | 1 + .../jersey1/src/main/java/io/swagger/client/model/Tag.java | 1 + .../src/main/java/io/swagger/client/model/User.java | 1 + .../io/swagger/client/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/io/swagger/client/model/Animal.java | 1 + .../src/main/java/io/swagger/client/model/AnimalFarm.java | 1 + .../io/swagger/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/io/swagger/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/ArrayTest.java | 1 + .../main/java/io/swagger/client/model/Capitalization.java | 1 + .../src/main/java/io/swagger/client/model/Cat.java | 1 + .../src/main/java/io/swagger/client/model/Category.java | 1 + .../src/main/java/io/swagger/client/model/ClassModel.java | 1 + .../src/main/java/io/swagger/client/model/Client.java | 1 + .../src/main/java/io/swagger/client/model/Dog.java | 1 + .../src/main/java/io/swagger/client/model/EnumArrays.java | 1 + .../src/main/java/io/swagger/client/model/EnumClass.java | 1 + .../src/main/java/io/swagger/client/model/EnumTest.java | 1 + .../src/main/java/io/swagger/client/model/FormatTest.java | 7 ++++--- .../main/java/io/swagger/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/io/swagger/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/io/swagger/client/model/Model200Response.java | 1 + .../java/io/swagger/client/model/ModelApiResponse.java | 1 + .../src/main/java/io/swagger/client/model/ModelReturn.java | 1 + .../src/main/java/io/swagger/client/model/Name.java | 1 + .../src/main/java/io/swagger/client/model/NumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/Order.java | 1 + .../main/java/io/swagger/client/model/OuterComposite.java | 1 + .../src/main/java/io/swagger/client/model/OuterEnum.java | 1 + .../src/main/java/io/swagger/client/model/Pet.java | 1 + .../main/java/io/swagger/client/model/ReadOnlyFirst.java | 1 + .../java/io/swagger/client/model/SpecialModelName.java | 1 + .../src/main/java/io/swagger/client/model/Tag.java | 1 + .../src/main/java/io/swagger/client/model/User.java | 1 + .../io/swagger/client/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/io/swagger/client/model/Animal.java | 1 + .../src/main/java/io/swagger/client/model/AnimalFarm.java | 1 + .../io/swagger/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/io/swagger/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/ArrayTest.java | 1 + .../main/java/io/swagger/client/model/Capitalization.java | 1 + .../jersey2/src/main/java/io/swagger/client/model/Cat.java | 1 + .../src/main/java/io/swagger/client/model/Category.java | 1 + .../src/main/java/io/swagger/client/model/ClassModel.java | 1 + .../src/main/java/io/swagger/client/model/Client.java | 1 + .../jersey2/src/main/java/io/swagger/client/model/Dog.java | 1 + .../src/main/java/io/swagger/client/model/EnumArrays.java | 1 + .../src/main/java/io/swagger/client/model/EnumClass.java | 1 + .../src/main/java/io/swagger/client/model/EnumTest.java | 1 + .../src/main/java/io/swagger/client/model/FormatTest.java | 7 ++++--- .../main/java/io/swagger/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/io/swagger/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/io/swagger/client/model/Model200Response.java | 1 + .../java/io/swagger/client/model/ModelApiResponse.java | 1 + .../src/main/java/io/swagger/client/model/ModelReturn.java | 1 + .../src/main/java/io/swagger/client/model/Name.java | 1 + .../src/main/java/io/swagger/client/model/NumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/Order.java | 1 + .../main/java/io/swagger/client/model/OuterComposite.java | 1 + .../src/main/java/io/swagger/client/model/OuterEnum.java | 1 + .../jersey2/src/main/java/io/swagger/client/model/Pet.java | 1 + .../main/java/io/swagger/client/model/ReadOnlyFirst.java | 1 + .../java/io/swagger/client/model/SpecialModelName.java | 1 + .../jersey2/src/main/java/io/swagger/client/model/Tag.java | 1 + .../src/main/java/io/swagger/client/model/User.java | 1 + .../io/swagger/client/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/io/swagger/client/model/Animal.java | 1 + .../src/main/java/io/swagger/client/model/AnimalFarm.java | 1 + .../io/swagger/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/io/swagger/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/ArrayTest.java | 1 + .../main/java/io/swagger/client/model/Capitalization.java | 1 + .../src/main/java/io/swagger/client/model/Cat.java | 1 + .../src/main/java/io/swagger/client/model/Category.java | 1 + .../src/main/java/io/swagger/client/model/ClassModel.java | 1 + .../src/main/java/io/swagger/client/model/Client.java | 1 + .../src/main/java/io/swagger/client/model/Dog.java | 1 + .../src/main/java/io/swagger/client/model/EnumArrays.java | 1 + .../src/main/java/io/swagger/client/model/EnumClass.java | 1 + .../src/main/java/io/swagger/client/model/EnumTest.java | 1 + .../src/main/java/io/swagger/client/model/FormatTest.java | 7 ++++--- .../main/java/io/swagger/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/io/swagger/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/io/swagger/client/model/Model200Response.java | 1 + .../java/io/swagger/client/model/ModelApiResponse.java | 1 + .../src/main/java/io/swagger/client/model/ModelReturn.java | 1 + .../src/main/java/io/swagger/client/model/Name.java | 1 + .../src/main/java/io/swagger/client/model/NumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/Order.java | 1 + .../main/java/io/swagger/client/model/OuterComposite.java | 1 + .../src/main/java/io/swagger/client/model/OuterEnum.java | 1 + .../src/main/java/io/swagger/client/model/Pet.java | 1 + .../main/java/io/swagger/client/model/ReadOnlyFirst.java | 1 + .../java/io/swagger/client/model/SpecialModelName.java | 1 + .../src/main/java/io/swagger/client/model/Tag.java | 1 + .../src/main/java/io/swagger/client/model/User.java | 1 + .../io/swagger/client/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/io/swagger/client/model/Animal.java | 1 + .../src/main/java/io/swagger/client/model/AnimalFarm.java | 1 + .../io/swagger/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/io/swagger/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/ArrayTest.java | 1 + .../main/java/io/swagger/client/model/Capitalization.java | 1 + .../src/main/java/io/swagger/client/model/Cat.java | 1 + .../src/main/java/io/swagger/client/model/Category.java | 1 + .../src/main/java/io/swagger/client/model/ClassModel.java | 1 + .../src/main/java/io/swagger/client/model/Client.java | 1 + .../src/main/java/io/swagger/client/model/Dog.java | 1 + .../src/main/java/io/swagger/client/model/EnumArrays.java | 1 + .../src/main/java/io/swagger/client/model/EnumClass.java | 1 + .../src/main/java/io/swagger/client/model/EnumTest.java | 1 + .../src/main/java/io/swagger/client/model/FormatTest.java | 7 ++++--- .../main/java/io/swagger/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/io/swagger/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/io/swagger/client/model/Model200Response.java | 1 + .../java/io/swagger/client/model/ModelApiResponse.java | 1 + .../src/main/java/io/swagger/client/model/ModelReturn.java | 1 + .../src/main/java/io/swagger/client/model/Name.java | 1 + .../src/main/java/io/swagger/client/model/NumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/Order.java | 1 + .../main/java/io/swagger/client/model/OuterComposite.java | 1 + .../src/main/java/io/swagger/client/model/OuterEnum.java | 1 + .../src/main/java/io/swagger/client/model/Pet.java | 1 + .../main/java/io/swagger/client/model/ReadOnlyFirst.java | 1 + .../java/io/swagger/client/model/SpecialModelName.java | 1 + .../src/main/java/io/swagger/client/model/Tag.java | 1 + .../src/main/java/io/swagger/client/model/User.java | 1 + .../io/swagger/client/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/io/swagger/client/model/Animal.java | 1 + .../src/main/java/io/swagger/client/model/AnimalFarm.java | 1 + .../io/swagger/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/io/swagger/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/ArrayTest.java | 1 + .../main/java/io/swagger/client/model/Capitalization.java | 1 + .../src/main/java/io/swagger/client/model/Cat.java | 1 + .../src/main/java/io/swagger/client/model/Category.java | 1 + .../src/main/java/io/swagger/client/model/ClassModel.java | 1 + .../src/main/java/io/swagger/client/model/Client.java | 1 + .../src/main/java/io/swagger/client/model/Dog.java | 1 + .../src/main/java/io/swagger/client/model/EnumArrays.java | 1 + .../src/main/java/io/swagger/client/model/EnumClass.java | 1 + .../src/main/java/io/swagger/client/model/EnumTest.java | 1 + .../src/main/java/io/swagger/client/model/FormatTest.java | 7 ++++--- .../main/java/io/swagger/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/io/swagger/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/io/swagger/client/model/Model200Response.java | 1 + .../java/io/swagger/client/model/ModelApiResponse.java | 1 + .../src/main/java/io/swagger/client/model/ModelReturn.java | 1 + .../src/main/java/io/swagger/client/model/Name.java | 1 + .../src/main/java/io/swagger/client/model/NumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/Order.java | 1 + .../main/java/io/swagger/client/model/OuterComposite.java | 1 + .../src/main/java/io/swagger/client/model/OuterEnum.java | 1 + .../src/main/java/io/swagger/client/model/Pet.java | 1 + .../main/java/io/swagger/client/model/ReadOnlyFirst.java | 1 + .../java/io/swagger/client/model/SpecialModelName.java | 1 + .../src/main/java/io/swagger/client/model/Tag.java | 1 + .../src/main/java/io/swagger/client/model/User.java | 1 + .../io/swagger/client/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/io/swagger/client/model/Animal.java | 1 + .../src/main/java/io/swagger/client/model/AnimalFarm.java | 1 + .../io/swagger/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/io/swagger/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/ArrayTest.java | 1 + .../main/java/io/swagger/client/model/Capitalization.java | 1 + .../src/main/java/io/swagger/client/model/Cat.java | 1 + .../src/main/java/io/swagger/client/model/Category.java | 1 + .../src/main/java/io/swagger/client/model/ClassModel.java | 1 + .../src/main/java/io/swagger/client/model/Client.java | 1 + .../src/main/java/io/swagger/client/model/Dog.java | 1 + .../src/main/java/io/swagger/client/model/EnumArrays.java | 1 + .../src/main/java/io/swagger/client/model/EnumClass.java | 1 + .../src/main/java/io/swagger/client/model/EnumTest.java | 1 + .../src/main/java/io/swagger/client/model/FormatTest.java | 7 ++++--- .../main/java/io/swagger/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/io/swagger/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/io/swagger/client/model/Model200Response.java | 1 + .../java/io/swagger/client/model/ModelApiResponse.java | 1 + .../src/main/java/io/swagger/client/model/ModelReturn.java | 1 + .../src/main/java/io/swagger/client/model/Name.java | 1 + .../src/main/java/io/swagger/client/model/NumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/Order.java | 1 + .../main/java/io/swagger/client/model/OuterComposite.java | 1 + .../src/main/java/io/swagger/client/model/OuterEnum.java | 1 + .../src/main/java/io/swagger/client/model/Pet.java | 1 + .../main/java/io/swagger/client/model/ReadOnlyFirst.java | 1 + .../java/io/swagger/client/model/SpecialModelName.java | 1 + .../src/main/java/io/swagger/client/model/Tag.java | 1 + .../src/main/java/io/swagger/client/model/User.java | 1 + .../io/swagger/client/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/io/swagger/client/model/Animal.java | 1 + .../src/main/java/io/swagger/client/model/AnimalFarm.java | 1 + .../io/swagger/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/io/swagger/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/ArrayTest.java | 1 + .../main/java/io/swagger/client/model/Capitalization.java | 1 + .../src/main/java/io/swagger/client/model/Cat.java | 1 + .../src/main/java/io/swagger/client/model/Category.java | 1 + .../src/main/java/io/swagger/client/model/ClassModel.java | 1 + .../src/main/java/io/swagger/client/model/Client.java | 1 + .../src/main/java/io/swagger/client/model/Dog.java | 1 + .../src/main/java/io/swagger/client/model/EnumArrays.java | 1 + .../src/main/java/io/swagger/client/model/EnumClass.java | 1 + .../src/main/java/io/swagger/client/model/EnumTest.java | 1 + .../src/main/java/io/swagger/client/model/FormatTest.java | 7 ++++--- .../main/java/io/swagger/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/io/swagger/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/io/swagger/client/model/Model200Response.java | 1 + .../java/io/swagger/client/model/ModelApiResponse.java | 1 + .../src/main/java/io/swagger/client/model/ModelReturn.java | 1 + .../src/main/java/io/swagger/client/model/Name.java | 1 + .../src/main/java/io/swagger/client/model/NumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/Order.java | 1 + .../main/java/io/swagger/client/model/OuterComposite.java | 1 + .../src/main/java/io/swagger/client/model/OuterEnum.java | 1 + .../src/main/java/io/swagger/client/model/Pet.java | 1 + .../main/java/io/swagger/client/model/ReadOnlyFirst.java | 1 + .../java/io/swagger/client/model/SpecialModelName.java | 1 + .../src/main/java/io/swagger/client/model/Tag.java | 1 + .../src/main/java/io/swagger/client/model/User.java | 1 + .../io/swagger/client/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/io/swagger/client/model/Animal.java | 1 + .../src/main/java/io/swagger/client/model/AnimalFarm.java | 1 + .../io/swagger/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/io/swagger/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/ArrayTest.java | 1 + .../main/java/io/swagger/client/model/Capitalization.java | 1 + .../src/main/java/io/swagger/client/model/Cat.java | 1 + .../src/main/java/io/swagger/client/model/Category.java | 1 + .../src/main/java/io/swagger/client/model/ClassModel.java | 1 + .../src/main/java/io/swagger/client/model/Client.java | 1 + .../src/main/java/io/swagger/client/model/Dog.java | 1 + .../src/main/java/io/swagger/client/model/EnumArrays.java | 1 + .../src/main/java/io/swagger/client/model/EnumClass.java | 1 + .../src/main/java/io/swagger/client/model/EnumTest.java | 1 + .../src/main/java/io/swagger/client/model/FormatTest.java | 7 ++++--- .../main/java/io/swagger/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/io/swagger/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/io/swagger/client/model/Model200Response.java | 1 + .../java/io/swagger/client/model/ModelApiResponse.java | 1 + .../src/main/java/io/swagger/client/model/ModelReturn.java | 1 + .../src/main/java/io/swagger/client/model/Name.java | 1 + .../src/main/java/io/swagger/client/model/NumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/Order.java | 1 + .../main/java/io/swagger/client/model/OuterComposite.java | 1 + .../src/main/java/io/swagger/client/model/OuterEnum.java | 1 + .../src/main/java/io/swagger/client/model/Pet.java | 1 + .../main/java/io/swagger/client/model/ReadOnlyFirst.java | 1 + .../java/io/swagger/client/model/SpecialModelName.java | 1 + .../src/main/java/io/swagger/client/model/Tag.java | 1 + .../src/main/java/io/swagger/client/model/User.java | 1 + .../io/swagger/client/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/io/swagger/client/model/Animal.java | 1 + .../src/main/java/io/swagger/client/model/AnimalFarm.java | 1 + .../io/swagger/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/io/swagger/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/ArrayTest.java | 1 + .../main/java/io/swagger/client/model/Capitalization.java | 1 + .../src/main/java/io/swagger/client/model/Cat.java | 1 + .../src/main/java/io/swagger/client/model/Category.java | 1 + .../src/main/java/io/swagger/client/model/ClassModel.java | 1 + .../src/main/java/io/swagger/client/model/Client.java | 1 + .../src/main/java/io/swagger/client/model/Dog.java | 1 + .../src/main/java/io/swagger/client/model/EnumArrays.java | 1 + .../src/main/java/io/swagger/client/model/EnumClass.java | 1 + .../src/main/java/io/swagger/client/model/EnumTest.java | 1 + .../src/main/java/io/swagger/client/model/FormatTest.java | 7 ++++--- .../main/java/io/swagger/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/io/swagger/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/io/swagger/client/model/Model200Response.java | 1 + .../java/io/swagger/client/model/ModelApiResponse.java | 1 + .../src/main/java/io/swagger/client/model/ModelReturn.java | 1 + .../src/main/java/io/swagger/client/model/Name.java | 1 + .../src/main/java/io/swagger/client/model/NumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/Order.java | 1 + .../main/java/io/swagger/client/model/OuterComposite.java | 1 + .../src/main/java/io/swagger/client/model/OuterEnum.java | 1 + .../src/main/java/io/swagger/client/model/Pet.java | 1 + .../main/java/io/swagger/client/model/ReadOnlyFirst.java | 1 + .../java/io/swagger/client/model/SpecialModelName.java | 1 + .../src/main/java/io/swagger/client/model/Tag.java | 1 + .../src/main/java/io/swagger/client/model/User.java | 1 + .../io/swagger/client/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/io/swagger/client/model/Animal.java | 1 + .../src/main/java/io/swagger/client/model/AnimalFarm.java | 1 + .../io/swagger/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/io/swagger/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/ArrayTest.java | 1 + .../main/java/io/swagger/client/model/Capitalization.java | 1 + .../src/main/java/io/swagger/client/model/Cat.java | 1 + .../src/main/java/io/swagger/client/model/Category.java | 1 + .../src/main/java/io/swagger/client/model/ClassModel.java | 1 + .../src/main/java/io/swagger/client/model/Client.java | 1 + .../src/main/java/io/swagger/client/model/Dog.java | 1 + .../src/main/java/io/swagger/client/model/EnumArrays.java | 1 + .../src/main/java/io/swagger/client/model/EnumClass.java | 1 + .../src/main/java/io/swagger/client/model/EnumTest.java | 1 + .../src/main/java/io/swagger/client/model/FormatTest.java | 7 ++++--- .../main/java/io/swagger/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/io/swagger/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/io/swagger/client/model/Model200Response.java | 1 + .../java/io/swagger/client/model/ModelApiResponse.java | 1 + .../src/main/java/io/swagger/client/model/ModelReturn.java | 1 + .../src/main/java/io/swagger/client/model/Name.java | 1 + .../src/main/java/io/swagger/client/model/NumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/Order.java | 1 + .../main/java/io/swagger/client/model/OuterComposite.java | 1 + .../src/main/java/io/swagger/client/model/OuterEnum.java | 1 + .../src/main/java/io/swagger/client/model/Pet.java | 1 + .../main/java/io/swagger/client/model/ReadOnlyFirst.java | 1 + .../java/io/swagger/client/model/SpecialModelName.java | 1 + .../src/main/java/io/swagger/client/model/Tag.java | 1 + .../src/main/java/io/swagger/client/model/User.java | 1 + .../io/swagger/client/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/io/swagger/client/model/Animal.java | 1 + .../src/main/java/io/swagger/client/model/AnimalFarm.java | 1 + .../io/swagger/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/io/swagger/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/ArrayTest.java | 1 + .../main/java/io/swagger/client/model/Capitalization.java | 1 + .../src/main/java/io/swagger/client/model/Cat.java | 1 + .../src/main/java/io/swagger/client/model/Category.java | 1 + .../src/main/java/io/swagger/client/model/ClassModel.java | 1 + .../src/main/java/io/swagger/client/model/Client.java | 1 + .../src/main/java/io/swagger/client/model/Dog.java | 1 + .../src/main/java/io/swagger/client/model/EnumArrays.java | 1 + .../src/main/java/io/swagger/client/model/EnumClass.java | 1 + .../src/main/java/io/swagger/client/model/EnumTest.java | 1 + .../src/main/java/io/swagger/client/model/FormatTest.java | 7 ++++--- .../main/java/io/swagger/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/io/swagger/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/io/swagger/client/model/Model200Response.java | 1 + .../java/io/swagger/client/model/ModelApiResponse.java | 1 + .../src/main/java/io/swagger/client/model/ModelReturn.java | 1 + .../src/main/java/io/swagger/client/model/Name.java | 1 + .../src/main/java/io/swagger/client/model/NumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/Order.java | 1 + .../main/java/io/swagger/client/model/OuterComposite.java | 1 + .../src/main/java/io/swagger/client/model/OuterEnum.java | 1 + .../src/main/java/io/swagger/client/model/Pet.java | 1 + .../main/java/io/swagger/client/model/ReadOnlyFirst.java | 1 + .../java/io/swagger/client/model/SpecialModelName.java | 1 + .../src/main/java/io/swagger/client/model/Tag.java | 1 + .../src/main/java/io/swagger/client/model/User.java | 1 + .../io/swagger/client/model/AdditionalPropertiesClass.java | 1 + .../src/main/java/io/swagger/client/model/Animal.java | 1 + .../src/main/java/io/swagger/client/model/AnimalFarm.java | 1 + .../io/swagger/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/io/swagger/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/ArrayTest.java | 1 + .../main/java/io/swagger/client/model/Capitalization.java | 1 + .../src/main/java/io/swagger/client/model/Cat.java | 1 + .../src/main/java/io/swagger/client/model/Category.java | 1 + .../src/main/java/io/swagger/client/model/ClassModel.java | 1 + .../src/main/java/io/swagger/client/model/Client.java | 1 + .../src/main/java/io/swagger/client/model/Dog.java | 1 + .../src/main/java/io/swagger/client/model/EnumArrays.java | 1 + .../src/main/java/io/swagger/client/model/EnumClass.java | 1 + .../src/main/java/io/swagger/client/model/EnumTest.java | 1 + .../src/main/java/io/swagger/client/model/FormatTest.java | 7 ++++--- .../main/java/io/swagger/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/io/swagger/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/io/swagger/client/model/Model200Response.java | 1 + .../java/io/swagger/client/model/ModelApiResponse.java | 1 + .../src/main/java/io/swagger/client/model/ModelReturn.java | 1 + .../src/main/java/io/swagger/client/model/Name.java | 1 + .../src/main/java/io/swagger/client/model/NumberOnly.java | 1 + .../src/main/java/io/swagger/client/model/Order.java | 1 + .../main/java/io/swagger/client/model/OuterComposite.java | 1 + .../src/main/java/io/swagger/client/model/OuterEnum.java | 1 + .../src/main/java/io/swagger/client/model/Pet.java | 1 + .../main/java/io/swagger/client/model/ReadOnlyFirst.java | 1 + .../java/io/swagger/client/model/SpecialModelName.java | 1 + .../src/main/java/io/swagger/client/model/Tag.java | 1 + .../src/main/java/io/swagger/client/model/User.java | 1 + 482 files changed, 528 insertions(+), 47 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/model.mustache b/modules/swagger-codegen/src/main/resources/Java/model.mustache index fd9f614d537..a42a1359e4d 100644 --- a/modules/swagger-codegen/src/main/resources/Java/model.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/model.mustache @@ -4,6 +4,7 @@ package {{package}}; {{^supportJava6}} import java.util.Objects; +import java.util.Arrays; {{/supportJava6}} {{#supportJava6}} import org.apache.commons.lang3.ObjectUtils; diff --git a/modules/swagger-codegen/src/main/resources/Java/pojo.mustache b/modules/swagger-codegen/src/main/resources/Java/pojo.mustache index 88c6b8e4c3e..5bbeef075ba 100644 --- a/modules/swagger-codegen/src/main/resources/Java/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/pojo.mustache @@ -147,7 +147,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela return false; }{{#hasVars}} {{classname}} {{classVarName}} = ({{classname}}) o; - return {{#vars}}Objects.equals(this.{{name}}, {{classVarName}}.{{name}}){{#hasMore}} && + return {{#vars}}{{#isByteArray}}Arrays{{/isByteArray}}{{#isBinary}}Arrays{{/isBinary}}{{^isByteArray}}{{^isBinary}}Objects{{/isBinary}}{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{#hasMore}} && {{/hasMore}}{{/vars}}{{#parent}} && super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}} @@ -155,7 +155,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela @Override public int hashCode() { - return Objects.hash({{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); + return Objects.hash({{#vars}}{{^isByteArray}}{{^isBinary}}{{name}}{{/isBinary}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{#isBinary}}Arrays.hashCode({{name}}){{/isBinary}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); } {{/supportJava6}} diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 7fe69e168fd..5d0839cf36a 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java index 590f36c0ae0..65e06a82bfa 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java index 0b1d6a74cc6..a470f42e125 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index b7e59a030a4..a578185e023 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index fdfeb6856f3..66a49933800 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java index 62665c2536a..a62c86e04b4 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Capitalization.java index a72b0a72f46..b023a746b96 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Capitalization.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java index b882da0ad90..5be236f7232 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java index 464f4375c4b..6c16366280a 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ClassModel.java index 4f764fde68d..a546eab1d37 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ClassModel.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java index a7c4253499c..0af140c0fb9 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java index 7de179b2ade..41bd1a100d0 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java index 12caa480285..daefd52aed7 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java index abbd7a56668..09fd0a2ebdc 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java index 93d0da037b6..193d7f101db 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java index 4118656d29e..67879022f96 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -329,8 +330,8 @@ public boolean equals(java.lang.Object o) { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && + Arrays.equals(this._byte, formatTest._byte) && + Arrays.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -339,7 +340,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 6dc9f12c4b8..6137eb3d2ed 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java index e6344a1df0f..18d50df62fb 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 29bfc7e8c08..ec8f9d238b5 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java index 58624475e43..38fb1481a3d 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Model200Response.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java index b010e53b48c..7530e42d991 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java index 27d08557248..432b1acf7c4 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java index f2b9b1703bd..a62db5e76e6 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Name.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java index ec93aba0531..d49eac55c7b 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java index 6976ceb8fba..dec431cf77e 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterComposite.java index 02c16a99b70..02dcf76e05f 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterComposite.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterEnum.java index 948d80c2e6d..108accb2987 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java index 4c351dec3e4..1c0816f7b08 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 76f8a912f36..29ff60bcedf 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java index 784eb8baca8..209b4263f7e 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java index 1cf2f5bc5e6..83e16041f49 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java index de5bc439c5a..fc1d6c27da3 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 7fe69e168fd..5d0839cf36a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Animal.java index 590f36c0ae0..65e06a82bfa 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Animal.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/AnimalFarm.java index 0b1d6a74cc6..a470f42e125 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index b7e59a030a4..a578185e023 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index fdfeb6856f3..66a49933800 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ArrayTest.java index 62665c2536a..a62c86e04b4 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ArrayTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Capitalization.java index a72b0a72f46..b023a746b96 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Capitalization.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Cat.java index b882da0ad90..5be236f7232 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Cat.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Category.java index 464f4375c4b..6c16366280a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Category.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ClassModel.java index 4f764fde68d..a546eab1d37 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ClassModel.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Client.java index a7c4253499c..0af140c0fb9 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Client.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Dog.java index 7de179b2ade..41bd1a100d0 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Dog.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumArrays.java index 12caa480285..daefd52aed7 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumArrays.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumClass.java index abbd7a56668..09fd0a2ebdc 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumTest.java index 93d0da037b6..193d7f101db 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/FormatTest.java index 4118656d29e..67879022f96 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/FormatTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -329,8 +330,8 @@ public boolean equals(java.lang.Object o) { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && + Arrays.equals(this._byte, formatTest._byte) && + Arrays.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -339,7 +340,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 6dc9f12c4b8..6137eb3d2ed 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/MapTest.java index e6344a1df0f..18d50df62fb 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/MapTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 29bfc7e8c08..ec8f9d238b5 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Model200Response.java index 58624475e43..38fb1481a3d 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Model200Response.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ModelApiResponse.java index b010e53b48c..7530e42d991 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ModelReturn.java index 27d08557248..432b1acf7c4 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ModelReturn.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Name.java index f2b9b1703bd..a62db5e76e6 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Name.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/NumberOnly.java index ec93aba0531..d49eac55c7b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/NumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Order.java index 6976ceb8fba..dec431cf77e 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Order.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterComposite.java index 02c16a99b70..02dcf76e05f 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterComposite.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterEnum.java index 948d80c2e6d..108accb2987 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Pet.java index 4c351dec3e4..1c0816f7b08 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Pet.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 76f8a912f36..29ff60bcedf 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/SpecialModelName.java index 784eb8baca8..209b4263f7e 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Tag.java index 1cf2f5bc5e6..83e16041f49 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Tag.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/User.java index de5bc439c5a..fc1d6c27da3 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/User.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 7fe69e168fd..5d0839cf36a 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 590f36c0ae0..65e06a82bfa 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; 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 0b1d6a74cc6..a470f42e125 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; 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 b7e59a030a4..a578185e023 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 fdfeb6856f3..66a49933800 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 62665c2536a..a62c86e04b4 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Capitalization.java index a72b0a72f46..b023a746b96 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Capitalization.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 b882da0ad90..5be236f7232 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 464f4375c4b..6c16366280a 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ClassModel.java index 4f764fde68d..a546eab1d37 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ClassModel.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 a7c4253499c..0af140c0fb9 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 7de179b2ade..41bd1a100d0 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 12caa480285..daefd52aed7 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 abbd7a56668..09fd0a2ebdc 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 93d0da037b6..193d7f101db 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 4118656d29e..67879022f96 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -329,8 +330,8 @@ public boolean equals(java.lang.Object o) { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && + Arrays.equals(this._byte, formatTest._byte) && + Arrays.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -339,7 +340,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); } 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 6dc9f12c4b8..6137eb3d2ed 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 e6344a1df0f..18d50df62fb 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 29bfc7e8c08..ec8f9d238b5 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 58624475e43..38fb1481a3d 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 b010e53b48c..7530e42d991 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 27d08557248..432b1acf7c4 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 f2b9b1703bd..a62db5e76e6 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 ec93aba0531..d49eac55c7b 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 6976ceb8fba..dec431cf77e 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterComposite.java index 02c16a99b70..02dcf76e05f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterComposite.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterEnum.java index 948d80c2e6d..108accb2987 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 4c351dec3e4..1c0816f7b08 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 76f8a912f36..29ff60bcedf 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 784eb8baca8..209b4263f7e 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 1cf2f5bc5e6..83e16041f49 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 de5bc439c5a..fc1d6c27da3 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 0c24badae38..9a512f19a76 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java index 590f36c0ae0..65e06a82bfa 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AnimalFarm.java index 0b1d6a74cc6..a470f42e125 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 5997b31cbd4..a1f03fa677e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 2bc17f88eb3..ef99bc812ba 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java index 6804a14e313..7402f995d0d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Capitalization.java index a72b0a72f46..b023a746b96 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Capitalization.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java index b882da0ad90..5be236f7232 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Category.java index 464f4375c4b..6c16366280a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Category.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ClassModel.java index 4f764fde68d..a546eab1d37 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ClassModel.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Client.java index a7c4253499c..0af140c0fb9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Client.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Dog.java index 7de179b2ade..41bd1a100d0 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Dog.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java index 133a31f10b9..6597c52b7b3 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumClass.java index abbd7a56668..09fd0a2ebdc 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java index 93d0da037b6..193d7f101db 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java index 3fba5124727..a84ba80bcf8 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -329,8 +330,8 @@ public boolean equals(java.lang.Object o) { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && + Arrays.equals(this._byte, formatTest._byte) && + Arrays.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -339,7 +340,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 6dc9f12c4b8..6137eb3d2ed 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java index 31a7dae7253..65abf528469 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 98c2ad2cc78..23f51a5b894 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Model200Response.java index 58624475e43..38fb1481a3d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Model200Response.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelApiResponse.java index b010e53b48c..7530e42d991 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelReturn.java index 27d08557248..432b1acf7c4 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelReturn.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Name.java index f2b9b1703bd..a62db5e76e6 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Name.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/NumberOnly.java index ec93aba0531..d49eac55c7b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/NumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java index 55f9a8dba21..5f429686da4 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterComposite.java index 02c16a99b70..02dcf76e05f 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterComposite.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterEnum.java index 948d80c2e6d..108accb2987 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java index 6ece90bbfc3..da8a23e3d75 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 76f8a912f36..29ff60bcedf 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/SpecialModelName.java index 784eb8baca8..209b4263f7e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Tag.java index 1cf2f5bc5e6..83e16041f49 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Tag.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/User.java index de5bc439c5a..fc1d6c27da3 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/User.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 7fe69e168fd..5d0839cf36a 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java index 590f36c0ae0..65e06a82bfa 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AnimalFarm.java index 0b1d6a74cc6..a470f42e125 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index b7e59a030a4..a578185e023 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index fdfeb6856f3..66a49933800 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java index 62665c2536a..a62c86e04b4 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Capitalization.java index a72b0a72f46..b023a746b96 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Capitalization.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java index b882da0ad90..5be236f7232 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java index 464f4375c4b..6c16366280a 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ClassModel.java index 4f764fde68d..a546eab1d37 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ClassModel.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Client.java index a7c4253499c..0af140c0fb9 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Client.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java index 7de179b2ade..41bd1a100d0 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java index 12caa480285..daefd52aed7 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumClass.java index abbd7a56668..09fd0a2ebdc 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java index 93d0da037b6..193d7f101db 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/FormatTest.java index 4118656d29e..67879022f96 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/FormatTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -329,8 +330,8 @@ public boolean equals(java.lang.Object o) { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && + Arrays.equals(this._byte, formatTest._byte) && + Arrays.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -339,7 +340,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 6dc9f12c4b8..6137eb3d2ed 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java index e6344a1df0f..18d50df62fb 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 29bfc7e8c08..ec8f9d238b5 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Model200Response.java index 58624475e43..38fb1481a3d 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Model200Response.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelApiResponse.java index b010e53b48c..7530e42d991 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java index 27d08557248..432b1acf7c4 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Name.java index f2b9b1703bd..a62db5e76e6 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Name.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/NumberOnly.java index ec93aba0531..d49eac55c7b 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/NumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java index 6976ceb8fba..dec431cf77e 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterComposite.java index 02c16a99b70..02dcf76e05f 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterComposite.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterEnum.java index 948d80c2e6d..108accb2987 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java index 4c351dec3e4..1c0816f7b08 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 76f8a912f36..29ff60bcedf 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/SpecialModelName.java index 784eb8baca8..209b4263f7e 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java index 1cf2f5bc5e6..83e16041f49 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java index de5bc439c5a..fc1d6c27da3 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index b6ccfc43902..d6232b0766d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Animal.java index 89ddcdc99ec..145a5496391 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Animal.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AnimalFarm.java index a844db02e09..e8f3fe5a535 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index cdaf9bf9d11..8e1541bb021 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 31235c82a66..8f81852c594 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java index a8a208ede45..5e1826abb58 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Capitalization.java index 01fdd9ca963..57bef2e24bf 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Capitalization.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java index 5fdb74cbd1e..ad00926df65 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Category.java index 9a604aa8227..6d5eec8a096 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Category.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ClassModel.java index 6cc1bac7b54..6740f0f8ae4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ClassModel.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Client.java index 1b73505df83..51e327d3e94 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Client.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Dog.java index e6afcc17e57..a25dc15265a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Dog.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java index 0bf8c81509b..4483b1066ee 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumClass.java index 6a3f3f26ac8..ada7e9685b5 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.annotations.SerializedName; import android.os.Parcelable; import android.os.Parcel; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java index 7740669efa2..3d70e61b69c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/FormatTest.java index c9128a2a52b..fa648da3694 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/FormatTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -334,8 +335,8 @@ public boolean equals(java.lang.Object o) { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && + Arrays.equals(this._byte, formatTest._byte) && + Arrays.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -344,7 +345,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index f95ff9951f9..e1c681dff37 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java index 079daa6d717..0088eb96eee 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 345de387543..2ff2d8f2a3e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Model200Response.java index fee0bdffb90..d975c9e4b6a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Model200Response.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelApiResponse.java index 80bad00f37b..6b6d98de85e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelReturn.java index d1cb38fd7cb..6939dc5ee3d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelReturn.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Name.java index 60cbdc3aa5d..13640af182b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Name.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/NumberOnly.java index 2b28fe9bf57..be6d26ebfc6 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/NumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java index 008233f13a9..5d7e4dcd342 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterComposite.java index cf9f2f1fc78..323c7df0486 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterComposite.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterEnum.java index ec924e9fa73..31efd6613c2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.annotations.SerializedName; import android.os.Parcelable; import android.os.Parcel; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java index 37bbf49875f..0e9fa7ee9a7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index d79499f240b..ddea1d71395 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/SpecialModelName.java index c04c8185f20..d72d0735926 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Tag.java index 7557a6fbf34..8fa924b834c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Tag.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/User.java index 0853d0673be..9de1dd0bc37 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/User.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index b302fdf6012..a1d984bdcf1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java index f65c5bffcb3..f4b0464382d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AnimalFarm.java index 0b1d6a74cc6..a470f42e125 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index f9956fe46d8..fdcfdba6522 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index c79610d1c66..26b4422e7b2 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java index 747182e792e..df413692f8b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Capitalization.java index 00c564ab727..6a66eca36b0 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Capitalization.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java index 64d3fbdc7fe..4019e804b4f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java index 4e9f8f56e5e..6534aa559a2 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ClassModel.java index 4cf0a053250..a3c5c882bbd 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ClassModel.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Client.java index 43b20dce8da..e3b95f7e066 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Client.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java index 8fad06d9835..b810784f042 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java index 5f063c2ec38..6e69be28d66 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumClass.java index 3c19333c1ce..f219a419f66 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.annotations.SerializedName; import java.io.IOException; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java index fb20599a85c..a572c0d6b5b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java index ddb80771fda..3223d766753 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -332,8 +333,8 @@ public boolean equals(java.lang.Object o) { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && + Arrays.equals(this._byte, formatTest._byte) && + Arrays.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -342,7 +343,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 1b7ff181941..389d6955fb4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java index a791e68d8fb..26cf37c65d8 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 7c99abe53eb..435dc7ec0ee 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java index 0d39eb7eff5..1bcc6ac44bf 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java index 3d9352c50aa..faed84888dc 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java index ab6333ff86d..f64c0e8f0b8 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java index 1492add2952..f6a3f8f4195 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/NumberOnly.java index b13c0536a13..8f1010ad4fa 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/NumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java index 4dcf75a7cd0..b121d4cf4af 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterComposite.java index 56159fe5d93..a1fb77fbca0 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterComposite.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterEnum.java index 3b24acc6b51..6bc039c1668 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.annotations.SerializedName; import java.io.IOException; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java index dac1250ac07..22c29a1bede 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index f6e025412de..c8517f81bc1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java index e743292100b..9c0a4477a04 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java index bb6de58c8a1..a36d1300236 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java index 4ccb8a1c147..25bc8d9ba40 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 7fe69e168fd..5d0839cf36a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Animal.java index 590f36c0ae0..65e06a82bfa 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Animal.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/AnimalFarm.java index 0b1d6a74cc6..a470f42e125 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index b7e59a030a4..a578185e023 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index fdfeb6856f3..66a49933800 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayTest.java index 62665c2536a..a62c86e04b4 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Capitalization.java index a72b0a72f46..b023a746b96 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Capitalization.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Cat.java index b882da0ad90..5be236f7232 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Cat.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Category.java index 464f4375c4b..6c16366280a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Category.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ClassModel.java index 4f764fde68d..a546eab1d37 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ClassModel.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Client.java index a7c4253499c..0af140c0fb9 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Client.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Dog.java index 7de179b2ade..41bd1a100d0 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Dog.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumArrays.java index 12caa480285..daefd52aed7 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumArrays.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumClass.java index abbd7a56668..09fd0a2ebdc 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumTest.java index 93d0da037b6..193d7f101db 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/FormatTest.java index 4118656d29e..67879022f96 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/FormatTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -329,8 +330,8 @@ public boolean equals(java.lang.Object o) { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && + Arrays.equals(this._byte, formatTest._byte) && + Arrays.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -339,7 +340,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 6dc9f12c4b8..6137eb3d2ed 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MapTest.java index e6344a1df0f..18d50df62fb 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MapTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 29bfc7e8c08..ec8f9d238b5 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Model200Response.java index 58624475e43..38fb1481a3d 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Model200Response.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelApiResponse.java index b010e53b48c..7530e42d991 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelReturn.java index 27d08557248..432b1acf7c4 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelReturn.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Name.java index f2b9b1703bd..a62db5e76e6 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Name.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/NumberOnly.java index ec93aba0531..d49eac55c7b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/NumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Order.java index 6976ceb8fba..dec431cf77e 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Order.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterComposite.java index 02c16a99b70..02dcf76e05f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterComposite.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterEnum.java index 948d80c2e6d..108accb2987 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Pet.java index 4c351dec3e4..1c0816f7b08 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Pet.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 76f8a912f36..29ff60bcedf 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/SpecialModelName.java index 784eb8baca8..209b4263f7e 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Tag.java index 1cf2f5bc5e6..83e16041f49 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Tag.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/User.java index de5bc439c5a..fc1d6c27da3 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/User.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 498232b10f3..b62ea251930 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Animal.java index 8bf17b5aa20..4782da8a6f0 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Animal.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/AnimalFarm.java index 4211624eadb..7db9de213e0 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 3b8060ade59..7ab26ce41b0 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 35ac9d8f82f..adfdcb3c576 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayTest.java index 1d87c79cf23..ab3b03d8c5d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Capitalization.java index e615819e615..3cfc456d8a9 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Capitalization.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Cat.java index 2c3754590a1..a5db238552c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Cat.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Category.java index 9b1a6831a5e..9e0a8ac3853 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Category.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ClassModel.java index ff47df4679a..9538834beb2 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ClassModel.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Client.java index 6abf4ded943..6f2058aa94b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Client.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Dog.java index 3a1c69148bc..c2b13548871 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Dog.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumArrays.java index 826a8c7dc57..a8f80a6e988 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumArrays.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumClass.java index a9ae3e13dbd..7bf51521a58 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumTest.java index 5eed460c5f7..3827113df36 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/FormatTest.java index d0860fabab4..4a80fc9cb4b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/FormatTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -360,8 +361,8 @@ public boolean equals(java.lang.Object o) { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && + Arrays.equals(this._byte, formatTest._byte) && + Arrays.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -370,7 +371,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 9d54eca095a..a585b07f53e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MapTest.java index 72a58a1ee68..b66f1b804db 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MapTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 2819b08e715..286059b5e62 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Model200Response.java index fe0f079c094..00f5d72f95a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Model200Response.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelApiResponse.java index 4fd7b7ec649..8495dd65e1d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelReturn.java index 01db1577d56..3ba5af0638e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelReturn.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Name.java index 546adf743d4..4d26d01e0c8 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Name.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/NumberOnly.java index 657647cd2e3..e9b785767db 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/NumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Order.java index de1b90ef6a5..9ca6b9ea95c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Order.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterComposite.java index 1690010ca8c..8cadc6ff093 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterComposite.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterEnum.java index ec2ccbf9887..428fb42ddad 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Pet.java index 0e43949b872..c6a818a8b35 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Pet.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 0b09758c5ea..a3dc278524d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/SpecialModelName.java index b599c58ffdb..c8804eb8955 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Tag.java index 624044bc22a..85648303100 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Tag.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/User.java index af41ec70447..e347fbda45f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/User.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 7fe69e168fd..5d0839cf36a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Animal.java index 590f36c0ae0..65e06a82bfa 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Animal.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/AnimalFarm.java index 0b1d6a74cc6..a470f42e125 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index b7e59a030a4..a578185e023 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index fdfeb6856f3..66a49933800 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayTest.java index 62665c2536a..a62c86e04b4 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Capitalization.java index a72b0a72f46..b023a746b96 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Capitalization.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Cat.java index b882da0ad90..5be236f7232 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Cat.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Category.java index 464f4375c4b..6c16366280a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Category.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ClassModel.java index 4f764fde68d..a546eab1d37 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ClassModel.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Client.java index a7c4253499c..0af140c0fb9 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Client.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Dog.java index 7de179b2ade..41bd1a100d0 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Dog.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumArrays.java index 12caa480285..daefd52aed7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumArrays.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumClass.java index abbd7a56668..09fd0a2ebdc 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumTest.java index 93d0da037b6..193d7f101db 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/FormatTest.java index 4118656d29e..67879022f96 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/FormatTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -329,8 +330,8 @@ public boolean equals(java.lang.Object o) { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && + Arrays.equals(this._byte, formatTest._byte) && + Arrays.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -339,7 +340,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 6dc9f12c4b8..6137eb3d2ed 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MapTest.java index e6344a1df0f..18d50df62fb 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MapTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 29bfc7e8c08..ec8f9d238b5 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Model200Response.java index 58624475e43..38fb1481a3d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Model200Response.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelApiResponse.java index b010e53b48c..7530e42d991 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelReturn.java index 27d08557248..432b1acf7c4 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelReturn.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Name.java index f2b9b1703bd..a62db5e76e6 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Name.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/NumberOnly.java index ec93aba0531..d49eac55c7b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/NumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Order.java index 6976ceb8fba..dec431cf77e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Order.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterComposite.java index 02c16a99b70..02dcf76e05f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterComposite.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterEnum.java index 948d80c2e6d..108accb2987 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Pet.java index 4c351dec3e4..1c0816f7b08 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Pet.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 76f8a912f36..29ff60bcedf 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/SpecialModelName.java index 784eb8baca8..209b4263f7e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Tag.java index 1cf2f5bc5e6..83e16041f49 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Tag.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/User.java index de5bc439c5a..fc1d6c27da3 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/User.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 b302fdf6012..a1d984bdcf1 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 f65c5bffcb3..f4b0464382d 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 0b1d6a74cc6..a470f42e125 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; 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 f9956fe46d8..fdcfdba6522 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 c79610d1c66..26b4422e7b2 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 747182e792e..df413692f8b 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Capitalization.java index 00c564ab727..6a66eca36b0 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Capitalization.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 64d3fbdc7fe..4019e804b4f 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 4e9f8f56e5e..6534aa559a2 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ClassModel.java index 4cf0a053250..a3c5c882bbd 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ClassModel.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 43b20dce8da..e3b95f7e066 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 8fad06d9835..b810784f042 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 5f063c2ec38..6e69be28d66 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 3c19333c1ce..f219a419f66 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.annotations.SerializedName; import java.io.IOException; 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 fb20599a85c..a572c0d6b5b 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 5c0f01dd86b..44c40a9d267 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -332,8 +333,8 @@ public boolean equals(java.lang.Object o) { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && + Arrays.equals(this._byte, formatTest._byte) && + Arrays.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -342,7 +343,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); } 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 1b7ff181941..389d6955fb4 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 a791e68d8fb..26cf37c65d8 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 d023144f768..85dca79daee 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 0d39eb7eff5..1bcc6ac44bf 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 3d9352c50aa..faed84888dc 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 ab6333ff86d..f64c0e8f0b8 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 1492add2952..f6a3f8f4195 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 b13c0536a13..8f1010ad4fa 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 bea33fc7fb3..5d04d4e3323 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterComposite.java index 56159fe5d93..a1fb77fbca0 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterComposite.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterEnum.java index 3b24acc6b51..6bc039c1668 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.annotations.SerializedName; import java.io.IOException; 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 dac1250ac07..22c29a1bede 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 f6e025412de..c8517f81bc1 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 e743292100b..9c0a4477a04 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 bb6de58c8a1..a36d1300236 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 4ccb8a1c147..25bc8d9ba40 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index f03052a0c41..5a1c7691c55 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Animal.java index 023cb11b7eb..e58ba549b29 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Animal.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AnimalFarm.java index fc38d86a0aa..db24be97f8e 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index a5f6292b7b4..9e8e505b0a8 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 443501f0598..5bd6a61c518 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java index 4934689e7dc..9c14e88fd10 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Capitalization.java index e7a0b0ac935..c61fb2baf8a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Capitalization.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java index 7c513d6d6dd..e72ef14ea4b 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Category.java index bf8840d5fcf..7ea2c9e2665 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Category.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ClassModel.java index f3d9160e3db..4a97bef0b29 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ClassModel.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Client.java index a09f13e7a2c..aa7645f3346 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Client.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Dog.java index 3835e2aca37..91395070b38 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Dog.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java index f3cff0ea172..3e83a66d712 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumClass.java index f3211289d46..3a95df2b49e 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumTest.java index 779c3abcc1b..59a060b266c 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java index 1d332a76d97..111e5068092 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -339,8 +340,8 @@ public boolean equals(java.lang.Object o) { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && + Arrays.equals(this._byte, formatTest._byte) && + Arrays.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -349,7 +350,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 5f86fb84a96..7b51af838f2 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java index 1a15255161d..21f85f08021 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 01184029234..34c8aa2270a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Model200Response.java index 89ed29eca5d..5f9a94de22f 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Model200Response.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelApiResponse.java index acfb194d9d7..5663615e1e4 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelReturn.java index d372354eb7e..8a4bfc1cfe9 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelReturn.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Name.java index c09048cce39..12361b87e91 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Name.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/NumberOnly.java index 91ab4497dc2..5f8402f9295 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/NumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java index 752a57cbde8..26dccbe5417 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterComposite.java index 5b0e216eaa2..e836faf7e28 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterComposite.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterEnum.java index 778c8dca14a..2f7b2171652 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java index 653a9765a66..db153aadaa6 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index dc2373a365d..c1e4436bbe5 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/SpecialModelName.java index f01a06d4c78..9b2fa79d42f 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Tag.java index 71ff1bfcf67..6d3fad7d091 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Tag.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/User.java index 82c6be534ec..1683fcce7f3 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/User.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; 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 b302fdf6012..a1d984bdcf1 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 f65c5bffcb3..f4b0464382d 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 0b1d6a74cc6..a470f42e125 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; 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 f9956fe46d8..fdcfdba6522 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 c79610d1c66..26b4422e7b2 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 747182e792e..df413692f8b 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Capitalization.java index 00c564ab727..6a66eca36b0 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Capitalization.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 64d3fbdc7fe..4019e804b4f 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 4e9f8f56e5e..6534aa559a2 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ClassModel.java index 4cf0a053250..a3c5c882bbd 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ClassModel.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 43b20dce8da..e3b95f7e066 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 8fad06d9835..b810784f042 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 5f063c2ec38..6e69be28d66 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 3c19333c1ce..f219a419f66 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.annotations.SerializedName; import java.io.IOException; 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 fb20599a85c..a572c0d6b5b 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 ddb80771fda..3223d766753 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -332,8 +333,8 @@ public boolean equals(java.lang.Object o) { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && + Arrays.equals(this._byte, formatTest._byte) && + Arrays.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -342,7 +343,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); } 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 1b7ff181941..389d6955fb4 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 a791e68d8fb..26cf37c65d8 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 7c99abe53eb..435dc7ec0ee 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 0d39eb7eff5..1bcc6ac44bf 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 3d9352c50aa..faed84888dc 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 ab6333ff86d..f64c0e8f0b8 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 1492add2952..f6a3f8f4195 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 b13c0536a13..8f1010ad4fa 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 4dcf75a7cd0..b121d4cf4af 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterComposite.java index 56159fe5d93..a1fb77fbca0 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterComposite.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterEnum.java index 3b24acc6b51..6bc039c1668 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.annotations.SerializedName; import java.io.IOException; 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 dac1250ac07..22c29a1bede 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 f6e025412de..c8517f81bc1 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 e743292100b..9c0a4477a04 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 bb6de58c8a1..a36d1300236 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 4ccb8a1c147..25bc8d9ba40 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 b302fdf6012..a1d984bdcf1 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 f65c5bffcb3..f4b0464382d 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 0b1d6a74cc6..a470f42e125 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; 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 f9956fe46d8..fdcfdba6522 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 c79610d1c66..26b4422e7b2 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 747182e792e..df413692f8b 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Capitalization.java index 00c564ab727..6a66eca36b0 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Capitalization.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 64d3fbdc7fe..4019e804b4f 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 4e9f8f56e5e..6534aa559a2 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ClassModel.java index 4cf0a053250..a3c5c882bbd 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ClassModel.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 43b20dce8da..e3b95f7e066 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 8fad06d9835..b810784f042 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 5f063c2ec38..6e69be28d66 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 3c19333c1ce..f219a419f66 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.annotations.SerializedName; import java.io.IOException; 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 fb20599a85c..a572c0d6b5b 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 ddb80771fda..3223d766753 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -332,8 +333,8 @@ public boolean equals(java.lang.Object o) { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && + Arrays.equals(this._byte, formatTest._byte) && + Arrays.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -342,7 +343,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); } 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 1b7ff181941..389d6955fb4 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 a791e68d8fb..26cf37c65d8 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 7c99abe53eb..435dc7ec0ee 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 0d39eb7eff5..1bcc6ac44bf 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 3d9352c50aa..faed84888dc 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 ab6333ff86d..f64c0e8f0b8 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 1492add2952..f6a3f8f4195 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 b13c0536a13..8f1010ad4fa 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 4dcf75a7cd0..b121d4cf4af 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterComposite.java index 56159fe5d93..a1fb77fbca0 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterComposite.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterEnum.java index 3b24acc6b51..6bc039c1668 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.annotations.SerializedName; import java.io.IOException; 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 dac1250ac07..22c29a1bede 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 f6e025412de..c8517f81bc1 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 e743292100b..9c0a4477a04 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 bb6de58c8a1..a36d1300236 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; 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 4ccb8a1c147..25bc8d9ba40 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 @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index b302fdf6012..a1d984bdcf1 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Animal.java index f65c5bffcb3..f4b0464382d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Animal.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AnimalFarm.java index 0b1d6a74cc6..a470f42e125 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index f9956fe46d8..fdcfdba6522 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index c79610d1c66..26b4422e7b2 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayTest.java index 747182e792e..df413692f8b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Capitalization.java index 00c564ab727..6a66eca36b0 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Capitalization.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Cat.java index 64d3fbdc7fe..4019e804b4f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Cat.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Category.java index 4e9f8f56e5e..6534aa559a2 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Category.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ClassModel.java index 4cf0a053250..a3c5c882bbd 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ClassModel.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Client.java index 43b20dce8da..e3b95f7e066 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Client.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Dog.java index 8fad06d9835..b810784f042 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Dog.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumArrays.java index 5f063c2ec38..6e69be28d66 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumArrays.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumClass.java index 3c19333c1ce..f219a419f66 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.annotations.SerializedName; import java.io.IOException; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumTest.java index fb20599a85c..a572c0d6b5b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/FormatTest.java index ddb80771fda..3223d766753 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/FormatTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -332,8 +333,8 @@ public boolean equals(java.lang.Object o) { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && + Arrays.equals(this._byte, formatTest._byte) && + Arrays.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -342,7 +343,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 1b7ff181941..389d6955fb4 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MapTest.java index a791e68d8fb..26cf37c65d8 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MapTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 7c99abe53eb..435dc7ec0ee 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Model200Response.java index 0d39eb7eff5..1bcc6ac44bf 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Model200Response.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelApiResponse.java index 3d9352c50aa..faed84888dc 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelReturn.java index ab6333ff86d..f64c0e8f0b8 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelReturn.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Name.java index 1492add2952..f6a3f8f4195 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Name.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/NumberOnly.java index b13c0536a13..8f1010ad4fa 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/NumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Order.java index 4dcf75a7cd0..b121d4cf4af 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Order.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterComposite.java index 56159fe5d93..a1fb77fbca0 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterComposite.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterEnum.java index 3b24acc6b51..6bc039c1668 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.annotations.SerializedName; import java.io.IOException; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Pet.java index dac1250ac07..22c29a1bede 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Pet.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index f6e025412de..c8517f81bc1 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/SpecialModelName.java index e743292100b..9c0a4477a04 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Tag.java index bb6de58c8a1..a36d1300236 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Tag.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/User.java index 4ccb8a1c147..25bc8d9ba40 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/User.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; From 94746bb23d1e6b89f04846c11c7faee3620fc8ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Here=C3=B1=C3=BA?= Date: Tue, 9 Jan 2018 19:21:49 -0300 Subject: [PATCH 39/65] Typo on @266. Plus minor fixes (proposal) --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2581682674b..87550ea90c2 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ On a mac, it's even easier with `brew`: brew install swagger-codegen ``` -To build from source, you need the following installed and available in your $PATH: +To build from source, you need the following installed and available in your `$PATH:` * [Java 7 or 8](http://java.oracle.com) @@ -115,7 +115,7 @@ To build from source, you need the following installed and available in your $PA #### OS X Users Don't forget to install Java 7 or 8. You probably have 1.6. -Export JAVA_HOME in order to use the supported Java version: +Export `JAVA_HOME in order to use the supported Java version: ```sh export JAVA_HOME=`/usr/libexec/java_home -v 1.8` export PATH=${JAVA_HOME}/bin:$PATH @@ -263,7 +263,7 @@ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -o samples/client/petstore/java ``` -with a number of options. You can get the options with the `help generate` command (below only shows partal results): +with a number of options. You can get the options with the `help generate` command (below only shows partial results): ``` NAME @@ -339,7 +339,7 @@ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar meta \ -o output/myLibrary -n myClientCodegen -p com.my.company.codegen ``` -This will write, in the folder `output/myLibrary`, all the files you need to get started, including a README.md. Once modified and compiled, you can load your library with the codegen and generate clients with your own, custom-rolled logic. +This will write, in the folder `output/myLibrary`, all the files you need to get started, including a `README.md. Once modified and compiled, you can load your library with the codegen and generate clients with your own, custom-rolled logic. You would then compile your library in the `output/myLibrary` folder with `mvn package` and execute the codegen like such: @@ -540,7 +540,7 @@ Your config file for Java can look like For all the unspecified options default values will be used. Another way to override default options is to extend the config class for the specific language. -To change, for example, the prefix for the Objective-C generated files, simply subclass the ObjcClientCodegen.java: +To change, for example, the prefix for the Objective-C generated files, simply subclass the `ObjcClientCodegen.java`: ```java package com.mycompany.swagger.codegen; @@ -789,7 +789,8 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [Hewlett Packard Enterprise](https://hpe.com) - [High Technologies Center](http://htc-cs.com) - [Hootsuite](https://hootsuite.com/) -- [Huawei Cloud](https://www.huaweicloud.com) - [Cloud Stream Service](http://www.huaweicloud.com/en-us/product/cs.html) +- [Huawei Cloud](https://www.huaweicloud.com) +- [Cloud Stream Service](http://www.huaweicloud.com/en-us/product/cs.html) - [IBM](https://www.ibm.com) - [IMS Health](http://www.imshealth.com/en/solution-areas/technology-and-applications) - [Individual Standard IVS](http://www.individual-standard.com) From 094f69bc9e78cae17417e438b6430ffc88d85b29 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 14 Jan 2018 17:44:46 +0800 Subject: [PATCH 40/65] fix missing "`", removed duplicated Huawei entries --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 87550ea90c2..976e97fbe4a 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ To build from source, you need the following installed and available in your `$P #### OS X Users Don't forget to install Java 7 or 8. You probably have 1.6. -Export `JAVA_HOME in order to use the supported Java version: +Export `JAVA_HOME` in order to use the supported Java version: ```sh export JAVA_HOME=`/usr/libexec/java_home -v 1.8` export PATH=${JAVA_HOME}/bin:$PATH @@ -789,8 +789,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [Hewlett Packard Enterprise](https://hpe.com) - [High Technologies Center](http://htc-cs.com) - [Hootsuite](https://hootsuite.com/) -- [Huawei Cloud](https://www.huaweicloud.com) -- [Cloud Stream Service](http://www.huaweicloud.com/en-us/product/cs.html) +- [Huawei Cloud](http://www.huaweicloud.com/en-us/product/cs.html) - [IBM](https://www.ibm.com) - [IMS Health](http://www.imshealth.com/en/solution-areas/technology-and-applications) - [Individual Standard IVS](http://www.individual-standard.com) From 809e1f4c9344ae026e7f067579e15680a414818a Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Sun, 14 Jan 2018 18:47:08 +0900 Subject: [PATCH 41/65] [PHP] Cleanup tests (#7333) * Regenerate test/UserApiTest.php The same implementation as testLoginUser() is in tests/UserApiTest.php * Delete test/Client/ObjectSerializerTest.php The same implementation is in tests/ObjectSerializerTest.php * Update Petstore sample - bin/php-petstore.sh - bin/security/php-petstore.sh --- .../php/.swagger-codegen/VERSION | 2 +- .../php/SwaggerClient-php/lib/Api/FakeApi.php | 2 +- .../SwaggerClient-php/lib/ApiException.php | 2 +- .../SwaggerClient-php/lib/Configuration.php | 2 +- .../SwaggerClient-php/lib/HeaderSelector.php | 2 +- .../lib/Model/ModelInterface.php | 2 +- .../lib/Model/ModelReturn.php | 2 +- .../lib/ObjectSerializer.php | 2 +- .../petstore/php/.swagger-codegen/VERSION | 2 +- .../php/SwaggerClient-php/docs/Api/FakeApi.md | 6 +- .../php/SwaggerClient-php/docs/Api/PetApi.md | 4 +- .../lib/Api/AnotherFakeApi.php | 2 +- .../php/SwaggerClient-php/lib/Api/FakeApi.php | 2 +- .../lib/Api/FakeClassnameTags123Api.php | 2 +- .../php/SwaggerClient-php/lib/Api/PetApi.php | 2 +- .../SwaggerClient-php/lib/Api/StoreApi.php | 2 +- .../php/SwaggerClient-php/lib/Api/UserApi.php | 2 +- .../SwaggerClient-php/lib/ApiException.php | 2 +- .../SwaggerClient-php/lib/Configuration.php | 2 +- .../SwaggerClient-php/lib/HeaderSelector.php | 2 +- .../lib/Model/AdditionalPropertiesClass.php | 2 +- .../SwaggerClient-php/lib/Model/Animal.php | 2 +- .../lib/Model/AnimalFarm.php | 2 +- .../lib/Model/ApiResponse.php | 2 +- .../lib/Model/ArrayOfArrayOfNumberOnly.php | 2 +- .../lib/Model/ArrayOfNumberOnly.php | 2 +- .../SwaggerClient-php/lib/Model/ArrayTest.php | 2 +- .../lib/Model/Capitalization.php | 2 +- .../php/SwaggerClient-php/lib/Model/Cat.php | 2 +- .../SwaggerClient-php/lib/Model/Category.php | 2 +- .../lib/Model/ClassModel.php | 2 +- .../SwaggerClient-php/lib/Model/Client.php | 2 +- .../php/SwaggerClient-php/lib/Model/Dog.php | 2 +- .../lib/Model/EnumArrays.php | 2 +- .../SwaggerClient-php/lib/Model/EnumClass.php | 2 +- .../SwaggerClient-php/lib/Model/EnumTest.php | 2 +- .../lib/Model/FormatTest.php | 2 +- .../lib/Model/HasOnlyReadOnly.php | 2 +- .../SwaggerClient-php/lib/Model/MapTest.php | 2 +- ...PropertiesAndAdditionalPropertiesClass.php | 2 +- .../lib/Model/Model200Response.php | 2 +- .../lib/Model/ModelInterface.php | 2 +- .../SwaggerClient-php/lib/Model/ModelList.php | 2 +- .../lib/Model/ModelReturn.php | 2 +- .../php/SwaggerClient-php/lib/Model/Name.php | 2 +- .../lib/Model/NumberOnly.php | 2 +- .../php/SwaggerClient-php/lib/Model/Order.php | 2 +- .../lib/Model/OuterBoolean.php | 2 +- .../lib/Model/OuterComposite.php | 2 +- .../SwaggerClient-php/lib/Model/OuterEnum.php | 2 +- .../lib/Model/OuterNumber.php | 2 +- .../lib/Model/OuterString.php | 2 +- .../php/SwaggerClient-php/lib/Model/Pet.php | 2 +- .../lib/Model/ReadOnlyFirst.php | 2 +- .../lib/Model/SpecialModelName.php | 2 +- .../php/SwaggerClient-php/lib/Model/Tag.php | 2 +- .../php/SwaggerClient-php/lib/Model/User.php | 2 +- .../lib/ObjectSerializer.php | 2 +- .../test/Api/UserApiTest.php | 56 ++++-------- .../test/Client/ObjectSerializerTest.php | 87 ------------------- 60 files changed, 79 insertions(+), 186 deletions(-) delete mode 100644 samples/client/petstore/php/SwaggerClient-php/test/Client/ObjectSerializerTest.php diff --git a/samples/client/petstore-security-test/php/.swagger-codegen/VERSION b/samples/client/petstore-security-test/php/.swagger-codegen/VERSION index f9f7450d135..855ff9501eb 100644 --- a/samples/client/petstore-security-test/php/.swagger-codegen/VERSION +++ b/samples/client/petstore-security-test/php/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php index cd3f4ab623f..cb09e58e2b2 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php index 108ad687c60..9ed326a3c6f 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Configuration.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Configuration.php index 0d34cfd15a4..192e8b2c6c7 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Configuration.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Configuration.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/HeaderSelector.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/HeaderSelector.php index 5252eb2b99b..676173de468 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/HeaderSelector.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelInterface.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelInterface.php index e9f2f391535..6013c8cf977 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelInterface.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelInterface.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelReturn.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelReturn.php index 04844965614..a570a938c79 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelReturn.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ObjectSerializer.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ObjectSerializer.php index 4fcf557ae5a..c3f4590bc51 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ObjectSerializer.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/.swagger-codegen/VERSION b/samples/client/petstore/php/.swagger-codegen/VERSION index f9f7450d135..855ff9501eb 100644 --- a/samples/client/petstore/php/.swagger-codegen/VERSION +++ b/samples/client/petstore/php/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md index da5558c386f..f1f5c8e33aa 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md @@ -379,11 +379,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enum_form_string_array** | [**string[]**](../Model/string.md)| Form parameter enum test (string array) | [optional] + **enum_form_string_array** | **string[]**| Form parameter enum test (string array) | [optional] **enum_form_string** | **string**| Form parameter enum test (string) | [optional] [default to -efg] - **enum_header_string_array** | [**string[]**](../Model/string.md)| Header parameter enum test (string array) | [optional] + **enum_header_string_array** | **string[]**| Header parameter enum test (string array) | [optional] **enum_header_string** | **string**| Header parameter enum test (string) | [optional] [default to -efg] - **enum_query_string_array** | [**string[]**](../Model/string.md)| Query parameter enum test (string array) | [optional] + **enum_query_string_array** | **string[]**| Query parameter enum test (string array) | [optional] **enum_query_string** | **string**| Query parameter enum test (string) | [optional] [default to -efg] **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] **enum_query_double** | **double**| Query parameter enum test (double) | [optional] diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md index 46e42007fac..cb35aadc8b9 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md @@ -156,7 +156,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**string[]**](../Model/string.md)| Status values that need to be considered for filter | + **status** | **string[]**| Status values that need to be considered for filter | ### Return type @@ -209,7 +209,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**string[]**](../Model/string.md)| Tags to filter by | + **tags** | **string[]**| Tags to filter by | ### Return type diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php index 690831ca09e..b9a0e9b14c5 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php index 81e515b3ab4..b2e6060f9c9 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php index 8588d48a5e3..766ed2a2326 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php index 410d6a42913..cd582ccacbd 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php index 5df7f9f279b..380bd62cba8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php index 58e0abec8c2..ebcd633bfc9 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php index b38c7188347..a79b904b363 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php index 85e7de94902..6175d7110eb 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/HeaderSelector.php b/samples/client/petstore/php/SwaggerClient-php/lib/HeaderSelector.php index fe78207bbca..a0e99dda06a 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/HeaderSelector.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php index b0e23df0103..8e21d15c4cc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php index 97c264f8f44..87dc1f5e044 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php index 56c0d7ae63b..8d85c503fc8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php index 4457c8de9c6..5990855d5b1 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 62f654eb196..0d057470d92 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php index 06c74a80f4f..dce3704329c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php index 2d6e4f18af4..0c22a3daddb 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Capitalization.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Capitalization.php index df5d8fbdcdd..b08068adc86 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Capitalization.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php index 144b7f4f787..241ee15f135 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php index 9e3e0408ea7..6176fa427f1 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php index e2624c52623..b6fef51eeb0 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php index b2fefd61c74..72534e59b1b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php index e1a06e12191..e0f2bbc47a4 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php index 9bdc2a52853..0d548f2ad39 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php index d54af35fc0d..5421b7e1bca 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php index 2ab49ca9108..87dcc3da6bd 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php index 9f2dd600f8b..a8c74e7b761 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php index 072c9775dd9..e755f7dc3c8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php index f687d521b3c..1cf57a9e8fe 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 34154c71e62..307a5ed85ce 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php index 338f3649349..618a4d55737 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelInterface.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelInterface.php index 0c3499a8b25..e1326fc3652 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelInterface.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelInterface.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php index 885e6c4b06a..f9b428690a8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php index 079922e9d4c..96b9a69e459 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php index 25bfb714533..32749bdf0e9 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php index 92ba431bfe7..25a49c0f2c8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php index 5d84ee4b890..60831bb91d6 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterBoolean.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterBoolean.php index 77fe3c5abb1..b91839a477e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterBoolean.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterBoolean.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterComposite.php index 406df360ac5..9c3a3b7a56c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterComposite.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterEnum.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterEnum.php index eb987be2a3c..f899365e22f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterEnum.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterEnum.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterNumber.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterNumber.php index 28b9d87534a..bec502714e7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterNumber.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterNumber.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterString.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterString.php index afa5661243a..b8a15fd7a60 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterString.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterString.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php index dacbe59d3a4..5369903fbfa 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php index bf186ac7759..32bbedbeca1 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php index 9ee9d1484a6..5610494dd77 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php index b3512323216..44537a44564 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php index 606ced51279..054cb339ac0 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php index 22ab6d01226..1f7e3f3d614 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.0-SNAPSHOT + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Api/UserApiTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Api/UserApiTest.php index aa312ed6e9f..3f843a54779 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Api/UserApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Api/UserApiTest.php @@ -5,8 +5,7 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ @@ -18,18 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Swagger Codegen version: 2.4.0-SNAPSHOT */ /** @@ -38,10 +26,9 @@ * Please update the test case below to test the endpoint. */ -namespace Swagger\Client\Api; +namespace Swagger\Client; use \Swagger\Client\Configuration; -use \Swagger\Client\ApiClient; use \Swagger\Client\ApiException; use \Swagger\Client\ObjectSerializer; @@ -50,27 +37,38 @@ * * @category Class * @package Swagger\Client - * @author http://github.com/swagger-api/swagger-codegen - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 + * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class UserApiTest extends \PHPUnit_Framework_TestCase { /** - * Setup before running each test case + * Setup before running any test cases */ public static function setUpBeforeClass() { + } + /** + * Setup before running each test case + */ + public function setUp() + { } /** * Clean up after running each test case */ - public static function tearDownAfterClass() + public function tearDown() { + } + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass() + { } /** @@ -81,7 +79,6 @@ public static function tearDownAfterClass() */ public function testCreateUser() { - } /** @@ -92,7 +89,6 @@ public function testCreateUser() */ public function testCreateUsersWithArrayInput() { - } /** @@ -103,7 +99,6 @@ public function testCreateUsersWithArrayInput() */ public function testCreateUsersWithListInput() { - } /** @@ -114,7 +109,6 @@ public function testCreateUsersWithListInput() */ public function testDeleteUser() { - } /** @@ -125,7 +119,6 @@ public function testDeleteUser() */ public function testGetUserByName() { - } /** @@ -136,16 +129,6 @@ public function testGetUserByName() */ public function testLoginUser() { - $user_api = new UserApi(); - // login - $response = $user_api->loginUser("xxxxx", "yyyyyyyy"); - - $this->assertInternalType("string", $response); - $this->assertRegExp( - "/^logged in user session/", - $response, - "response string starts with 'logged in user session'" - ); } /** @@ -156,7 +139,6 @@ public function testLoginUser() */ public function testLogoutUser() { - } /** @@ -167,7 +149,5 @@ public function testLogoutUser() */ public function testUpdateUser() { - } - } diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Client/ObjectSerializerTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Client/ObjectSerializerTest.php deleted file mode 100644 index 1b008fbb62a..00000000000 --- a/samples/client/petstore/php/SwaggerClient-php/test/Client/ObjectSerializerTest.php +++ /dev/null @@ -1,87 +0,0 @@ -assertSame("sun.gif", $s->sanitizeFilename("sun.gif")); - $this->assertSame("sun.gif", $s->sanitizeFilename("../sun.gif")); - $this->assertSame("sun.gif", $s->sanitizeFilename("/var/tmp/sun.gif")); - $this->assertSame("sun.gif", $s->sanitizeFilename("./sun.gif")); - - $this->assertSame("sun", $s->sanitizeFilename("sun")); - $this->assertSame("sun.gif", $s->sanitizeFilename("..\sun.gif")); - $this->assertSame("sun.gif", $s->sanitizeFilename("\var\tmp\sun.gif")); - $this->assertSame("sun.gif", $s->sanitizeFilename("c:\var\tmp\sun.gif")); - $this->assertSame("sun.gif", $s->sanitizeFilename(".\sun.gif")); - } - -} From 0bf430a803aa5fa826f1cb3435022d9225a9c6ea Mon Sep 17 00:00:00 2001 From: etherealjoy <33183834+etherealjoy@users.noreply.github.com> Date: Sun, 14 Jan 2018 10:47:54 +0100 Subject: [PATCH 42/65] Qt5cpp Add support for nested containers (#7340) * Disable creation of empty json fields and fields for primitives which were not set, but using default values modelnamePrefix will be the one passed from command line or SWG if none * Updates after review Also common http files are splitted Update Petstore examples * Small Fixes for cleaning up arrays of arrays/maps * Changes - Api Body pass by Reference, avoid seg fault due to deletion of auto constructed object passed as parameter. - Support Maps and Arrays upto a depth of 2 - Refactor Helpers to handle Maps and simplify code * Remove size check due to possible incorrect type * Update PetStore Examples for Qt5 C++ and small fixes for QDate/QDateTime * Updates after review. Fixes typo and remove usage of auto keyword. * Restored usage of auto keyword. --- .../main/resources/qt5cpp/api-body.mustache | 12 +- .../main/resources/qt5cpp/api-header.mustache | 2 +- .../resources/qt5cpp/helpers-body.mustache | 311 +++++++++++++++--- .../resources/qt5cpp/helpers-header.mustache | 3 +- .../main/resources/qt5cpp/model-body.mustache | 150 ++++----- .../petstore/qt5cpp/PetStore/PetStore.pro | 24 +- .../petstore/qt5cpp/client/SWGApiResponse.cpp | 10 +- .../petstore/qt5cpp/client/SWGCategory.cpp | 6 +- .../petstore/qt5cpp/client/SWGHelpers.cpp | 311 +++++++++++++++--- .../petstore/qt5cpp/client/SWGHelpers.h | 3 +- .../petstore/qt5cpp/client/SWGOrder.cpp | 19 +- .../client/petstore/qt5cpp/client/SWGPet.cpp | 38 ++- .../petstore/qt5cpp/client/SWGPetApi.cpp | 4 +- .../client/petstore/qt5cpp/client/SWGPetApi.h | 4 +- .../petstore/qt5cpp/client/SWGStoreApi.cpp | 2 +- .../petstore/qt5cpp/client/SWGStoreApi.h | 2 +- .../client/petstore/qt5cpp/client/SWGTag.cpp | 6 +- .../client/petstore/qt5cpp/client/SWGUser.cpp | 28 +- .../petstore/qt5cpp/client/SWGUserApi.cpp | 20 +- .../petstore/qt5cpp/client/SWGUserApi.h | 8 +- 20 files changed, 701 insertions(+), 262 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache index 5e3290aded4..263c089d244 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache @@ -22,7 +22,7 @@ namespace {{this}} { {{#operations}} {{#operation}} void -{{classname}}::{{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { +{{classname}}::{{nickname}}({{#allParams}}{{{dataType}}}{{#isBodyParam}}&{{/isBodyParam}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("{{{path}}}"); @@ -98,17 +98,17 @@ void {{#bodyParams}} {{#isContainer}} - QJsonArray* {{paramName}}Array = new QJsonArray(); - toJsonArray((QList*){{paramName}}, {{paramName}}Array, QString("body"), QString("{{prefix}}User*")); + auto {{paramName}}_jobj = new QJsonObject(); + toJsonArray((QList*){{paramName}}, {{paramName}}_jobj, QString("body"), QString("{{prefix}}User*")); - QJsonDocument doc(*{{paramName}}Array); + QJsonDocument doc(*{{paramName}}_jobj); QByteArray bytes = doc.toJson(); input.request_body.append(bytes); {{/isContainer}} {{^isContainer}}{{#isString}} - QString output(*{{paramName}});{{/isString}}{{^isString}} - QString output = {{paramName}}.asJson();{{/isString}} + QString output(*{{paramName}});{{/isString}}{{#isByteArray}}QString output(*{{paramName}});{{/isByteArray}}{{^isString}}{{^isByteArray}} + QString output = {{paramName}}.asJson();{{/isByteArray}}{{/isString}} input.request_body.append(output); {{/isContainer}}{{/bodyParams}} diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/api-header.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/api-header.mustache index 286936ef64a..b992c16c1d1 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/api-header.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/api-header.mustache @@ -25,7 +25,7 @@ public: QString basePath; QMap defaultHeaders; - {{#operations}}{{#operation}}void {{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{#operations}}{{#operation}}void {{nickname}}({{#allParams}}{{{dataType}}}{{#isBodyParam}}&{{/isBodyParam}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{/operation}}{{/operations}} private: {{#operations}}{{#operation}}void {{nickname}}Callback ({{prefix}}HttpRequestWorker * worker); diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache index 8bd673e980e..1ef996838b8 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-body.mustache @@ -40,17 +40,16 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) { } else if (QStringLiteral("QString").compare(type) == 0) { QString **val = static_cast(value); - if(val != nullptr) { if(!obj.isNull()) { // create a new value and return - delete *val; + if(*val != nullptr) delete *val; *val = new QString(obj.toString()); return; } else { // set target to nullptr - delete *val; + if(*val != nullptr) delete *val; *val = nullptr; } } @@ -64,13 +63,13 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) { if(val != nullptr) { if(!obj.isNull()) { // create a new value and return - delete *val; + if(*val != nullptr) delete *val; *val = new QDateTime(QDateTime::fromString(obj.toString(), Qt::ISODate)); return; } else { // set target to nullptr - delete *val; + if(*val != nullptr) delete *val; *val = nullptr; } } @@ -84,13 +83,13 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) { if(val != nullptr) { if(!obj.isNull()) { // create a new value and return - delete *val; + if(*val != nullptr) delete *val; *val = new QDate(QDate::fromString(obj.toString(), Qt::ISODate)); return; } else { // set target to nullptr - delete *val; + if(*val != nullptr) delete *val; *val = nullptr; } } @@ -104,14 +103,14 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) { if(val != nullptr) { if(!obj.isNull()) { // create a new value and return - delete *val; + if(*val != nullptr) delete *val; *val = new QByteArray(QByteArray::fromBase64(QByteArray::fromStdString(obj.toString().toStdString()))); return; } else { // set target to nullptr - delete *val; + if(*val != nullptr) delete *val; *val = nullptr; } } @@ -122,124 +121,253 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) { else if(type.startsWith("{{prefix}}") && obj.isObject()) { // complex type QJsonObject jsonObj = obj.toObject(); - {{prefix}}Object * so = ({{prefix}}Object*)::{{cppNamespace}}::create(type); + {{prefix}}Object * so = ({{prefix}}Object*)::{{cppNamespace}}::create(complexType); if(so != nullptr) { so->fromJsonObject(jsonObj); {{prefix}}Object **val = static_cast<{{prefix}}Object**>(value); - delete *val; + if(*val != nullptr) delete *val; *val = so; } } else if(type.startsWith("QList") && QString("").compare(complexType) != 0 && obj.isArray()) { // list of values if(complexType.startsWith("{{prefix}}")) { - QList<{{prefix}}Object*>* output = new QList<{{prefix}}Object*>(); + auto output = reinterpret_cast **> (value); + for (auto item : **output) { + if(item != nullptr) delete item; + } + (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr) { // it's an object - {{prefix}}Object * val = ({{prefix}}Object*)create(complexType); + {{prefix}}Object * val = ({{prefix}}Object*)::{{cppNamespace}}::create(complexType); QJsonObject t = jval.toObject(); - val->fromJsonObject(t); - output->append(val); - } - QList<{{prefix}}Object*> **val = static_cast**>(value); - for (auto item : **val) { - delete item; + (*output)->append(val); } - delete *val; - *val = output; } else if(QStringLiteral("qint32").compare(complexType) == 0) { - QList **output = reinterpret_cast **> (value); + auto output = reinterpret_cast **> (value); (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr){ qint32 val; - setValue(&val, jval, QStringLiteral("qint32"), QStringLiteral("")); + ::{{cppNamespace}}::setValue(&val, jval, QStringLiteral("qint32"), QStringLiteral("")); (*output)->push_back(val); } } else if(QStringLiteral("qint64").compare(complexType) == 0) { - QList **output = reinterpret_cast **> (value); + auto output = reinterpret_cast **> (value); (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr){ qint64 val; - setValue(&val, jval, QStringLiteral("qint64"), QStringLiteral("")); + ::{{cppNamespace}}::setValue(&val, jval, QStringLiteral("qint64"), QStringLiteral("")); (*output)->push_back(val); } } else if(QStringLiteral("bool").compare(complexType) == 0) { - QList **output = reinterpret_cast **> (value); + auto output = reinterpret_cast **> (value); (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr){ bool val; - setValue(&val, jval, QStringLiteral("bool"), QStringLiteral("")); + ::{{cppNamespace}}::setValue(&val, jval, QStringLiteral("bool"), QStringLiteral("")); (*output)->push_back(val); } } else if(QStringLiteral("float").compare(complexType) == 0) { - QList **output = reinterpret_cast **> (value); + auto output = reinterpret_cast **> (value); (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr){ float val; - setValue(&val, jval, QStringLiteral("float"), QStringLiteral("")); + ::{{cppNamespace}}::setValue(&val, jval, QStringLiteral("float"), QStringLiteral("")); (*output)->push_back(val); } } else if(QStringLiteral("double").compare(complexType) == 0) { - QList **output = reinterpret_cast **> (value); + auto output = reinterpret_cast **> (value); (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr){ double val; - setValue(&val, jval, QStringLiteral("double"), QStringLiteral("")); + ::{{cppNamespace}}::setValue(&val, jval, QStringLiteral("double"), QStringLiteral("")); (*output)->push_back(val); } } else if(QStringLiteral("QString").compare(complexType) == 0) { - QList **output = reinterpret_cast **> (value); + auto output = reinterpret_cast **> (value); for (auto item : **output) { - delete item; + if(item != nullptr) delete item; } (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr){ QString * val = new QString(); - setValue(&val, jval, QStringLiteral("QString"), QStringLiteral("")); + ::{{cppNamespace}}::setValue(&val, jval, QStringLiteral("QString"), QStringLiteral("")); (*output)->push_back(val); } } else if(QStringLiteral("QDate").compare(complexType) == 0) { - QList **output = reinterpret_cast **> (value); + auto output = reinterpret_cast **> (value); for (auto item : **output) { - delete item; + if(item != nullptr) delete item; } (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr){ QDate * val = new QDate(); - setValue(&val, jval, QStringLiteral("QDate"), QStringLiteral("")); + ::{{cppNamespace}}::setValue(&val, jval, QStringLiteral("QDate"), QStringLiteral("")); (*output)->push_back(val); } } else if(QStringLiteral("QDateTime").compare(complexType) == 0) { - QList **output = reinterpret_cast **> (value); + auto output = reinterpret_cast **> (value); for (auto item : **output) { - delete item; + if(item != nullptr) delete item; } (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr){ QDateTime * val = new QDateTime(); - setValue(&val, jval, QStringLiteral("QDateTime"), QStringLiteral("")); + ::{{cppNamespace}}::setValue(&val, jval, QStringLiteral("QDateTime"), QStringLiteral("")); (*output)->push_back(val); } } } + else if(type.startsWith("QMap") && QString("").compare(complexType) != 0 && obj.isObject()) { + // list of values + if(complexType.startsWith("{{prefix}}")) { + auto output = reinterpret_cast **> (value); + for (auto item : **output) { + if(item != nullptr) delete item; + } + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + auto val = ({{prefix}}Object*)::{{cppNamespace}}::create(complexType); + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::{{cppNamespace}}::setValue(&val, jsonval, complexType, complexType); + (*output)->insert(itemkey, val); + } + } + } + else if(QStringLiteral("qint32").compare(complexType) == 0) { + auto output = reinterpret_cast **> (value); + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + qint32 val; + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::{{cppNamespace}}::setValue(&val, jsonval, QStringLiteral("qint32"), QStringLiteral("")); + (*output)->insert( itemkey, val); + } + } + } + else if(QStringLiteral("qint64").compare(complexType) == 0) { + auto output = reinterpret_cast **> (value); + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + qint64 val; + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::{{cppNamespace}}::setValue(&val, jsonval, QStringLiteral("qint64"), QStringLiteral("")); + (*output)->insert( itemkey, val); + } + } + } + else if(QStringLiteral("bool").compare(complexType) == 0) { + auto output = reinterpret_cast **> (value); + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + bool val; + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::{{cppNamespace}}::setValue(&val, jsonval, QStringLiteral("bool"), QStringLiteral("")); + (*output)->insert( itemkey, val); + } + } + } + else if(QStringLiteral("float").compare(complexType) == 0) { + auto output = reinterpret_cast **> (value); + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + float val; + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::{{cppNamespace}}::setValue(&val, jsonval, QStringLiteral("float"), QStringLiteral("")); + (*output)->insert( itemkey, val); + } + } + } + else if(QStringLiteral("double").compare(complexType) == 0) { + auto output = reinterpret_cast **> (value); + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + double val; + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::{{cppNamespace}}::setValue(&val, jsonval, QStringLiteral("double"), QStringLiteral("")); + (*output)->insert( itemkey, val); + } + } + } + else if(QStringLiteral("QString").compare(complexType) == 0) { + auto output = reinterpret_cast **> (value); + for (auto item : **output) { + if(item != nullptr) delete item; + } + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + QString * val = new QString(); + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::{{cppNamespace}}::setValue(&val, jsonval, QStringLiteral("QString"), QStringLiteral("")); + (*output)->insert( itemkey, val); + } + } + } + else if(QStringLiteral("QDate").compare(complexType) == 0) { + auto output = reinterpret_cast **> (value); + for (auto item : **output) { + if(item != nullptr) delete item; + } + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + QDate * val = new QDate(); + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::{{cppNamespace}}::setValue(&val, jsonval, QStringLiteral("QDate"), QStringLiteral("")); + (*output)->insert( itemkey, val); + } + } + } + else if(QStringLiteral("QDateTime").compare(complexType) == 0) { + auto output = reinterpret_cast **> (value); + for (auto item : **output) { + if(item != nullptr) delete item; + } + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + QDateTime * val = new QDateTime(); + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::{{cppNamespace}}::setValue(&val, jsonval, QStringLiteral("QDateTime"), QStringLiteral("")); + (*output)->insert( itemkey, val); + } + } + } + } } void @@ -253,7 +381,7 @@ toJsonValue(QString name, void* value, QJsonObject* output, QString type) { QJsonObject* o = (*{{prefix}}object).asJsonObject(); if(name != nullptr) { output->insert(name, *o); - delete o; + if(o != nullptr) delete o; } else { output->empty(); @@ -302,54 +430,133 @@ toJsonValue(QString name, void* value, QJsonObject* output, QString type) { } void -toJsonArray(QList* value, QJsonArray* output, QString innerName, QString innerType) { +toJsonArray(QList* value, QJsonObject* output, QString innerName, QString innerType) { + if((value == nullptr) || (output == nullptr)) { + return; + } + QJsonArray outputarray; if(innerType.startsWith("{{prefix}}")){ for(void* obj : *value) { {{prefix}}Object *{{prefix}}object = reinterpret_cast<{{prefix}}Object *>(obj); if({{prefix}}object != nullptr) { - output->append(*({{prefix}}object->asJsonObject())); + outputarray.append(*({{prefix}}object->asJsonObject())); } } } else if(QStringLiteral("QString").compare(innerType) == 0) { for(QString* obj : *(reinterpret_cast*>(value))){ - output->append(QJsonValue(*obj)); + outputarray.append(QJsonValue(*obj)); } } else if(QStringLiteral("QDate").compare(innerType) == 0) { for(QDate* obj : *(reinterpret_cast*>(value))){ - output->append(QJsonValue(obj->toString(Qt::ISODate))); + outputarray.append(QJsonValue(obj->toString(Qt::ISODate))); } } else if(QStringLiteral("QDateTime").compare(innerType) == 0) { for(QDateTime* obj : *(reinterpret_cast*>(value))){ - output->append(QJsonValue(obj->toString(Qt::ISODate))); } + outputarray.append(QJsonValue(obj->toString(Qt::ISODate))); } } else if(QStringLiteral("QByteArray").compare(innerType) == 0) { for(QByteArray* obj : *(reinterpret_cast*>(value))){ - output->append(QJsonValue(QString(obj->toBase64()))); + outputarray.append(QJsonValue(QString(obj->toBase64()))); } } else if(QStringLiteral("qint32").compare(innerType) == 0) { for(qint32 obj : *(reinterpret_cast*>(value))) - output->append(QJsonValue(obj)); + outputarray.append(QJsonValue(obj)); } else if(QStringLiteral("qint64").compare(innerType) == 0) { for(qint64 obj : *(reinterpret_cast*>(value))) - output->append(QJsonValue(obj)); + outputarray.append(QJsonValue(obj)); } else if(QStringLiteral("bool").compare(innerType) == 0) { for(bool obj : *(reinterpret_cast*>(value))) - output->append(QJsonValue(obj)); + outputarray.append(QJsonValue(obj)); } else if(QStringLiteral("float").compare(innerType) == 0) { for(float obj : *(reinterpret_cast*>(value))) - output->append(QJsonValue(obj)); + outputarray.append(QJsonValue(obj)); } else if(QStringLiteral("double").compare(innerType) == 0) { for(double obj : *(reinterpret_cast*>(value))) - output->append(QJsonValue(obj)); + outputarray.append(QJsonValue(obj)); + } + output->insert(innerName, outputarray); +} + +void +toJsonMap(QMap* value, QJsonObject* output, QString innerName, QString innerType) { + if((value == nullptr) || (output == nullptr)) { + return; + } + QJsonObject mapobj; + if(innerType.startsWith("{{prefix}}")){ + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + ::{{cppNamespace}}::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType); + } + } + else if(QStringLiteral("QString").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + ::{{cppNamespace}}::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType); + } + } + else if(QStringLiteral("QDate").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + ::{{cppNamespace}}::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType); + } + } + else if(QStringLiteral("QDateTime").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + ::{{cppNamespace}}::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType); + } + } + else if(QStringLiteral("QByteArray").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + ::{{cppNamespace}}::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType); + } + } + else if(QStringLiteral("qint32").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + auto val = items->value(itemkey); + ::{{cppNamespace}}::toJsonValue(itemkey, &val, &mapobj, innerType); + } + } + else if(QStringLiteral("qint64").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + auto val = items->value(itemkey); + ::{{cppNamespace}}::toJsonValue(itemkey, &val, &mapobj, innerType); + } + } + else if(QStringLiteral("bool").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + auto val = items->value(itemkey); + ::{{cppNamespace}}::toJsonValue(itemkey, &val, &mapobj, innerType); + } + } + else if(QStringLiteral("float").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + auto val = items->value(itemkey); + ::{{cppNamespace}}::toJsonValue(itemkey, &val, &mapobj, innerType); + } + } + else if(QStringLiteral("double").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys() ) { + auto val = items->value(itemkey); + ::{{cppNamespace}}::toJsonValue(itemkey, &val, &mapobj, innerType); + } } + output->insert(innerName, mapobj); } QString diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-header.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-header.mustache index d35465685bf..c3569d7e7be 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-header.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-header.mustache @@ -9,8 +9,9 @@ namespace {{this}} { {{/cppNamespaceDeclarations}} void setValue(void* value, QJsonValue obj, QString type, QString complexType); - void toJsonArray(QList* value, QJsonArray* output, QString innerName, QString innerType); + void toJsonArray(QList* value, QJsonObject* output, QString innerName, QString innerType); void toJsonValue(QString name, void* value, QJsonObject* output, QString type); + void toJsonMap(QMap* value, QJsonObject* output, QString innerName, QString innerType); bool isCompatibleJsonValue(QString type); QString stringValue(QString* value); QString stringValue(qint32 value); diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache index ceb8b05cdb7..f5e707f5605 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache @@ -38,12 +38,15 @@ void {{classname}}::cleanup() { {{#vars}} {{#complexType}} - if({{name}} != nullptr) { - {{#isContainer}}{{#isListContainer}}QList<{{complexType}}*>* arr = {{name}};{{/isListContainer}}{{#isMapContainer}}QMap* arr = {{name}};{{/isMapContainer}} - foreach({{complexType}}* o, *arr) { + if({{name}} != nullptr) { {{#isContainer}} + auto arr = {{name}}; + for(auto o: *arr) { {{#items.isContainer}} + for(auto o1: *o) { + delete o1; + }{{/items.isContainer}} delete o; - } - {{/isContainer}}delete {{name}}; + }{{/isContainer}} + delete {{name}}; }{{/complexType}} {{/vars}} } @@ -60,33 +63,30 @@ void void {{classname}}::fromJsonObject(QJsonObject &pJson) { {{#vars}} - {{^isContainer}} - ::{{cppNamespace}}::setValue(&{{name}}, pJson["{{baseName}}"], "{{baseType}}", "{{complexType}}"); - {{/isContainer}} - {{#isListContainer}} - {{#complexType}} - ::{{cppNamespace}}::setValue(&{{name}}, pJson["{{baseName}}"], "{{baseType}}", "{{complexType}}"); - {{/complexType}} - {{^complexType}} - ::{{cppNamespace}}::setValue(&{{name}}, pJson["{{baseName}}"], "{{baseType}}", "{{items.baseType}}"); - {{/complexType}} - {{/isListContainer}} - {{#isMapContainer}} - if( pJson["{{baseName}}"].isObject()){ + {{^isContainer}}::{{cppNamespace}}::setValue(&{{name}}, pJson["{{baseName}}"], "{{baseType}}", "{{complexType}}");{{/isContainer}} + {{#isContainer}}{{^items.isContainer}}::{{cppNamespace}}::setValue(&{{name}}, pJson["{{baseName}}"], "{{baseType}}", "{{items.baseType}}");{{/items.isContainer}}{{#items.isContainer}}{{#isListContainer}} + if(pJson["{{baseName}}"].isArray()){ + auto arr = pJson["{{baseName}}"].toArray(); + for (const QJsonValue & jval : arr) { + {{#items.isListContainer}}auto {{name}}_item = new QList<{{items.items.baseType}}{{^items.items.isLong}}{{^items.items.isInteger}}{{^items.items.isDouble}}{{^items.items.isFloat}}{{^items.items.isBoolean}}*{{/items.items.isBoolean}}{{/items.items.isFloat}}{{/items.items.isDouble}}{{/items.items.isInteger}}{{/items.items.isLong}}>();{{/items.isListContainer}} + {{#items.isMapContainer}}auto {{name}}_item = new QMap();{{/items.isMapContainer}} + auto jsonval = jval.toObject(); + ::{{cppNamespace}}::setValue({{name}}_item, jsonval, "{{items.baseType}}", "{{items.items.baseType}}"); + {{name}}->push_back({{name}}_item); + } + }{{/isListContainer}}{{#isMapContainer}} + if(pJson["{{baseName}}"].isObject()){ auto varmap = pJson["{{baseName}}"].toObject().toVariantMap(); if(varmap.count() > 0){ - for(auto val : varmap.keys() ){ - { - {{items.baseType}} *{{name}}_item = new {{items.baseType}}(); - auto jsonval = QJsonValue::fromVariant(varmap[val]); - ::{{cppNamespace}}::setValue(&{{name}}_item, jsonval, "{{items.baseType}}", "{{items.baseType}}"); - {{name}}->insert({{name}}->end(), val, {{name}}_item); - } + for(auto val : varmap.keys()){ + {{#items.isListContainer}}auto {{name}}_item = new QList<{{items.items.baseType}}{{^items.items.isLong}}{{^items.items.isInteger}}{{^items.items.isDouble}}{{^items.items.isFloat}}{{^items.items.isBoolean}}*{{/items.items.isBoolean}}{{/items.items.isFloat}}{{/items.items.isDouble}}{{/items.items.isInteger}}{{/items.items.isLong}}>();{{/items.isListContainer}} + {{#items.isMapContainer}}auto {{name}}_item = new QMap();{{/items.isMapContainer}} + auto jsonval = QJsonValue::fromVariant(varmap.value(val)); + ::{{cppNamespace}}::setValue((QMap*)&{{name}}_item, jsonval, "{{items.baseType}}", "{{items.items.baseType}}"); + {{name}}->insert({{name}}->end(), val, {{name}}_item); } } - } - - {{/isMapContainer}} + }{{/isMapContainer}}{{/items.isContainer}}{{/isContainer}} {{/vars}} } @@ -104,77 +104,47 @@ QJsonObject* {{classname}}::asJsonObject() { QJsonObject* obj = new QJsonObject(); {{#vars}} - {{#complexType}} - {{^isContainer}} - {{#complexType}} - {{^isString}} - {{^isDateTime}} + {{^isContainer}}{{#complexType}}{{^isString}}{{^isDate}}{{^isDateTime}}{{^isByteArray}} if({{name}}->isSet()){ toJsonValue(QString("{{baseName}}"), {{name}}, obj, QString("{{complexType}}")); - } - {{/isDateTime}} - {{/isString}} - {{#isString}} + }{{/isByteArray}}{{/isDateTime}}{{/isDate}}{{/isString}}{{#isString}} if({{name}} != nullptr && *{{name}} != QString("")){ toJsonValue(QString("{{baseName}}"), {{name}}, obj, QString("{{complexType}}")); - } - {{/isString}} - {{/complexType}} - {{^complexType}} - if({{name}} != nullptr && *{{name}} != nullptr) { - obj->insert("{{name}}", QJsonValue(*{{name}})); - } - {{/complexType}} - {{/isContainer}} - {{#isListContainer}} - if({{name}}->size() > 0){ - QJsonArray {{name}}JsonArray; - toJsonArray((QList*){{name}}, &{{name}}JsonArray, "{{name}}", "{{complexType}}"); - obj->insert("{{baseName}}", {{name}}JsonArray); - } - {{/isListContainer}} - {{#isMapContainer}} - if({{name}}->size() > 0) { - QJsonObject {{name}}_jobj; - for(auto keyval : {{name}}->keys()){ - toJsonValue(keyval, ((*{{name}})[keyval]), &{{name}}_jobj, "{{complexType}}"); - } - obj->insert("{{baseName}}", {{name}}_jobj); - } - {{/isMapContainer}} - {{/complexType}} - {{^complexType}} - {{^isContainer}} - {{^isString}} - {{^isDateTime}} + }{{/isString}}{{/complexType}}{{#isPrimitiveType}}{{^isDateTime}}{{^isDate}}{{^isByteArray}} if(m_{{name}}_isSet){ obj->insert("{{baseName}}", QJsonValue({{name}})); - } - {{/isDateTime}} - {{/isString}} - {{#isString}} - if({{name}} != nullptr && *{{name}} != QString("")) { + }{{/isByteArray}}{{/isDate}}{{/isDateTime}}{{/isPrimitiveType}}{{#isDate}} + if({{name}} != nullptr) { + toJsonValue(QString("{{baseName}}"), {{name}}, obj, QString("{{complexType}}")); + }{{/isDate}}{{#isByteArray}} + if({{name}} != nullptr) { obj->insert("{{name}}", QJsonValue(*{{name}})); - } - {{/isString}} - {{/isContainer}} - {{#isListContainer}} + }{{/isByteArray}}{{#isDateTime}} + if({{name}} != nullptr) { + toJsonValue(QString("{{baseName}}"), {{name}}, obj, QString("{{complexType}}")); + }{{/isDateTime}}{{/isContainer}}{{#isContainer}}{{#isListContainer}} if({{name}}->size() > 0){ - QJsonArray {{name}}JsonArray; - toJsonArray((QList*){{name}}, &{{name}}JsonArray, "{{name}}", "{{items.baseType}}"); - obj->insert("{{baseName}}", {{name}}JsonArray); - } - {{/isListContainer}} - {{#isMapContainer}} + {{^items.isContainer}}toJsonArray((QList*){{name}}, obj, "{{baseName}}", "{{complexType}}");{{/items.isContainer}}{{#items.isContainer}} + QJsonArray jarray; + for(auto items : *{{name}}){ + QJsonObject jobj; + {{#items.isListContainer}}toJsonArray((QList*)items, &jobj, "{{baseName}}", "{{items.items.baseType}}");{{/items.isListContainer}} + {{#items.isMapContainer}}toJsonMap((QMap*)items, &jobj, "{{baseName}}", "{{items.items.baseType}}");{{/items.isMapContainer}} + jarray.append(jobj.value("{{baseName}}")); + } + obj->insert("{{baseName}}", jarray);{{/items.isContainer}} + }{{/isListContainer}}{{#isMapContainer}} if({{name}}->size() > 0){ - QJsonObject {{name}}_jobj; - for(auto keyval : {{name}}->keys()){ - toJsonValue(keyval, ((*{{name}})[keyval]), &{{name}}_jobj, "{{items.baseType}}"); - } - obj->insert("{{baseName}}", {{name}}_jobj); - } - {{/isMapContainer}} - {{/complexType}} + {{^items.isContainer}}toJsonMap((QMap*) {{name}}, obj, "{{baseName}}", "{{complexType}}");{{/items.isContainer}}{{#items.isContainer}} + QJsonObject mapobj; + for(auto itemkey : {{name}}->keys()){ + QJsonObject jobj; + {{#items.isListContainer}}toJsonArray((QList*){{name}}->value(itemkey), &jobj, itemkey, "{{items.items.baseType}}");{{/items.isListContainer}} + {{#items.isMapContainer}}toJsonMap((QMap*){{name}}->value(itemkey), &jobj, itemkey, "{{items.items.baseType}}");{{/items.isMapContainer}} + mapobj.insert(itemkey, jobj); + } + obj->insert("{{baseName}}", mapobj);{{/items.isContainer}} + }{{/isMapContainer}}{{/isContainer}} {{/vars}} return obj; diff --git a/samples/client/petstore/qt5cpp/PetStore/PetStore.pro b/samples/client/petstore/qt5cpp/PetStore/PetStore.pro index f8c5480023d..64f27a3c924 100644 --- a/samples/client/petstore/qt5cpp/PetStore/PetStore.pro +++ b/samples/client/petstore/qt5cpp/PetStore/PetStore.pro @@ -18,31 +18,31 @@ TEMPLATE = app SOURCES += main.cpp \ - ../client/Category.cpp \ + ../client/SWGCategory.cpp \ ../client/SWGHelpers.cpp \ ../client/SWGHttpRequest.cpp \ - ../client/Order.cpp \ - ../client/Pet.cpp \ + ../client/SWGOrder.cpp \ + ../client/SWGPet.cpp \ ../client/SWGPetApi.cpp \ ../client/SWGStoreApi.cpp \ - ../client/Tag.cpp \ - ../client/User.cpp \ + ../client/SWGTag.cpp \ + ../client/SWGUser.cpp \ ../client/SWGUserApi.cpp \ - ../client/ApiResponse.cpp \ + ../client/SWGApiResponse.cpp \ PetApiTests.cpp HEADERS += \ - ../client/Category.h \ + ../client/SWGCategory.h \ ../client/SWGHelpers.h \ ../client/SWGHttpRequest.h \ ../client/SWGObject.h \ - ../client/Order.h \ - ../client/Pet.h \ + ../client/SWGOrder.h \ + ../client/SWGPet.h \ ../client/SWGPetApi.h \ ../client/SWGStoreApi.h \ - ../client/Tag.h \ - ../client/User.h \ + ../client/SWGTag.h \ + ../client/SWGUser.h \ ../client/SWGUserApi.h \ PetApiTests.h \ - ../client/ApiResponse.h \ + ../client/SWGApiResponse.h \ ../client/SWGModelFactory.h diff --git a/samples/client/petstore/qt5cpp/client/SWGApiResponse.cpp b/samples/client/petstore/qt5cpp/client/SWGApiResponse.cpp index 276270ae3cd..84999f3b707 100644 --- a/samples/client/petstore/qt5cpp/client/SWGApiResponse.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGApiResponse.cpp @@ -48,10 +48,10 @@ SWGApiResponse::init() { void SWGApiResponse::cleanup() { - if(type != nullptr) { + if(type != nullptr) { delete type; } - if(message != nullptr) { + if(message != nullptr) { delete message; } } @@ -68,8 +68,11 @@ SWGApiResponse::fromJson(QString &json) { void SWGApiResponse::fromJsonObject(QJsonObject &pJson) { ::Swagger::setValue(&code, pJson["code"], "qint32", ""); + ::Swagger::setValue(&type, pJson["type"], "QString", "QString"); + ::Swagger::setValue(&message, pJson["message"], "QString", "QString"); + } QString @@ -85,12 +88,15 @@ SWGApiResponse::asJson () QJsonObject* SWGApiResponse::asJsonObject() { QJsonObject* obj = new QJsonObject(); + if(m_code_isSet){ obj->insert("code", QJsonValue(code)); } + if(type != nullptr && *type != QString("")){ toJsonValue(QString("type"), type, obj, QString("QString")); } + if(message != nullptr && *message != QString("")){ toJsonValue(QString("message"), message, obj, QString("QString")); } diff --git a/samples/client/petstore/qt5cpp/client/SWGCategory.cpp b/samples/client/petstore/qt5cpp/client/SWGCategory.cpp index b383141403d..b508e66e014 100644 --- a/samples/client/petstore/qt5cpp/client/SWGCategory.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGCategory.cpp @@ -46,7 +46,7 @@ SWGCategory::init() { void SWGCategory::cleanup() { - if(name != nullptr) { + if(name != nullptr) { delete name; } } @@ -63,7 +63,9 @@ SWGCategory::fromJson(QString &json) { void SWGCategory::fromJsonObject(QJsonObject &pJson) { ::Swagger::setValue(&id, pJson["id"], "qint64", ""); + ::Swagger::setValue(&name, pJson["name"], "QString", "QString"); + } QString @@ -79,9 +81,11 @@ SWGCategory::asJson () QJsonObject* SWGCategory::asJsonObject() { QJsonObject* obj = new QJsonObject(); + if(m_id_isSet){ obj->insert("id", QJsonValue(id)); } + if(name != nullptr && *name != QString("")){ toJsonValue(QString("name"), name, obj, QString("QString")); } diff --git a/samples/client/petstore/qt5cpp/client/SWGHelpers.cpp b/samples/client/petstore/qt5cpp/client/SWGHelpers.cpp index ed33368f1f7..cf8aa7eaf40 100644 --- a/samples/client/petstore/qt5cpp/client/SWGHelpers.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGHelpers.cpp @@ -49,17 +49,16 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) { } else if (QStringLiteral("QString").compare(type) == 0) { QString **val = static_cast(value); - if(val != nullptr) { if(!obj.isNull()) { // create a new value and return - delete *val; + if(*val != nullptr) delete *val; *val = new QString(obj.toString()); return; } else { // set target to nullptr - delete *val; + if(*val != nullptr) delete *val; *val = nullptr; } } @@ -73,13 +72,13 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) { if(val != nullptr) { if(!obj.isNull()) { // create a new value and return - delete *val; + if(*val != nullptr) delete *val; *val = new QDateTime(QDateTime::fromString(obj.toString(), Qt::ISODate)); return; } else { // set target to nullptr - delete *val; + if(*val != nullptr) delete *val; *val = nullptr; } } @@ -93,13 +92,13 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) { if(val != nullptr) { if(!obj.isNull()) { // create a new value and return - delete *val; + if(*val != nullptr) delete *val; *val = new QDate(QDate::fromString(obj.toString(), Qt::ISODate)); return; } else { // set target to nullptr - delete *val; + if(*val != nullptr) delete *val; *val = nullptr; } } @@ -113,14 +112,14 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) { if(val != nullptr) { if(!obj.isNull()) { // create a new value and return - delete *val; + if(*val != nullptr) delete *val; *val = new QByteArray(QByteArray::fromBase64(QByteArray::fromStdString(obj.toString().toStdString()))); return; } else { // set target to nullptr - delete *val; + if(*val != nullptr) delete *val; *val = nullptr; } } @@ -131,124 +130,253 @@ setValue(void* value, QJsonValue obj, QString type, QString complexType) { else if(type.startsWith("SWG") && obj.isObject()) { // complex type QJsonObject jsonObj = obj.toObject(); - SWGObject * so = (SWGObject*)::Swagger::create(type); + SWGObject * so = (SWGObject*)::Swagger::create(complexType); if(so != nullptr) { so->fromJsonObject(jsonObj); SWGObject **val = static_cast(value); - delete *val; + if(*val != nullptr) delete *val; *val = so; } } else if(type.startsWith("QList") && QString("").compare(complexType) != 0 && obj.isArray()) { // list of values if(complexType.startsWith("SWG")) { - QList* output = new QList(); + auto output = reinterpret_cast **> (value); + for (auto item : **output) { + if(item != nullptr) delete item; + } + (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr) { // it's an object - SWGObject * val = (SWGObject*)create(complexType); + SWGObject * val = (SWGObject*)::Swagger::create(complexType); QJsonObject t = jval.toObject(); - val->fromJsonObject(t); - output->append(val); - } - QList **val = static_cast**>(value); - for (auto item : **val) { - delete item; + (*output)->append(val); } - delete *val; - *val = output; } else if(QStringLiteral("qint32").compare(complexType) == 0) { - QList **output = reinterpret_cast **> (value); + auto output = reinterpret_cast **> (value); (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr){ qint32 val; - setValue(&val, jval, QStringLiteral("qint32"), QStringLiteral("")); + ::Swagger::setValue(&val, jval, QStringLiteral("qint32"), QStringLiteral("")); (*output)->push_back(val); } } else if(QStringLiteral("qint64").compare(complexType) == 0) { - QList **output = reinterpret_cast **> (value); + auto output = reinterpret_cast **> (value); (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr){ qint64 val; - setValue(&val, jval, QStringLiteral("qint64"), QStringLiteral("")); + ::Swagger::setValue(&val, jval, QStringLiteral("qint64"), QStringLiteral("")); (*output)->push_back(val); } } else if(QStringLiteral("bool").compare(complexType) == 0) { - QList **output = reinterpret_cast **> (value); + auto output = reinterpret_cast **> (value); (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr){ bool val; - setValue(&val, jval, QStringLiteral("bool"), QStringLiteral("")); + ::Swagger::setValue(&val, jval, QStringLiteral("bool"), QStringLiteral("")); (*output)->push_back(val); } } else if(QStringLiteral("float").compare(complexType) == 0) { - QList **output = reinterpret_cast **> (value); + auto output = reinterpret_cast **> (value); (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr){ float val; - setValue(&val, jval, QStringLiteral("float"), QStringLiteral("")); + ::Swagger::setValue(&val, jval, QStringLiteral("float"), QStringLiteral("")); (*output)->push_back(val); } } else if(QStringLiteral("double").compare(complexType) == 0) { - QList **output = reinterpret_cast **> (value); + auto output = reinterpret_cast **> (value); (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr){ double val; - setValue(&val, jval, QStringLiteral("double"), QStringLiteral("")); + ::Swagger::setValue(&val, jval, QStringLiteral("double"), QStringLiteral("")); (*output)->push_back(val); } } else if(QStringLiteral("QString").compare(complexType) == 0) { - QList **output = reinterpret_cast **> (value); + auto output = reinterpret_cast **> (value); for (auto item : **output) { - delete item; + if(item != nullptr) delete item; } (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr){ QString * val = new QString(); - setValue(&val, jval, QStringLiteral("QString"), QStringLiteral("")); + ::Swagger::setValue(&val, jval, QStringLiteral("QString"), QStringLiteral("")); (*output)->push_back(val); } } else if(QStringLiteral("QDate").compare(complexType) == 0) { - QList **output = reinterpret_cast **> (value); + auto output = reinterpret_cast **> (value); for (auto item : **output) { - delete item; + if(item != nullptr) delete item; } (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr){ QDate * val = new QDate(); - setValue(&val, jval, QStringLiteral("QDate"), QStringLiteral("")); + ::Swagger::setValue(&val, jval, QStringLiteral("QDate"), QStringLiteral("")); (*output)->push_back(val); } } else if(QStringLiteral("QDateTime").compare(complexType) == 0) { - QList **output = reinterpret_cast **> (value); + auto output = reinterpret_cast **> (value); for (auto item : **output) { - delete item; + if(item != nullptr) delete item; } (*output)->clear(); QJsonArray arr = obj.toArray(); for (const QJsonValue & jval : arr){ QDateTime * val = new QDateTime(); - setValue(&val, jval, QStringLiteral("QDateTime"), QStringLiteral("")); + ::Swagger::setValue(&val, jval, QStringLiteral("QDateTime"), QStringLiteral("")); (*output)->push_back(val); } } } + else if(type.startsWith("QMap") && QString("").compare(complexType) != 0 && obj.isObject()) { + // list of values + if(complexType.startsWith("SWG")) { + auto output = reinterpret_cast **> (value); + for (auto item : **output) { + if(item != nullptr) delete item; + } + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + auto val = (SWGObject*)::Swagger::create(complexType); + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::Swagger::setValue(&val, jsonval, complexType, complexType); + (*output)->insert(itemkey, val); + } + } + } + else if(QStringLiteral("qint32").compare(complexType) == 0) { + auto output = reinterpret_cast **> (value); + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + qint32 val; + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::Swagger::setValue(&val, jsonval, QStringLiteral("qint32"), QStringLiteral("")); + (*output)->insert( itemkey, val); + } + } + } + else if(QStringLiteral("qint64").compare(complexType) == 0) { + auto output = reinterpret_cast **> (value); + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + qint64 val; + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::Swagger::setValue(&val, jsonval, QStringLiteral("qint64"), QStringLiteral("")); + (*output)->insert( itemkey, val); + } + } + } + else if(QStringLiteral("bool").compare(complexType) == 0) { + auto output = reinterpret_cast **> (value); + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + bool val; + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::Swagger::setValue(&val, jsonval, QStringLiteral("bool"), QStringLiteral("")); + (*output)->insert( itemkey, val); + } + } + } + else if(QStringLiteral("float").compare(complexType) == 0) { + auto output = reinterpret_cast **> (value); + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + float val; + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::Swagger::setValue(&val, jsonval, QStringLiteral("float"), QStringLiteral("")); + (*output)->insert( itemkey, val); + } + } + } + else if(QStringLiteral("double").compare(complexType) == 0) { + auto output = reinterpret_cast **> (value); + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + double val; + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::Swagger::setValue(&val, jsonval, QStringLiteral("double"), QStringLiteral("")); + (*output)->insert( itemkey, val); + } + } + } + else if(QStringLiteral("QString").compare(complexType) == 0) { + auto output = reinterpret_cast **> (value); + for (auto item : **output) { + if(item != nullptr) delete item; + } + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + QString * val = new QString(); + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::Swagger::setValue(&val, jsonval, QStringLiteral("QString"), QStringLiteral("")); + (*output)->insert( itemkey, val); + } + } + } + else if(QStringLiteral("QDate").compare(complexType) == 0) { + auto output = reinterpret_cast **> (value); + for (auto item : **output) { + if(item != nullptr) delete item; + } + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + QDate * val = new QDate(); + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::Swagger::setValue(&val, jsonval, QStringLiteral("QDate"), QStringLiteral("")); + (*output)->insert( itemkey, val); + } + } + } + else if(QStringLiteral("QDateTime").compare(complexType) == 0) { + auto output = reinterpret_cast **> (value); + for (auto item : **output) { + if(item != nullptr) delete item; + } + (*output)->clear(); + auto varmap = obj.toObject().toVariantMap(); + if(varmap.count() > 0){ + for(auto itemkey : varmap.keys() ){ + QDateTime * val = new QDateTime(); + auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey)); + ::Swagger::setValue(&val, jsonval, QStringLiteral("QDateTime"), QStringLiteral("")); + (*output)->insert( itemkey, val); + } + } + } + } } void @@ -262,7 +390,7 @@ toJsonValue(QString name, void* value, QJsonObject* output, QString type) { QJsonObject* o = (*SWGobject).asJsonObject(); if(name != nullptr) { output->insert(name, *o); - delete o; + if(o != nullptr) delete o; } else { output->empty(); @@ -311,54 +439,133 @@ toJsonValue(QString name, void* value, QJsonObject* output, QString type) { } void -toJsonArray(QList* value, QJsonArray* output, QString innerName, QString innerType) { +toJsonArray(QList* value, QJsonObject* output, QString innerName, QString innerType) { + if((value == nullptr) || (output == nullptr)) { + return; + } + QJsonArray outputarray; if(innerType.startsWith("SWG")){ for(void* obj : *value) { SWGObject *SWGobject = reinterpret_cast(obj); if(SWGobject != nullptr) { - output->append(*(SWGobject->asJsonObject())); + outputarray.append(*(SWGobject->asJsonObject())); } } } else if(QStringLiteral("QString").compare(innerType) == 0) { for(QString* obj : *(reinterpret_cast*>(value))){ - output->append(QJsonValue(*obj)); + outputarray.append(QJsonValue(*obj)); } } else if(QStringLiteral("QDate").compare(innerType) == 0) { for(QDate* obj : *(reinterpret_cast*>(value))){ - output->append(QJsonValue(obj->toString(Qt::ISODate))); + outputarray.append(QJsonValue(obj->toString(Qt::ISODate))); } } else if(QStringLiteral("QDateTime").compare(innerType) == 0) { for(QDateTime* obj : *(reinterpret_cast*>(value))){ - output->append(QJsonValue(obj->toString(Qt::ISODate))); } + outputarray.append(QJsonValue(obj->toString(Qt::ISODate))); } } else if(QStringLiteral("QByteArray").compare(innerType) == 0) { for(QByteArray* obj : *(reinterpret_cast*>(value))){ - output->append(QJsonValue(QString(obj->toBase64()))); + outputarray.append(QJsonValue(QString(obj->toBase64()))); } } else if(QStringLiteral("qint32").compare(innerType) == 0) { for(qint32 obj : *(reinterpret_cast*>(value))) - output->append(QJsonValue(obj)); + outputarray.append(QJsonValue(obj)); } else if(QStringLiteral("qint64").compare(innerType) == 0) { for(qint64 obj : *(reinterpret_cast*>(value))) - output->append(QJsonValue(obj)); + outputarray.append(QJsonValue(obj)); } else if(QStringLiteral("bool").compare(innerType) == 0) { for(bool obj : *(reinterpret_cast*>(value))) - output->append(QJsonValue(obj)); + outputarray.append(QJsonValue(obj)); } else if(QStringLiteral("float").compare(innerType) == 0) { for(float obj : *(reinterpret_cast*>(value))) - output->append(QJsonValue(obj)); + outputarray.append(QJsonValue(obj)); } else if(QStringLiteral("double").compare(innerType) == 0) { for(double obj : *(reinterpret_cast*>(value))) - output->append(QJsonValue(obj)); + outputarray.append(QJsonValue(obj)); + } + output->insert(innerName, outputarray); +} + +void +toJsonMap(QMap* value, QJsonObject* output, QString innerName, QString innerType) { + if((value == nullptr) || (output == nullptr)) { + return; + } + QJsonObject mapobj; + if(innerType.startsWith("SWG")){ + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + ::Swagger::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType); + } + } + else if(QStringLiteral("QString").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + ::Swagger::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType); + } + } + else if(QStringLiteral("QDate").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + ::Swagger::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType); + } + } + else if(QStringLiteral("QDateTime").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + ::Swagger::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType); + } + } + else if(QStringLiteral("QByteArray").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + ::Swagger::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType); + } + } + else if(QStringLiteral("qint32").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + auto val = items->value(itemkey); + ::Swagger::toJsonValue(itemkey, &val, &mapobj, innerType); + } + } + else if(QStringLiteral("qint64").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + auto val = items->value(itemkey); + ::Swagger::toJsonValue(itemkey, &val, &mapobj, innerType); + } + } + else if(QStringLiteral("bool").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + auto val = items->value(itemkey); + ::Swagger::toJsonValue(itemkey, &val, &mapobj, innerType); + } + } + else if(QStringLiteral("float").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys()) { + auto val = items->value(itemkey); + ::Swagger::toJsonValue(itemkey, &val, &mapobj, innerType); + } + } + else if(QStringLiteral("double").compare(innerType) == 0) { + auto items = reinterpret_cast< QMap *>(value); + for(auto itemkey: items->keys() ) { + auto val = items->value(itemkey); + ::Swagger::toJsonValue(itemkey, &val, &mapobj, innerType); + } } + output->insert(innerName, mapobj); } QString diff --git a/samples/client/petstore/qt5cpp/client/SWGHelpers.h b/samples/client/petstore/qt5cpp/client/SWGHelpers.h index 13a33c9c338..bf721a6a1b9 100644 --- a/samples/client/petstore/qt5cpp/client/SWGHelpers.h +++ b/samples/client/petstore/qt5cpp/client/SWGHelpers.h @@ -18,8 +18,9 @@ namespace Swagger { void setValue(void* value, QJsonValue obj, QString type, QString complexType); - void toJsonArray(QList* value, QJsonArray* output, QString innerName, QString innerType); + void toJsonArray(QList* value, QJsonObject* output, QString innerName, QString innerType); void toJsonValue(QString name, void* value, QJsonObject* output, QString type); + void toJsonMap(QMap* value, QJsonObject* output, QString innerName, QString innerType); bool isCompatibleJsonValue(QString type); QString stringValue(QString* value); QString stringValue(qint32 value); diff --git a/samples/client/petstore/qt5cpp/client/SWGOrder.cpp b/samples/client/petstore/qt5cpp/client/SWGOrder.cpp index af011bd0e60..42e8891a9bf 100644 --- a/samples/client/petstore/qt5cpp/client/SWGOrder.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGOrder.cpp @@ -56,10 +56,10 @@ SWGOrder::cleanup() { - if(ship_date != nullptr) { + if(ship_date != nullptr) { delete ship_date; } - if(status != nullptr) { + if(status != nullptr) { delete status; } @@ -77,11 +77,17 @@ SWGOrder::fromJson(QString &json) { void SWGOrder::fromJsonObject(QJsonObject &pJson) { ::Swagger::setValue(&id, pJson["id"], "qint64", ""); + ::Swagger::setValue(&pet_id, pJson["petId"], "qint64", ""); + ::Swagger::setValue(&quantity, pJson["quantity"], "qint32", ""); + ::Swagger::setValue(&ship_date, pJson["shipDate"], "QDateTime", "QDateTime"); + ::Swagger::setValue(&status, pJson["status"], "QString", "QString"); + ::Swagger::setValue(&complete, pJson["complete"], "bool", ""); + } QString @@ -97,18 +103,27 @@ SWGOrder::asJson () QJsonObject* SWGOrder::asJsonObject() { QJsonObject* obj = new QJsonObject(); + if(m_id_isSet){ obj->insert("id", QJsonValue(id)); } + if(m_pet_id_isSet){ obj->insert("petId", QJsonValue(pet_id)); } + if(m_quantity_isSet){ obj->insert("quantity", QJsonValue(quantity)); } + + if(ship_date != nullptr) { + toJsonValue(QString("shipDate"), ship_date, obj, QString("QDateTime")); + } + if(status != nullptr && *status != QString("")){ toJsonValue(QString("status"), status, obj, QString("QString")); } + if(m_complete_isSet){ obj->insert("complete", QJsonValue(complete)); } diff --git a/samples/client/petstore/qt5cpp/client/SWGPet.cpp b/samples/client/petstore/qt5cpp/client/SWGPet.cpp index c4c7a72fda3..a57cfdbc8d3 100644 --- a/samples/client/petstore/qt5cpp/client/SWGPet.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGPet.cpp @@ -54,27 +54,27 @@ SWGPet::init() { void SWGPet::cleanup() { - if(category != nullptr) { + if(category != nullptr) { delete category; } - if(name != nullptr) { + if(name != nullptr) { delete name; } - if(photo_urls != nullptr) { - QList* arr = photo_urls; - foreach(QString* o, *arr) { + if(photo_urls != nullptr) { + auto arr = photo_urls; + for(auto o: *arr) { delete o; } delete photo_urls; } - if(tags != nullptr) { - QList* arr = tags; - foreach(SWGTag* o, *arr) { + if(tags != nullptr) { + auto arr = tags; + for(auto o: *arr) { delete o; } delete tags; } - if(status != nullptr) { + if(status != nullptr) { delete status; } } @@ -91,11 +91,17 @@ SWGPet::fromJson(QString &json) { void SWGPet::fromJsonObject(QJsonObject &pJson) { ::Swagger::setValue(&id, pJson["id"], "qint64", ""); + ::Swagger::setValue(&category, pJson["category"], "SWGCategory", "SWGCategory"); + ::Swagger::setValue(&name, pJson["name"], "QString", "QString"); + + ::Swagger::setValue(&photo_urls, pJson["photoUrls"], "QList", "QString"); + ::Swagger::setValue(&tags, pJson["tags"], "QList", "SWGTag"); ::Swagger::setValue(&status, pJson["status"], "QString", "QString"); + } QString @@ -111,25 +117,27 @@ SWGPet::asJson () QJsonObject* SWGPet::asJsonObject() { QJsonObject* obj = new QJsonObject(); + if(m_id_isSet){ obj->insert("id", QJsonValue(id)); } + if(category->isSet()){ toJsonValue(QString("category"), category, obj, QString("SWGCategory")); } + if(name != nullptr && *name != QString("")){ toJsonValue(QString("name"), name, obj, QString("QString")); } + if(photo_urls->size() > 0){ - QJsonArray photo_urlsJsonArray; - toJsonArray((QList*)photo_urls, &photo_urlsJsonArray, "photo_urls", "QString"); - obj->insert("photoUrls", photo_urlsJsonArray); + toJsonArray((QList*)photo_urls, obj, "photoUrls", "QString"); } + if(tags->size() > 0){ - QJsonArray tagsJsonArray; - toJsonArray((QList*)tags, &tagsJsonArray, "tags", "SWGTag"); - obj->insert("tags", tagsJsonArray); + toJsonArray((QList*)tags, obj, "tags", "SWGTag"); } + if(status != nullptr && *status != QString("")){ toJsonValue(QString("status"), status, obj, QString("QString")); } diff --git a/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp b/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp index dc2afc37919..ece4311aa08 100644 --- a/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp @@ -29,7 +29,7 @@ SWGPetApi::SWGPetApi(QString host, QString basePath) { } void -SWGPetApi::addPet(SWGPet body) { +SWGPetApi::addPet(SWGPet& body) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/pet"); @@ -401,7 +401,7 @@ SWGPetApi::getPetByIdCallback(SWGHttpRequestWorker * worker) { } void -SWGPetApi::updatePet(SWGPet body) { +SWGPetApi::updatePet(SWGPet& body) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/pet"); diff --git a/samples/client/petstore/qt5cpp/client/SWGPetApi.h b/samples/client/petstore/qt5cpp/client/SWGPetApi.h index 33c7ce0aff2..ad40b90a879 100644 --- a/samples/client/petstore/qt5cpp/client/SWGPetApi.h +++ b/samples/client/petstore/qt5cpp/client/SWGPetApi.h @@ -36,12 +36,12 @@ class SWGPetApi: public QObject { QString basePath; QMap defaultHeaders; - void addPet(SWGPet body); + void addPet(SWGPet& body); void deletePet(qint64 pet_id, QString* api_key); void findPetsByStatus(QList* status); void findPetsByTags(QList* tags); void getPetById(qint64 pet_id); - void updatePet(SWGPet body); + void updatePet(SWGPet& body); void updatePetWithForm(qint64 pet_id, QString* name, QString* status); void uploadFile(qint64 pet_id, QString* additional_metadata, SWGHttpRequestInputFileElement* file); diff --git a/samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp b/samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp index 94b9f2292c3..15b13dc26a4 100644 --- a/samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp @@ -198,7 +198,7 @@ SWGStoreApi::getOrderByIdCallback(SWGHttpRequestWorker * worker) { } void -SWGStoreApi::placeOrder(SWGOrder body) { +SWGStoreApi::placeOrder(SWGOrder& body) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/store/order"); diff --git a/samples/client/petstore/qt5cpp/client/SWGStoreApi.h b/samples/client/petstore/qt5cpp/client/SWGStoreApi.h index 8984eb6ceae..c6d9acc5a26 100644 --- a/samples/client/petstore/qt5cpp/client/SWGStoreApi.h +++ b/samples/client/petstore/qt5cpp/client/SWGStoreApi.h @@ -38,7 +38,7 @@ class SWGStoreApi: public QObject { void deleteOrder(QString* order_id); void getInventory(); void getOrderById(qint64 order_id); - void placeOrder(SWGOrder body); + void placeOrder(SWGOrder& body); private: void deleteOrderCallback (SWGHttpRequestWorker * worker); diff --git a/samples/client/petstore/qt5cpp/client/SWGTag.cpp b/samples/client/petstore/qt5cpp/client/SWGTag.cpp index 2d11260cd60..36cf43fd345 100644 --- a/samples/client/petstore/qt5cpp/client/SWGTag.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGTag.cpp @@ -46,7 +46,7 @@ SWGTag::init() { void SWGTag::cleanup() { - if(name != nullptr) { + if(name != nullptr) { delete name; } } @@ -63,7 +63,9 @@ SWGTag::fromJson(QString &json) { void SWGTag::fromJsonObject(QJsonObject &pJson) { ::Swagger::setValue(&id, pJson["id"], "qint64", ""); + ::Swagger::setValue(&name, pJson["name"], "QString", "QString"); + } QString @@ -79,9 +81,11 @@ SWGTag::asJson () QJsonObject* SWGTag::asJsonObject() { QJsonObject* obj = new QJsonObject(); + if(m_id_isSet){ obj->insert("id", QJsonValue(id)); } + if(name != nullptr && *name != QString("")){ toJsonValue(QString("name"), name, obj, QString("QString")); } diff --git a/samples/client/petstore/qt5cpp/client/SWGUser.cpp b/samples/client/petstore/qt5cpp/client/SWGUser.cpp index 4031a959b68..e3781b93172 100644 --- a/samples/client/petstore/qt5cpp/client/SWGUser.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGUser.cpp @@ -58,22 +58,22 @@ SWGUser::init() { void SWGUser::cleanup() { - if(username != nullptr) { + if(username != nullptr) { delete username; } - if(first_name != nullptr) { + if(first_name != nullptr) { delete first_name; } - if(last_name != nullptr) { + if(last_name != nullptr) { delete last_name; } - if(email != nullptr) { + if(email != nullptr) { delete email; } - if(password != nullptr) { + if(password != nullptr) { delete password; } - if(phone != nullptr) { + if(phone != nullptr) { delete phone; } @@ -91,13 +91,21 @@ SWGUser::fromJson(QString &json) { void SWGUser::fromJsonObject(QJsonObject &pJson) { ::Swagger::setValue(&id, pJson["id"], "qint64", ""); + ::Swagger::setValue(&username, pJson["username"], "QString", "QString"); + ::Swagger::setValue(&first_name, pJson["firstName"], "QString", "QString"); + ::Swagger::setValue(&last_name, pJson["lastName"], "QString", "QString"); + ::Swagger::setValue(&email, pJson["email"], "QString", "QString"); + ::Swagger::setValue(&password, pJson["password"], "QString", "QString"); + ::Swagger::setValue(&phone, pJson["phone"], "QString", "QString"); + ::Swagger::setValue(&user_status, pJson["userStatus"], "qint32", ""); + } QString @@ -113,27 +121,35 @@ SWGUser::asJson () QJsonObject* SWGUser::asJsonObject() { QJsonObject* obj = new QJsonObject(); + if(m_id_isSet){ obj->insert("id", QJsonValue(id)); } + if(username != nullptr && *username != QString("")){ toJsonValue(QString("username"), username, obj, QString("QString")); } + if(first_name != nullptr && *first_name != QString("")){ toJsonValue(QString("firstName"), first_name, obj, QString("QString")); } + if(last_name != nullptr && *last_name != QString("")){ toJsonValue(QString("lastName"), last_name, obj, QString("QString")); } + if(email != nullptr && *email != QString("")){ toJsonValue(QString("email"), email, obj, QString("QString")); } + if(password != nullptr && *password != QString("")){ toJsonValue(QString("password"), password, obj, QString("QString")); } + if(phone != nullptr && *phone != QString("")){ toJsonValue(QString("phone"), phone, obj, QString("QString")); } + if(m_user_status_isSet){ obj->insert("userStatus", QJsonValue(user_status)); } diff --git a/samples/client/petstore/qt5cpp/client/SWGUserApi.cpp b/samples/client/petstore/qt5cpp/client/SWGUserApi.cpp index bface16c256..a990b898dbb 100644 --- a/samples/client/petstore/qt5cpp/client/SWGUserApi.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGUserApi.cpp @@ -29,7 +29,7 @@ SWGUserApi::SWGUserApi(QString host, QString basePath) { } void -SWGUserApi::createUser(SWGUser body) { +SWGUserApi::createUser(SWGUser& body) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/user"); @@ -81,7 +81,7 @@ SWGUserApi::createUserCallback(SWGHttpRequestWorker * worker) { } void -SWGUserApi::createUsersWithArrayInput(QList* body) { +SWGUserApi::createUsersWithArrayInput(QList*& body) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/user/createWithArray"); @@ -91,10 +91,10 @@ SWGUserApi::createUsersWithArrayInput(QList* body) { SWGHttpRequestInput input(fullPath, "POST"); - QJsonArray* bodyArray = new QJsonArray(); - toJsonArray((QList*)body, bodyArray, QString("body"), QString("SWGUser*")); + auto body_jobj = new QJsonObject(); + toJsonArray((QList*)body, body_jobj, QString("body"), QString("SWGUser*")); - QJsonDocument doc(*bodyArray); + QJsonDocument doc(*body_jobj); QByteArray bytes = doc.toJson(); input.request_body.append(bytes); @@ -137,7 +137,7 @@ SWGUserApi::createUsersWithArrayInputCallback(SWGHttpRequestWorker * worker) { } void -SWGUserApi::createUsersWithListInput(QList* body) { +SWGUserApi::createUsersWithListInput(QList*& body) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/user/createWithList"); @@ -147,10 +147,10 @@ SWGUserApi::createUsersWithListInput(QList* body) { SWGHttpRequestInput input(fullPath, "POST"); - QJsonArray* bodyArray = new QJsonArray(); - toJsonArray((QList*)body, bodyArray, QString("body"), QString("SWGUser*")); + auto body_jobj = new QJsonObject(); + toJsonArray((QList*)body, body_jobj, QString("body"), QString("SWGUser*")); - QJsonDocument doc(*bodyArray); + QJsonDocument doc(*body_jobj); QByteArray bytes = doc.toJson(); input.request_body.append(bytes); @@ -419,7 +419,7 @@ SWGUserApi::logoutUserCallback(SWGHttpRequestWorker * worker) { } void -SWGUserApi::updateUser(QString* username, SWGUser body) { +SWGUserApi::updateUser(QString* username, SWGUser& body) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/user/{username}"); diff --git a/samples/client/petstore/qt5cpp/client/SWGUserApi.h b/samples/client/petstore/qt5cpp/client/SWGUserApi.h index c24d062361b..a667e85dee7 100644 --- a/samples/client/petstore/qt5cpp/client/SWGUserApi.h +++ b/samples/client/petstore/qt5cpp/client/SWGUserApi.h @@ -35,14 +35,14 @@ class SWGUserApi: public QObject { QString basePath; QMap defaultHeaders; - void createUser(SWGUser body); - void createUsersWithArrayInput(QList* body); - void createUsersWithListInput(QList* body); + void createUser(SWGUser& body); + void createUsersWithArrayInput(QList*& body); + void createUsersWithListInput(QList*& body); void deleteUser(QString* username); void getUserByName(QString* username); void loginUser(QString* username, QString* password); void logoutUser(); - void updateUser(QString* username, SWGUser body); + void updateUser(QString* username, SWGUser& body); private: void createUserCallback (SWGHttpRequestWorker * worker); From 3029b7b0fba9949c2ec3480253b5a14e724f0456 Mon Sep 17 00:00:00 2001 From: Euan Kemp Date: Sun, 14 Jan 2018 02:03:12 -0800 Subject: [PATCH 43/65] [Rust] Format example with rustfmt (#7339) This was handled via 'cargo fmt' on the current nightly rust. I also moved a few lines around and deleted an old comment. --- .../client/petstore/rust/examples/client.rs | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/samples/client/petstore/rust/examples/client.rs b/samples/client/petstore/rust/examples/client.rs index 0b0e73c2c3d..6afa7a900b0 100644 --- a/samples/client/petstore/rust/examples/client.rs +++ b/samples/client/petstore/rust/examples/client.rs @@ -1,35 +1,39 @@ -extern crate petstore_client; +extern crate futures; extern crate hyper; +extern crate petstore_client; extern crate tokio_core; -extern crate futures; use hyper::Client; use hyper::client::HttpConnector; use tokio_core::reactor::Core; -use futures::{Future}; +use futures::Future; fn main() { let mut core = Core::new().expect("failed to init core"); let handle = core.handle(); - let new_pet = petstore_client::models::Pet::new("barker".to_owned(), vec![]).with_id(1337); - let apicli = petstore_client::apis::client::APIClient::new( petstore_client::apis::configuration::Configuration::new( - Client::configure().connector(HttpConnector::new(4, &handle)).build(&handle))); + Client::configure() + .connector(HttpConnector::new(4, &handle)) + .build(&handle), + ), + ); - let work = apicli.pet_api().add_pet(new_pet) - // petstore_client::apis::add_pet(api, &client, &new_pet) - .and_then(|_| { - apicli.pet_api().update_pet_with_form(1337, "barko", "escaped") - }) - .and_then(|_| { - apicli.pet_api().get_pet_by_id(1337) - }) - .and_then(|pet| { - println!("pet: {:?}", pet); - futures::future::ok(()) - }); + let new_pet = petstore_client::models::Pet::new("barker".to_owned(), vec![]).with_id(1337); + let work = apicli + .pet_api() + .add_pet(new_pet) + .and_then(|_| { + apicli + .pet_api() + .update_pet_with_form(1337, "barko", "escaped") + }) + .and_then(|_| apicli.pet_api().get_pet_by_id(1337)) + .and_then(|pet| { + println!("pet: {:?}", pet); + futures::future::ok(()) + }); core.run(work).expect("failed to run core"); } From d5c355a5967f6bbf0d1b719d3c00c2a09ba8f37b Mon Sep 17 00:00:00 2001 From: magnolia Date: Sun, 14 Jan 2018 19:11:37 +0900 Subject: [PATCH 44/65] [Scalatra] Updated the version of Scalatra to the latest (2.6.2) (#7393) * Updated the version of Scalatra to the latest (2.6.2) - Updated Scalatra 2.6.2 (latest) - Updated Scala 2.12.4 - Updated sbt 1.1.0 - Reduced dependent artifacts to a minimum - Cleaned up build.sbt - Changed the package name from client to server - Set log output (logback) - Updated web.xml for servlet 3.1 * rename package 'com.wordnik' -> 'io.swagger' * Added rolling file appender to logback.xml --- .../languages/ScalatraServerCodegen.java | 7 +- .../resources/scalatra/Bootstrap.mustache | 6 +- .../resources/scalatra/JettyMain.mustache | 1 - .../main/resources/scalatra/README.mustache | 4 +- .../resources/scalatra/ServletApp.mustache | 24 +- .../src/main/resources/scalatra/api.mustache | 13 +- .../src/main/resources/scalatra/build.sbt | 67 +--- .../src/main/resources/scalatra/logback.xml | 29 ++ .../main/resources/scalatra/model.mustache | 9 +- .../scalatra/project/build.properties | 2 +- .../resources/scalatra/project/plugins.sbt | 12 +- .../src/main/resources/scalatra/sbt | 369 ++++++++++-------- .../src/main/resources/scalatra/web.xml | 21 +- .../scalatra/.swagger-codegen/VERSION | 2 +- samples/server/petstore/scalatra/README.md | 4 +- samples/server/petstore/scalatra/build.sbt | 67 +--- .../scalatra/project/build.properties | 2 +- .../petstore/scalatra/project/plugins.sbt | 12 +- samples/server/petstore/scalatra/sbt | 369 ++++++++++-------- .../scalatra/src/main/resources/logback.xml | 13 + .../scalatra/src/main/scala/JettyMain.scala | 1 - .../src/main/scala/ScalatraBootstrap.scala | 8 +- .../scalatra/src/main/scala/ServletApp.scala | 28 +- .../swagger/server}/api/PetApi.scala | 19 +- .../swagger/server}/api/StoreApi.scala | 17 +- .../swagger/server}/api/UserApi.scala | 17 +- .../swagger/server}/model/ApiResponse.scala | 12 +- .../swagger/server}/model/Category.scala | 10 +- .../swagger/server}/model/Order.scala | 16 +- .../swagger/server}/model/Pet.scala | 16 +- .../swagger/server}/model/Tag.scala | 10 +- .../swagger/server}/model/User.scala | 20 +- .../scalatra/src/main/webapp/WEB-INF/web.xml | 21 +- 33 files changed, 610 insertions(+), 618 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/scalatra/logback.xml mode change 100644 => 100755 samples/server/petstore/scalatra/sbt create mode 100644 samples/server/petstore/scalatra/src/main/resources/logback.xml rename samples/server/petstore/scalatra/src/main/scala/{com/wordnik/client => io/swagger/server}/api/PetApi.scala (90%) rename samples/server/petstore/scalatra/src/main/scala/{com/wordnik/client => io/swagger/server}/api/StoreApi.scala (83%) rename samples/server/petstore/scalatra/src/main/scala/{com/wordnik/client => io/swagger/server}/api/UserApi.scala (89%) rename samples/server/petstore/scalatra/src/main/scala/{com/wordnik/client => io/swagger/server}/model/ApiResponse.scala (82%) rename samples/server/petstore/scalatra/src/main/scala/{com/wordnik/client => io/swagger/server}/model/Category.scala (87%) rename samples/server/petstore/scalatra/src/main/scala/{com/wordnik/client => io/swagger/server}/model/Order.scala (79%) rename samples/server/petstore/scalatra/src/main/scala/{com/wordnik/client => io/swagger/server}/model/Pet.scala (79%) rename samples/server/petstore/scalatra/src/main/scala/{com/wordnik/client => io/swagger/server}/model/Tag.scala (87%) rename samples/server/petstore/scalatra/src/main/scala/{com/wordnik/client => io/swagger/server}/model/User.scala (72%) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalatraServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalatraServerCodegen.java index 5bc218262c2..8db4cc62fc5 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalatraServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalatraServerCodegen.java @@ -16,7 +16,7 @@ public class ScalatraServerCodegen extends AbstractScalaCodegen implements CodegenConfig { protected String groupId = "io.swagger"; - protected String artifactId = "swagger-client"; + protected String artifactId = "swagger-server"; protected String artifactVersion = "1.0.0"; public ScalatraServerCodegen() { @@ -25,8 +25,8 @@ public ScalatraServerCodegen() { modelTemplateFiles.put("model.mustache", ".scala"); apiTemplateFiles.put("api.mustache", ".scala"); embeddedTemplateDir = templateDir = "scalatra"; - apiPackage = "com.wordnik.client.api"; - modelPackage = "com.wordnik.client.model"; + apiPackage = "io.swagger.server.api"; + modelPackage = "io.swagger.server.model"; setReservedWordsLowerCase( Arrays.asList( @@ -79,6 +79,7 @@ public ScalatraServerCodegen() { supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("build.sbt", "", "build.sbt")); supportingFiles.add(new SupportingFile("web.xml", "/src/main/webapp/WEB-INF", "web.xml")); + supportingFiles.add(new SupportingFile("logback.xml", "/src/main/resources", "logback.xml")); supportingFiles.add(new SupportingFile("JettyMain.mustache", sourceFolder, "JettyMain.scala")); supportingFiles.add(new SupportingFile("Bootstrap.mustache", sourceFolder, "ScalatraBootstrap.scala")); supportingFiles.add(new SupportingFile("ServletApp.mustache", sourceFolder, "ServletApp.scala")); diff --git a/modules/swagger-codegen/src/main/resources/scalatra/Bootstrap.mustache b/modules/swagger-codegen/src/main/resources/scalatra/Bootstrap.mustache index 483ee4e5444..a2af5ad5b55 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/Bootstrap.mustache +++ b/modules/swagger-codegen/src/main/resources/scalatra/Bootstrap.mustache @@ -1,8 +1,7 @@ {{>licenseInfo}} import {{apiPackage}}._ -import akka.actor.ActorSystem -import io.swagger.app.{ResourcesApp, SwaggerApp} +import io.swagger.app.{ ResourcesApp, SwaggerApp } import javax.servlet.ServletContext import org.scalatra.LifeCycle @@ -10,7 +9,6 @@ class ScalatraBootstrap extends LifeCycle { implicit val swagger = new SwaggerApp override def init(context: ServletContext) { - implicit val system = ActorSystem("appActorSystem") try { {{#apiInfo}}{{#apis}}context mount (new {{classname}}, "{{basePathWithoutHost}}/{{baseName}}/*") {{/apis}}{{/apiInfo}} @@ -19,4 +17,4 @@ class ScalatraBootstrap extends LifeCycle { case e: Throwable => e.printStackTrace() } } -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/main/resources/scalatra/JettyMain.mustache b/modules/swagger-codegen/src/main/resources/scalatra/JettyMain.mustache index 1eedae148b3..48e0784162c 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/JettyMain.mustache +++ b/modules/swagger-codegen/src/main/resources/scalatra/JettyMain.mustache @@ -1,5 +1,4 @@ {{>licenseInfo}} - import org.eclipse.jetty.server._ import org.eclipse.jetty.webapp.WebAppContext import org.scalatra.servlet.ScalatraListener diff --git a/modules/swagger-codegen/src/main/resources/scalatra/README.mustache b/modules/swagger-codegen/src/main/resources/scalatra/README.mustache index 327870827fd..a6ac34b03e0 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/README.mustache +++ b/modules/swagger-codegen/src/main/resources/scalatra/README.mustache @@ -5,6 +5,4 @@ This server was generated by the [swagger-codegen](https://github.com/swagger-ap [OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This is an example of building a swagger-enabled scalatra server. -This example uses the [scalatra](http://scalatra.org/) framework. To see how to make this your own, look here: - -[README](https://github.com/swagger-api/swagger-codegen/tree/master/samples/server-generator/scalatra) \ No newline at end of file +This example uses the [scalatra](http://scalatra.org/) framework. diff --git a/modules/swagger-codegen/src/main/resources/scalatra/ServletApp.mustache b/modules/swagger-codegen/src/main/resources/scalatra/ServletApp.mustache index faeeb5fcb7a..93d0cfd1380 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/ServletApp.mustache +++ b/modules/swagger-codegen/src/main/resources/scalatra/ServletApp.mustache @@ -2,33 +2,19 @@ package io.swagger.app -import _root_.akka.actor.ActorSystem - import org.scalatra.swagger.{ ApiInfo, SwaggerWithAuth, Swagger } -import org.scalatra.swagger.{JacksonSwaggerBase, Swagger} +import org.scalatra.swagger.{ JacksonSwaggerBase, Swagger } import org.scalatra.ScalatraServlet -import org.json4s.{DefaultFormats, Formats} +import org.json4s.{ DefaultFormats, Formats } -class ResourcesApp(implicit protected val system: ActorSystem, val swagger: SwaggerApp) +class ResourcesApp(implicit protected val swagger: SwaggerApp) extends ScalatraServlet with JacksonSwaggerBase { before() { response.headers += ("Access-Control-Allow-Origin" -> "*") } - - protected def buildFullUrl(path: String) = if (path.startsWith("http")) path else { - val port = request.getServerPort - val h = request.getServerName - val prot = if (port == 443) "https" else "http" - val (proto, host) = if (port != 80 && port != 443) ("http", h+":"+port.toString) else (prot, h) - "%s://%s%s%s".format( - proto, - host, - request.getContextPath, - path) - } } -class SwaggerApp extends Swagger(apiInfo = ApiSwagger.apiInfo, apiVersion = "1.0", swaggerVersion = "1.2") +class SwaggerApp extends Swagger(apiInfo = ApiSwagger.apiInfo, apiVersion = "1.0", swaggerVersion = Swagger.SpecVersion) object ApiSwagger { val apiInfo = ApiInfo( @@ -38,4 +24,4 @@ object ApiSwagger { """{{{infoEmail}}}""", """{{{licenseInfo}}}""", """{{{licenseUrl}}}""") -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/main/resources/scalatra/api.mustache b/modules/swagger-codegen/src/main/resources/scalatra/api.mustache index 7e0641396c7..0d4e9980c75 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/api.mustache +++ b/modules/swagger-codegen/src/main/resources/scalatra/api.mustache @@ -7,23 +7,22 @@ package {{package}} import java.io.File -import org.scalatra.{ TypedParamSupport, ScalatraServlet } +import org.scalatra.ScalatraServlet import org.scalatra.swagger._ import org.json4s._ import org.json4s.JsonDSL._ import org.scalatra.json.{ JValueResult, JacksonJsonSupport } -import org.scalatra.servlet.{FileUploadSupport, MultipartConfig, SizeConstraintExceededException} +import org.scalatra.servlet.{ FileUploadSupport, MultipartConfig, SizeConstraintExceededException } import scala.collection.JavaConverters._ -class {{classname}} (implicit val swagger: Swagger) extends ScalatraServlet - with FileUploadSupport - with JacksonJsonSupport - with SwaggerSupport { +class {{classname}}(implicit val swagger: Swagger) extends ScalatraServlet + with FileUploadSupport + with JacksonJsonSupport + with SwaggerSupport { protected implicit val jsonFormats: Formats = DefaultFormats protected val applicationDescription: String = "{{classname}}" - override protected val applicationName: Option[String] = Some("{{basePathWithoutHost}}/{{baseName}}") before() { contentType = formats("json") diff --git a/modules/swagger-codegen/src/main/resources/scalatra/build.sbt b/modules/swagger-codegen/src/main/resources/scalatra/build.sbt index 00575312d85..aecfef97d5b 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/build.sbt +++ b/modules/swagger-codegen/src/main/resources/scalatra/build.sbt @@ -1,64 +1,21 @@ -import AssemblyKeys._ // put this at the top of the file - -import NativePackagerKeys._ - -packageArchetype.java_server - -assemblySettings - -scalariformSettings - organization := "io.swagger" - -seq(webSettings :_*) - -mainClass in assembly := Some("JettyMain") - name := "scalatra-sample" - version := "0.1.0-SNAPSHOT" +scalaVersion := "2.12.4" -scalaVersion := "2.11.2" +mainClass in assembly := Some("JettyMain") -scalacOptions += "-language:postfixOps" +val ScalatraVersion = "2.6.2" libraryDependencies ++= Seq( - "org.scalatest" %% "scalatest" % "2.2.1" % "test", - "org.scalatra" %% "scalatra" % "2.3.0.RC3", - "org.scalatra" %% "scalatra-scalate" % "2.3.0.RC3", - "org.scalatra" %% "scalatra-json" % "2.3.0.RC3", - "org.scalatra" %% "scalatra-swagger" % "2.3.0.RC3", - "org.scalatra" %% "scalatra-swagger-ext" % "2.3.0.RC3", - "org.scalatra" %% "scalatra-slf4j" % "2.3.0.RC3", - "org.json4s" %% "json4s-jackson" % "3.2.10", - "org.json4s" %% "json4s-ext" % "3.2.10", - "commons-codec" % "commons-codec" % "1.7", - "net.databinder.dispatch" %% "dispatch-core" % "0.11.2", - //"net.databinder.dispatch" %% "json4s-jackson" % "0.11.2", - "net.databinder.dispatch" %% "dispatch-json4s-jackson" % "0.11.2", - "com.typesafe.akka" %% "akka-actor" % "2.3.6", - "org.eclipse.jetty" % "jetty-server" % "9.2.3.v20140905" % "container;compile;test", - "org.eclipse.jetty" % "jetty-webapp" % "9.2.3.v20140905" % "container;compile;test", - "org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "container;compile;provided;test" artifacts (Artifact("javax.servlet", "jar", "jar")) + "org.scalatra" %% "scalatra" % ScalatraVersion, + "org.scalatra" %% "scalatra-swagger" % ScalatraVersion, + "org.scalatra" %% "scalatra-scalatest" % ScalatraVersion % Test, + "org.json4s" %% "json4s-jackson" % "3.5.0", + "org.eclipse.jetty" % "jetty-server" % "9.4.8.v20171121", + "org.eclipse.jetty" % "jetty-webapp" % "9.4.8.v20171121", + "javax.servlet" % "javax.servlet-api" % "3.1.0", + "ch.qos.logback" % "logback-classic" % "1.2.3" % Provided ) -resolvers += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository" - -resolvers += "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/" - -resolvers += "Sonatype OSS Releases" at "http://oss.sonatype.org/content/repositories/releases/" - -ivyXML := - - - - - -mergeStrategy in assembly <<= (mergeStrategy in assembly) { - (old) => { - case "about.html" => MergeStrategy.discard - case x => old(x) - } -} - -net.virtualvoid.sbt.graph.Plugin.graphSettings +enablePlugins(JettyPlugin) \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/scalatra/logback.xml b/modules/swagger-codegen/src/main/resources/scalatra/logback.xml new file mode 100644 index 00000000000..9f46cb2c657 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/scalatra/logback.xml @@ -0,0 +1,29 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + logFile.log + + + logFile.%d{yyyy-MM-dd}.log + + + 30 + + + + %-4relative [%thread] %-5level %logger{35} - %msg%n + + + + + + + + diff --git a/modules/swagger-codegen/src/main/resources/scalatra/model.mustache b/modules/swagger-codegen/src/main/resources/scalatra/model.mustache index cf14e9a7362..5b5ddf22563 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/model.mustache +++ b/modules/swagger-codegen/src/main/resources/scalatra/model.mustache @@ -1,19 +1,16 @@ {{>licenseInfo}} - package {{package}} - {{#imports}}import {{import}} {{/imports}} {{#models}} {{#model}} -case class {{classname}} ( +case class {{classname}}( {{#vars}} {{#description}} - /* {{{description}}} */ +/* {{{description}}} */ {{/description}} {{name}}: {{^required}}Option[{{/required}}{{datatype}}{{^required}}]{{/required}}{{#hasMore}},{{/hasMore}} - {{/vars}} -) + {{/vars}}) {{/model}} {{/models}} diff --git a/modules/swagger-codegen/src/main/resources/scalatra/project/build.properties b/modules/swagger-codegen/src/main/resources/scalatra/project/build.properties index be6c454fbac..8b697bbb94f 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/project/build.properties +++ b/modules/swagger-codegen/src/main/resources/scalatra/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.5 +sbt.version=1.1.0 diff --git a/modules/swagger-codegen/src/main/resources/scalatra/project/plugins.sbt b/modules/swagger-codegen/src/main/resources/scalatra/project/plugins.sbt index 7358abbbbc6..3c8855a0990 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/project/plugins.sbt +++ b/modules/swagger-codegen/src/main/resources/scalatra/project/plugins.sbt @@ -1,9 +1,3 @@ -addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.10.1") - -addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.7.5") - -addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "0.9.0") - -addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.3.0") - -addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.7.4") +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6") +addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "4.0.1") +addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.8.2") diff --git a/modules/swagger-codegen/src/main/resources/scalatra/sbt b/modules/swagger-codegen/src/main/resources/scalatra/sbt index 08e58821219..218f371c03b 100755 --- a/modules/swagger-codegen/src/main/resources/scalatra/sbt +++ b/modules/swagger-codegen/src/main/resources/scalatra/sbt @@ -1,25 +1,100 @@ #!/usr/bin/env bash # # A more capable sbt runner, coincidentally also called sbt. -# Author: Paul Phillips +# Author: Paul Phillips + +set -o pipefail + +declare -r sbt_release_version="0.13.16" +declare -r sbt_unreleased_version="0.13.16" + +declare -r latest_213="2.13.0-M2" +declare -r latest_212="2.12.4" +declare -r latest_211="2.11.12" +declare -r latest_210="2.10.7" +declare -r latest_29="2.9.3" +declare -r latest_28="2.8.2" -# todo - make this dynamic -declare -r sbt_release_version="0.13.6" -declare -r sbt_unreleased_version="0.13.6" declare -r buildProps="project/build.properties" -declare sbt_jar sbt_dir sbt_create sbt_version -declare scala_version sbt_explicit_version -declare verbose noshare batch trace_level log_level -declare sbt_saved_stty debugUs +declare -r sbt_launch_ivy_release_repo="http://repo.typesafe.com/typesafe/ivy-releases" +declare -r sbt_launch_ivy_snapshot_repo="https://repo.scala-sbt.org/scalasbt/ivy-snapshots" +declare -r sbt_launch_mvn_release_repo="http://repo.scala-sbt.org/scalasbt/maven-releases" +declare -r sbt_launch_mvn_snapshot_repo="http://repo.scala-sbt.org/scalasbt/maven-snapshots" + +declare -r default_jvm_opts_common="-Xms512m -Xmx1536m -Xss2m" +declare -r noshare_opts="-Dsbt.global.base=project/.sbtboot -Dsbt.boot.directory=project/.boot -Dsbt.ivy.home=project/.ivy" + +declare sbt_jar sbt_dir sbt_create sbt_version sbt_script sbt_new +declare sbt_explicit_version +declare verbose noshare batch trace_level +declare debugUs + +declare java_cmd="java" +declare sbt_launch_dir="$HOME/.sbt/launchers" +declare sbt_launch_repo + +# pull -J and -D options to give to java. +declare -a java_args scalac_args sbt_commands residual_args + +# args to jvm/sbt via files or environment variables +declare -a extra_jvm_opts extra_sbt_opts echoerr () { echo >&2 "$@"; } vlog () { [[ -n "$verbose" ]] && echoerr "$@"; } +die () { echo "Aborting: $@" ; exit 1; } + +setTrapExit () { + # save stty and trap exit, to ensure echo is re-enabled if we are interrupted. + export SBT_STTY="$(stty -g 2>/dev/null)" + + # restore stty settings (echo in particular) + onSbtRunnerExit() { + [ -t 0 ] || return + vlog "" + vlog "restoring stty: $SBT_STTY" + stty "$SBT_STTY" + } + + vlog "saving stty: $SBT_STTY" + trap onSbtRunnerExit EXIT +} + +# this seems to cover the bases on OSX, and someone will +# have to tell me about the others. +get_script_path () { + local path="$1" + [[ -L "$path" ]] || { echo "$path" ; return; } + + local target="$(readlink "$path")" + if [[ "${target:0:1}" == "/" ]]; then + echo "$target" + else + echo "${path%/*}/$target" + fi +} + +declare -r script_path="$(get_script_path "$BASH_SOURCE")" +declare -r script_name="${script_path##*/}" + +init_default_option_file () { + local overriding_var="${!1}" + local default_file="$2" + if [[ ! -r "$default_file" && "$overriding_var" =~ ^@(.*)$ ]]; then + local envvar_file="${BASH_REMATCH[1]}" + if [[ -r "$envvar_file" ]]; then + default_file="$envvar_file" + fi + fi + echo "$default_file" +} + +declare sbt_opts_file="$(init_default_option_file SBT_OPTS .sbtopts)" +declare jvm_opts_file="$(init_default_option_file JVM_OPTS .jvmopts)" -# spaces are possible, e.g. sbt.version = 0.13.0 build_props_sbt () { [[ -r "$buildProps" ]] && \ - grep '^sbt\.version' "$buildProps" | tr '=' ' ' | awk '{ print $2; }' + grep '^sbt\.version' "$buildProps" | tr '=\r' ' ' | awk '{ print $2; }' } update_build_props_sbt () { @@ -43,104 +118,87 @@ set_sbt_version () { export sbt_version } -# restore stty settings (echo in particular) -onSbtRunnerExit() { - [[ -n "$sbt_saved_stty" ]] || return - vlog "" - vlog "restoring stty: $sbt_saved_stty" - stty "$sbt_saved_stty" - unset sbt_saved_stty -} - -# save stty and trap exit, to ensure echo is reenabled if we are interrupted. -trap onSbtRunnerExit EXIT -sbt_saved_stty="$(stty -g 2>/dev/null)" -vlog "Saved stty: $sbt_saved_stty" +url_base () { + local version="$1" -# this seems to cover the bases on OSX, and someone will -# have to tell me about the others. -get_script_path () { - local path="$1" - [[ -L "$path" ]] || { echo "$path" ; return; } - - local target="$(readlink "$path")" - if [[ "${target:0:1}" == "/" ]]; then - echo "$target" - else - echo "${path%/*}/$target" - fi -} - -die() { - echo "Aborting: $@" - exit 1 + case "$version" in + 0.7.*) echo "http://simple-build-tool.googlecode.com" ;; + 0.10.* ) echo "$sbt_launch_ivy_release_repo" ;; + 0.11.[12]) echo "$sbt_launch_ivy_release_repo" ;; + 0.*-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9]) # ie "*-yyyymmdd-hhMMss" + echo "$sbt_launch_ivy_snapshot_repo" ;; + 0.*) echo "$sbt_launch_ivy_release_repo" ;; + *-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9]) # ie "*-yyyymmdd-hhMMss" + echo "$sbt_launch_mvn_snapshot_repo" ;; + *) echo "$sbt_launch_mvn_release_repo" ;; + esac } make_url () { - version="$1" + local version="$1" + + local base="${sbt_launch_repo:-$(url_base "$version")}" case "$version" in - 0.7.*) echo "http://simple-build-tool.googlecode.com/files/sbt-launch-0.7.7.jar" ;; - 0.10.* ) echo "$sbt_launch_repo/org.scala-tools.sbt/sbt-launch/$version/sbt-launch.jar" ;; - 0.11.[12]) echo "$sbt_launch_repo/org.scala-tools.sbt/sbt-launch/$version/sbt-launch.jar" ;; - *) echo "$sbt_launch_repo/org.scala-sbt/sbt-launch/$version/sbt-launch.jar" ;; + 0.7.*) echo "$base/files/sbt-launch-0.7.7.jar" ;; + 0.10.* ) echo "$base/org.scala-tools.sbt/sbt-launch/$version/sbt-launch.jar" ;; + 0.11.[12]) echo "$base/org.scala-tools.sbt/sbt-launch/$version/sbt-launch.jar" ;; + 0.*) echo "$base/org.scala-sbt/sbt-launch/$version/sbt-launch.jar" ;; + *) echo "$base/org/scala-sbt/sbt-launch/$version/sbt-launch.jar" ;; esac } -init_default_option_file () { - local overriding_var="${!1}" - local default_file="$2" - if [[ ! -r "$default_file" && "$overriding_var" =~ ^@(.*)$ ]]; then - local envvar_file="${BASH_REMATCH[1]}" - if [[ -r "$envvar_file" ]]; then - default_file="$envvar_file" - fi - fi - echo "$default_file" -} - -declare -r cms_opts="-XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC" -declare -r jit_opts="-XX:ReservedCodeCacheSize=256m -XX:+TieredCompilation" -declare -r default_jvm_opts_common="-Xms512m -Xmx1536m -Xss2m $jit_opts $cms_opts" -declare -r noshare_opts="-Dsbt.global.base=project/.sbtboot -Dsbt.boot.directory=project/.boot -Dsbt.ivy.home=project/.ivy" -declare -r latest_28="2.8.2" -declare -r latest_29="2.9.3" -declare -r latest_210="2.10.4" -declare -r latest_211="2.11.2" +addJava () { vlog "[addJava] arg = '$1'" ; java_args+=("$1"); } +addSbt () { vlog "[addSbt] arg = '$1'" ; sbt_commands+=("$1"); } +addScalac () { vlog "[addScalac] arg = '$1'" ; scalac_args+=("$1"); } +addResidual () { vlog "[residual] arg = '$1'" ; residual_args+=("$1"); } -declare -r script_path="$(get_script_path "$BASH_SOURCE")" -declare -r script_name="${script_path##*/}" - -# some non-read-onlies set with defaults -declare java_cmd="java" -declare sbt_opts_file="$(init_default_option_file SBT_OPTS .sbtopts)" -declare jvm_opts_file="$(init_default_option_file JVM_OPTS .jvmopts)" -declare sbt_launch_repo="http://typesafe.artifactoryonline.com/typesafe/ivy-releases" +addResolver () { addSbt "set resolvers += $1"; } +addDebugger () { addJava "-Xdebug" ; addJava "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$1"; } +setThisBuild () { + vlog "[addBuild] args = '$@'" + local key="$1" && shift + addSbt "set $key in ThisBuild := $@" +} +setScalaVersion () { + [[ "$1" == *"-SNAPSHOT" ]] && addResolver 'Resolver.sonatypeRepo("snapshots")' + addSbt "++ $1" +} +setJavaHome () { + java_cmd="$1/bin/java" + setThisBuild javaHome "_root_.scala.Some(file(\"$1\"))" + export JAVA_HOME="$1" + export JDK_HOME="$1" + export PATH="$JAVA_HOME/bin:$PATH" +} -# pull -J and -D options to give to java. -declare -a residual_args -declare -a java_args -declare -a scalac_args -declare -a sbt_commands +getJavaVersion() { "$1" -version 2>&1 | grep -E -e '(java|openjdk) version' | awk '{ print $3 }' | tr -d \"; } -# args to jvm/sbt via files or environment variables -declare -a extra_jvm_opts extra_sbt_opts +checkJava() { + # Warn if there is a Java version mismatch between PATH and JAVA_HOME/JDK_HOME -# if set, use JAVA_HOME over java found in path -[[ -e "$JAVA_HOME/bin/java" ]] && java_cmd="$JAVA_HOME/bin/java" + [[ -n "$JAVA_HOME" && -e "$JAVA_HOME/bin/java" ]] && java="$JAVA_HOME/bin/java" + [[ -n "$JDK_HOME" && -e "$JDK_HOME/lib/tools.jar" ]] && java="$JDK_HOME/bin/java" -# directory to store sbt launchers -declare sbt_launch_dir="$HOME/.sbt/launchers" -[[ -d "$sbt_launch_dir" ]] || mkdir -p "$sbt_launch_dir" -[[ -w "$sbt_launch_dir" ]] || sbt_launch_dir="$(mktemp -d -t sbt_extras_launchers.XXXXXX)" + if [[ -n "$java" ]]; then + pathJavaVersion=$(getJavaVersion java) + homeJavaVersion=$(getJavaVersion "$java") + if [[ "$pathJavaVersion" != "$homeJavaVersion" ]]; then + echoerr "Warning: Java version mismatch between PATH and JAVA_HOME/JDK_HOME, sbt will use the one in PATH" + echoerr " Either: fix your PATH, remove JAVA_HOME/JDK_HOME or use -java-home" + echoerr " java version from PATH: $pathJavaVersion" + echoerr " java version from JAVA_HOME/JDK_HOME: $homeJavaVersion" + fi + fi +} java_version () { - local version=$("$java_cmd" -version 2>&1 | grep -e 'java version' | awk '{ print $3 }' | tr -d \") + local version=$(getJavaVersion "$java_cmd") vlog "Detected Java version: $version" echo "${version:2:1}" } -# MaxPermSize critical on pre-8 jvms but incurs noisy warning on 8+ +# MaxPermSize critical on pre-8 JVMs but incurs noisy warning on 8+ default_jvm_opts () { local v="$(java_version)" if [[ $v -ge 8 ]]; then @@ -173,16 +231,23 @@ execRunner () { vlog "" } - [[ -n "$batch" ]] && exec /dev/null; then - curl --fail --silent "$url" --output "$jar" + curl --fail --silent --location "$url" --output "$jar" elif which wget >/dev/null; then - wget --quiet -O "$jar" "$url" + wget -q -O "$jar" "$url" fi } && [[ -r "$jar" ]] } acquire_sbt_jar () { - sbt_url="$(jar_url "$sbt_version")" - sbt_jar="$(jar_file "$sbt_version")" - - [[ -r "$sbt_jar" ]] || download_url "$sbt_url" "$sbt_jar" + { + sbt_jar="$(jar_file "$sbt_version")" + [[ -r "$sbt_jar" ]] + } || { + sbt_jar="$HOME/.ivy2/local/org.scala-sbt/sbt-launch/$sbt_version/jars/sbt-launch.jar" + [[ -r "$sbt_jar" ]] + } || { + sbt_jar="$(jar_file "$sbt_version")" + download_url "$(make_url "$sbt_version")" "$sbt_jar" + } } usage () { + set_sbt_version cat < Turn on JVM debugging, open at the given port. -batch Disable interactive mode -prompt Set the sbt prompt; in expr, 's' is the State and 'e' is Extracted + -script Run the specified file as a scala script # sbt version (default: sbt.version from $buildProps if present, otherwise $sbt_release_version) -sbt-force-latest force the use of the latest release of sbt: $sbt_release_version -sbt-version use the specified version of sbt (default: $sbt_release_version) -sbt-dev use the latest pre-release version of sbt: $sbt_unreleased_version -sbt-jar use the specified jar as the sbt launcher - -sbt-launch-dir directory to hold sbt launchers (default: ~/.sbt/launchers) - -sbt-launch-repo repo url for downloading sbt launcher jar (default: $sbt_launch_repo) + -sbt-launch-dir directory to hold sbt launchers (default: $sbt_launch_dir) + -sbt-launch-repo repo url for downloading sbt launcher jar (default: $(url_base "$sbt_version")) # scala version (default: as chosen by sbt) -28 use $latest_28 -29 use $latest_29 -210 use $latest_210 -211 use $latest_211 + -212 use $latest_212 + -213 use $latest_213 -scala-home use the scala build at the specified directory -scala-version use the specified version of scala -binary-version use the specified scala version when searching for dependencies @@ -280,42 +355,7 @@ runner with the -x option. EOM } -addJava () { - vlog "[addJava] arg = '$1'" - java_args=( "${java_args[@]}" "$1" ) -} -addSbt () { - vlog "[addSbt] arg = '$1'" - sbt_commands=( "${sbt_commands[@]}" "$1" ) -} -setThisBuild () { - vlog "[addBuild] args = '$@'" - local key="$1" && shift - addSbt "set $key in ThisBuild := $@" -} - -addScalac () { - vlog "[addScalac] arg = '$1'" - scalac_args=( "${scalac_args[@]}" "$1" ) -} -addResidual () { - vlog "[residual] arg = '$1'" - residual_args=( "${residual_args[@]}" "$1" ) -} -addResolver () { - addSbt "set resolvers += $1" -} -addDebugger () { - addJava "-Xdebug" - addJava "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$1" -} -setScalaVersion () { - [[ "$1" == *"-SNAPSHOT" ]] && addResolver 'Resolver.sonatypeRepo("snapshots")' - addSbt "++ $1" -} - -process_args () -{ +process_args () { require_arg () { local type="$1" local opt="$2" @@ -327,10 +367,10 @@ process_args () } while [[ $# -gt 0 ]]; do case "$1" in - -h|-help) usage; exit 1 ;; + -h|-help) usage; exit 0 ;; -v) verbose=true && shift ;; -d) addSbt "--debug" && shift ;; - -w) addSbt "--warn" && shift ;; + -w) addSbt "--warn" && shift ;; -q) addSbt "--error" && shift ;; -x) debugUs=true && shift ;; -trace) require_arg integer "$1" "$2" && trace_level="$2" && shift 2 ;; @@ -340,10 +380,11 @@ process_args () -sbt-boot) require_arg path "$1" "$2" && addJava "-Dsbt.boot.directory=$2" && shift 2 ;; -sbt-dir) require_arg path "$1" "$2" && sbt_dir="$2" && shift 2 ;; -debug-inc) addJava "-Dxsbt.inc.debug=true" && shift ;; - -offline) addSbt "set offline := true" && shift ;; + -offline) addSbt "set offline in Global := true" && shift ;; -jvm-debug) require_arg port "$1" "$2" && addDebugger "$2" && shift 2 ;; -batch) batch=true && shift ;; -prompt) require_arg "expr" "$1" "$2" && setThisBuild shellPrompt "(s => { val e = Project.extract(s) ; $2 })" && shift 2 ;; + -script) require_arg file "$1" "$2" && sbt_script="$2" && addJava "-Dsbt.main.class=sbt.ScriptMain" && shift 2 ;; -sbt-create) sbt_create=true && shift ;; -sbt-jar) require_arg path "$1" "$2" && sbt_jar="$2" && shift 2 ;; @@ -354,8 +395,8 @@ process_args () -sbt-launch-repo) require_arg path "$1" "$2" && sbt_launch_repo="$2" && shift 2 ;; -scala-version) require_arg version "$1" "$2" && setScalaVersion "$2" && shift 2 ;; -binary-version) require_arg version "$1" "$2" && setThisBuild scalaBinaryVersion "\"$2\"" && shift 2 ;; - -scala-home) require_arg path "$1" "$2" && setThisBuild scalaHome "Some(file(\"$2\"))" && shift 2 ;; - -java-home) require_arg path "$1" "$2" && java_cmd="$2/bin/java" && shift 2 ;; + -scala-home) require_arg path "$1" "$2" && setThisBuild scalaHome "_root_.scala.Some(file(\"$2\"))" && shift 2 ;; + -java-home) require_arg path "$1" "$2" && setJavaHome "$2" && shift 2 ;; -sbt-opts) require_arg path "$1" "$2" && sbt_opts_file="$2" && shift 2 ;; -jvm-opts) require_arg path "$1" "$2" && jvm_opts_file="$2" && shift 2 ;; @@ -366,7 +407,9 @@ process_args () -29) setScalaVersion "$latest_29" && shift ;; -210) setScalaVersion "$latest_210" && shift ;; -211) setScalaVersion "$latest_211" && shift ;; - + -212) setScalaVersion "$latest_212" && shift ;; + -213) setScalaVersion "$latest_213" && shift ;; + new) sbt_new=true && : ${sbt_explicit_version:=$sbt_release_version} && addResidual "$1" && shift ;; *) addResidual "$1" && shift ;; esac done @@ -377,8 +420,10 @@ process_args "$@" # skip #-styled comments and blank lines readConfigFile() { - while read line; do - [[ $line =~ ^# ]] || [[ -z $line ]] || echo "$line" + local end=false + until $end; do + read || end=true + [[ $REPLY =~ ^# ]] || [[ -z $REPLY ]] || echo "$REPLY" done < "$1" } @@ -403,6 +448,8 @@ argumentCount=$# # set sbt version set_sbt_version +checkJava + # only exists in 0.12+ setTraceLevel() { case "$sbt_version" in @@ -415,19 +462,21 @@ setTraceLevel() { [[ ${#scalac_args[@]} -eq 0 ]] || addSbt "set scalacOptions in ThisBuild += \"${scalac_args[@]}\"" # Update build.properties on disk to set explicit version - sbt gives us no choice -[[ -n "$sbt_explicit_version" ]] && update_build_props_sbt "$sbt_explicit_version" +[[ -n "$sbt_explicit_version" && -z "$sbt_new" ]] && update_build_props_sbt "$sbt_explicit_version" vlog "Detected sbt version $sbt_version" -[[ -n "$scala_version" ]] && vlog "Overriding scala version to $scala_version" - -# no args - alert them there's stuff in here -(( argumentCount > 0 )) || { - vlog "Starting $script_name: invoke with -help for other options" - residual_args=( shell ) -} +if [[ -n "$sbt_script" ]]; then + residual_args=( $sbt_script ${residual_args[@]} ) +else + # no args - alert them there's stuff in here + (( argumentCount > 0 )) || { + vlog "Starting $script_name: invoke with -help for other options" + residual_args=( shell ) + } +fi -# verify this is an sbt dir or -create was given -[[ -r ./build.sbt || -d ./project || -n "$sbt_create" ]] || { +# verify this is an sbt dir, -create was given or user attempts to run a scala script +[[ -r ./build.sbt || -d ./project || -n "$sbt_create" || -n "$sbt_script" || -n "$sbt_new" ]] || { cat < - + xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee + http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" + version="3.1"> + + org.scalatra.servlet.ScalatraListener - - - default - /*.html - /css/* - /js/*.js - /images/* - diff --git a/samples/server/petstore/scalatra/.swagger-codegen/VERSION b/samples/server/petstore/scalatra/.swagger-codegen/VERSION index 7fea99011a6..50794f17f1a 100644 --- a/samples/server/petstore/scalatra/.swagger-codegen/VERSION +++ b/samples/server/petstore/scalatra/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/scalatra/README.md b/samples/server/petstore/scalatra/README.md index 327870827fd..a6ac34b03e0 100644 --- a/samples/server/petstore/scalatra/README.md +++ b/samples/server/petstore/scalatra/README.md @@ -5,6 +5,4 @@ This server was generated by the [swagger-codegen](https://github.com/swagger-ap [OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This is an example of building a swagger-enabled scalatra server. -This example uses the [scalatra](http://scalatra.org/) framework. To see how to make this your own, look here: - -[README](https://github.com/swagger-api/swagger-codegen/tree/master/samples/server-generator/scalatra) \ No newline at end of file +This example uses the [scalatra](http://scalatra.org/) framework. diff --git a/samples/server/petstore/scalatra/build.sbt b/samples/server/petstore/scalatra/build.sbt index 00575312d85..aecfef97d5b 100644 --- a/samples/server/petstore/scalatra/build.sbt +++ b/samples/server/petstore/scalatra/build.sbt @@ -1,64 +1,21 @@ -import AssemblyKeys._ // put this at the top of the file - -import NativePackagerKeys._ - -packageArchetype.java_server - -assemblySettings - -scalariformSettings - organization := "io.swagger" - -seq(webSettings :_*) - -mainClass in assembly := Some("JettyMain") - name := "scalatra-sample" - version := "0.1.0-SNAPSHOT" +scalaVersion := "2.12.4" -scalaVersion := "2.11.2" +mainClass in assembly := Some("JettyMain") -scalacOptions += "-language:postfixOps" +val ScalatraVersion = "2.6.2" libraryDependencies ++= Seq( - "org.scalatest" %% "scalatest" % "2.2.1" % "test", - "org.scalatra" %% "scalatra" % "2.3.0.RC3", - "org.scalatra" %% "scalatra-scalate" % "2.3.0.RC3", - "org.scalatra" %% "scalatra-json" % "2.3.0.RC3", - "org.scalatra" %% "scalatra-swagger" % "2.3.0.RC3", - "org.scalatra" %% "scalatra-swagger-ext" % "2.3.0.RC3", - "org.scalatra" %% "scalatra-slf4j" % "2.3.0.RC3", - "org.json4s" %% "json4s-jackson" % "3.2.10", - "org.json4s" %% "json4s-ext" % "3.2.10", - "commons-codec" % "commons-codec" % "1.7", - "net.databinder.dispatch" %% "dispatch-core" % "0.11.2", - //"net.databinder.dispatch" %% "json4s-jackson" % "0.11.2", - "net.databinder.dispatch" %% "dispatch-json4s-jackson" % "0.11.2", - "com.typesafe.akka" %% "akka-actor" % "2.3.6", - "org.eclipse.jetty" % "jetty-server" % "9.2.3.v20140905" % "container;compile;test", - "org.eclipse.jetty" % "jetty-webapp" % "9.2.3.v20140905" % "container;compile;test", - "org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "container;compile;provided;test" artifacts (Artifact("javax.servlet", "jar", "jar")) + "org.scalatra" %% "scalatra" % ScalatraVersion, + "org.scalatra" %% "scalatra-swagger" % ScalatraVersion, + "org.scalatra" %% "scalatra-scalatest" % ScalatraVersion % Test, + "org.json4s" %% "json4s-jackson" % "3.5.0", + "org.eclipse.jetty" % "jetty-server" % "9.4.8.v20171121", + "org.eclipse.jetty" % "jetty-webapp" % "9.4.8.v20171121", + "javax.servlet" % "javax.servlet-api" % "3.1.0", + "ch.qos.logback" % "logback-classic" % "1.2.3" % Provided ) -resolvers += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository" - -resolvers += "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/" - -resolvers += "Sonatype OSS Releases" at "http://oss.sonatype.org/content/repositories/releases/" - -ivyXML := - - - - - -mergeStrategy in assembly <<= (mergeStrategy in assembly) { - (old) => { - case "about.html" => MergeStrategy.discard - case x => old(x) - } -} - -net.virtualvoid.sbt.graph.Plugin.graphSettings +enablePlugins(JettyPlugin) \ No newline at end of file diff --git a/samples/server/petstore/scalatra/project/build.properties b/samples/server/petstore/scalatra/project/build.properties index be6c454fbac..8b697bbb94f 100644 --- a/samples/server/petstore/scalatra/project/build.properties +++ b/samples/server/petstore/scalatra/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.5 +sbt.version=1.1.0 diff --git a/samples/server/petstore/scalatra/project/plugins.sbt b/samples/server/petstore/scalatra/project/plugins.sbt index 7358abbbbc6..3c8855a0990 100644 --- a/samples/server/petstore/scalatra/project/plugins.sbt +++ b/samples/server/petstore/scalatra/project/plugins.sbt @@ -1,9 +1,3 @@ -addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.10.1") - -addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.7.5") - -addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "0.9.0") - -addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.3.0") - -addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.7.4") +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6") +addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "4.0.1") +addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.8.2") diff --git a/samples/server/petstore/scalatra/sbt b/samples/server/petstore/scalatra/sbt old mode 100644 new mode 100755 index 08e58821219..218f371c03b --- a/samples/server/petstore/scalatra/sbt +++ b/samples/server/petstore/scalatra/sbt @@ -1,25 +1,100 @@ #!/usr/bin/env bash # # A more capable sbt runner, coincidentally also called sbt. -# Author: Paul Phillips +# Author: Paul Phillips + +set -o pipefail + +declare -r sbt_release_version="0.13.16" +declare -r sbt_unreleased_version="0.13.16" + +declare -r latest_213="2.13.0-M2" +declare -r latest_212="2.12.4" +declare -r latest_211="2.11.12" +declare -r latest_210="2.10.7" +declare -r latest_29="2.9.3" +declare -r latest_28="2.8.2" -# todo - make this dynamic -declare -r sbt_release_version="0.13.6" -declare -r sbt_unreleased_version="0.13.6" declare -r buildProps="project/build.properties" -declare sbt_jar sbt_dir sbt_create sbt_version -declare scala_version sbt_explicit_version -declare verbose noshare batch trace_level log_level -declare sbt_saved_stty debugUs +declare -r sbt_launch_ivy_release_repo="http://repo.typesafe.com/typesafe/ivy-releases" +declare -r sbt_launch_ivy_snapshot_repo="https://repo.scala-sbt.org/scalasbt/ivy-snapshots" +declare -r sbt_launch_mvn_release_repo="http://repo.scala-sbt.org/scalasbt/maven-releases" +declare -r sbt_launch_mvn_snapshot_repo="http://repo.scala-sbt.org/scalasbt/maven-snapshots" + +declare -r default_jvm_opts_common="-Xms512m -Xmx1536m -Xss2m" +declare -r noshare_opts="-Dsbt.global.base=project/.sbtboot -Dsbt.boot.directory=project/.boot -Dsbt.ivy.home=project/.ivy" + +declare sbt_jar sbt_dir sbt_create sbt_version sbt_script sbt_new +declare sbt_explicit_version +declare verbose noshare batch trace_level +declare debugUs + +declare java_cmd="java" +declare sbt_launch_dir="$HOME/.sbt/launchers" +declare sbt_launch_repo + +# pull -J and -D options to give to java. +declare -a java_args scalac_args sbt_commands residual_args + +# args to jvm/sbt via files or environment variables +declare -a extra_jvm_opts extra_sbt_opts echoerr () { echo >&2 "$@"; } vlog () { [[ -n "$verbose" ]] && echoerr "$@"; } +die () { echo "Aborting: $@" ; exit 1; } + +setTrapExit () { + # save stty and trap exit, to ensure echo is re-enabled if we are interrupted. + export SBT_STTY="$(stty -g 2>/dev/null)" + + # restore stty settings (echo in particular) + onSbtRunnerExit() { + [ -t 0 ] || return + vlog "" + vlog "restoring stty: $SBT_STTY" + stty "$SBT_STTY" + } + + vlog "saving stty: $SBT_STTY" + trap onSbtRunnerExit EXIT +} + +# this seems to cover the bases on OSX, and someone will +# have to tell me about the others. +get_script_path () { + local path="$1" + [[ -L "$path" ]] || { echo "$path" ; return; } + + local target="$(readlink "$path")" + if [[ "${target:0:1}" == "/" ]]; then + echo "$target" + else + echo "${path%/*}/$target" + fi +} + +declare -r script_path="$(get_script_path "$BASH_SOURCE")" +declare -r script_name="${script_path##*/}" + +init_default_option_file () { + local overriding_var="${!1}" + local default_file="$2" + if [[ ! -r "$default_file" && "$overriding_var" =~ ^@(.*)$ ]]; then + local envvar_file="${BASH_REMATCH[1]}" + if [[ -r "$envvar_file" ]]; then + default_file="$envvar_file" + fi + fi + echo "$default_file" +} + +declare sbt_opts_file="$(init_default_option_file SBT_OPTS .sbtopts)" +declare jvm_opts_file="$(init_default_option_file JVM_OPTS .jvmopts)" -# spaces are possible, e.g. sbt.version = 0.13.0 build_props_sbt () { [[ -r "$buildProps" ]] && \ - grep '^sbt\.version' "$buildProps" | tr '=' ' ' | awk '{ print $2; }' + grep '^sbt\.version' "$buildProps" | tr '=\r' ' ' | awk '{ print $2; }' } update_build_props_sbt () { @@ -43,104 +118,87 @@ set_sbt_version () { export sbt_version } -# restore stty settings (echo in particular) -onSbtRunnerExit() { - [[ -n "$sbt_saved_stty" ]] || return - vlog "" - vlog "restoring stty: $sbt_saved_stty" - stty "$sbt_saved_stty" - unset sbt_saved_stty -} - -# save stty and trap exit, to ensure echo is reenabled if we are interrupted. -trap onSbtRunnerExit EXIT -sbt_saved_stty="$(stty -g 2>/dev/null)" -vlog "Saved stty: $sbt_saved_stty" +url_base () { + local version="$1" -# this seems to cover the bases on OSX, and someone will -# have to tell me about the others. -get_script_path () { - local path="$1" - [[ -L "$path" ]] || { echo "$path" ; return; } - - local target="$(readlink "$path")" - if [[ "${target:0:1}" == "/" ]]; then - echo "$target" - else - echo "${path%/*}/$target" - fi -} - -die() { - echo "Aborting: $@" - exit 1 + case "$version" in + 0.7.*) echo "http://simple-build-tool.googlecode.com" ;; + 0.10.* ) echo "$sbt_launch_ivy_release_repo" ;; + 0.11.[12]) echo "$sbt_launch_ivy_release_repo" ;; + 0.*-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9]) # ie "*-yyyymmdd-hhMMss" + echo "$sbt_launch_ivy_snapshot_repo" ;; + 0.*) echo "$sbt_launch_ivy_release_repo" ;; + *-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9]) # ie "*-yyyymmdd-hhMMss" + echo "$sbt_launch_mvn_snapshot_repo" ;; + *) echo "$sbt_launch_mvn_release_repo" ;; + esac } make_url () { - version="$1" + local version="$1" + + local base="${sbt_launch_repo:-$(url_base "$version")}" case "$version" in - 0.7.*) echo "http://simple-build-tool.googlecode.com/files/sbt-launch-0.7.7.jar" ;; - 0.10.* ) echo "$sbt_launch_repo/org.scala-tools.sbt/sbt-launch/$version/sbt-launch.jar" ;; - 0.11.[12]) echo "$sbt_launch_repo/org.scala-tools.sbt/sbt-launch/$version/sbt-launch.jar" ;; - *) echo "$sbt_launch_repo/org.scala-sbt/sbt-launch/$version/sbt-launch.jar" ;; + 0.7.*) echo "$base/files/sbt-launch-0.7.7.jar" ;; + 0.10.* ) echo "$base/org.scala-tools.sbt/sbt-launch/$version/sbt-launch.jar" ;; + 0.11.[12]) echo "$base/org.scala-tools.sbt/sbt-launch/$version/sbt-launch.jar" ;; + 0.*) echo "$base/org.scala-sbt/sbt-launch/$version/sbt-launch.jar" ;; + *) echo "$base/org/scala-sbt/sbt-launch/$version/sbt-launch.jar" ;; esac } -init_default_option_file () { - local overriding_var="${!1}" - local default_file="$2" - if [[ ! -r "$default_file" && "$overriding_var" =~ ^@(.*)$ ]]; then - local envvar_file="${BASH_REMATCH[1]}" - if [[ -r "$envvar_file" ]]; then - default_file="$envvar_file" - fi - fi - echo "$default_file" -} - -declare -r cms_opts="-XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC" -declare -r jit_opts="-XX:ReservedCodeCacheSize=256m -XX:+TieredCompilation" -declare -r default_jvm_opts_common="-Xms512m -Xmx1536m -Xss2m $jit_opts $cms_opts" -declare -r noshare_opts="-Dsbt.global.base=project/.sbtboot -Dsbt.boot.directory=project/.boot -Dsbt.ivy.home=project/.ivy" -declare -r latest_28="2.8.2" -declare -r latest_29="2.9.3" -declare -r latest_210="2.10.4" -declare -r latest_211="2.11.2" +addJava () { vlog "[addJava] arg = '$1'" ; java_args+=("$1"); } +addSbt () { vlog "[addSbt] arg = '$1'" ; sbt_commands+=("$1"); } +addScalac () { vlog "[addScalac] arg = '$1'" ; scalac_args+=("$1"); } +addResidual () { vlog "[residual] arg = '$1'" ; residual_args+=("$1"); } -declare -r script_path="$(get_script_path "$BASH_SOURCE")" -declare -r script_name="${script_path##*/}" - -# some non-read-onlies set with defaults -declare java_cmd="java" -declare sbt_opts_file="$(init_default_option_file SBT_OPTS .sbtopts)" -declare jvm_opts_file="$(init_default_option_file JVM_OPTS .jvmopts)" -declare sbt_launch_repo="http://typesafe.artifactoryonline.com/typesafe/ivy-releases" +addResolver () { addSbt "set resolvers += $1"; } +addDebugger () { addJava "-Xdebug" ; addJava "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$1"; } +setThisBuild () { + vlog "[addBuild] args = '$@'" + local key="$1" && shift + addSbt "set $key in ThisBuild := $@" +} +setScalaVersion () { + [[ "$1" == *"-SNAPSHOT" ]] && addResolver 'Resolver.sonatypeRepo("snapshots")' + addSbt "++ $1" +} +setJavaHome () { + java_cmd="$1/bin/java" + setThisBuild javaHome "_root_.scala.Some(file(\"$1\"))" + export JAVA_HOME="$1" + export JDK_HOME="$1" + export PATH="$JAVA_HOME/bin:$PATH" +} -# pull -J and -D options to give to java. -declare -a residual_args -declare -a java_args -declare -a scalac_args -declare -a sbt_commands +getJavaVersion() { "$1" -version 2>&1 | grep -E -e '(java|openjdk) version' | awk '{ print $3 }' | tr -d \"; } -# args to jvm/sbt via files or environment variables -declare -a extra_jvm_opts extra_sbt_opts +checkJava() { + # Warn if there is a Java version mismatch between PATH and JAVA_HOME/JDK_HOME -# if set, use JAVA_HOME over java found in path -[[ -e "$JAVA_HOME/bin/java" ]] && java_cmd="$JAVA_HOME/bin/java" + [[ -n "$JAVA_HOME" && -e "$JAVA_HOME/bin/java" ]] && java="$JAVA_HOME/bin/java" + [[ -n "$JDK_HOME" && -e "$JDK_HOME/lib/tools.jar" ]] && java="$JDK_HOME/bin/java" -# directory to store sbt launchers -declare sbt_launch_dir="$HOME/.sbt/launchers" -[[ -d "$sbt_launch_dir" ]] || mkdir -p "$sbt_launch_dir" -[[ -w "$sbt_launch_dir" ]] || sbt_launch_dir="$(mktemp -d -t sbt_extras_launchers.XXXXXX)" + if [[ -n "$java" ]]; then + pathJavaVersion=$(getJavaVersion java) + homeJavaVersion=$(getJavaVersion "$java") + if [[ "$pathJavaVersion" != "$homeJavaVersion" ]]; then + echoerr "Warning: Java version mismatch between PATH and JAVA_HOME/JDK_HOME, sbt will use the one in PATH" + echoerr " Either: fix your PATH, remove JAVA_HOME/JDK_HOME or use -java-home" + echoerr " java version from PATH: $pathJavaVersion" + echoerr " java version from JAVA_HOME/JDK_HOME: $homeJavaVersion" + fi + fi +} java_version () { - local version=$("$java_cmd" -version 2>&1 | grep -e 'java version' | awk '{ print $3 }' | tr -d \") + local version=$(getJavaVersion "$java_cmd") vlog "Detected Java version: $version" echo "${version:2:1}" } -# MaxPermSize critical on pre-8 jvms but incurs noisy warning on 8+ +# MaxPermSize critical on pre-8 JVMs but incurs noisy warning on 8+ default_jvm_opts () { local v="$(java_version)" if [[ $v -ge 8 ]]; then @@ -173,16 +231,23 @@ execRunner () { vlog "" } - [[ -n "$batch" ]] && exec /dev/null; then - curl --fail --silent "$url" --output "$jar" + curl --fail --silent --location "$url" --output "$jar" elif which wget >/dev/null; then - wget --quiet -O "$jar" "$url" + wget -q -O "$jar" "$url" fi } && [[ -r "$jar" ]] } acquire_sbt_jar () { - sbt_url="$(jar_url "$sbt_version")" - sbt_jar="$(jar_file "$sbt_version")" - - [[ -r "$sbt_jar" ]] || download_url "$sbt_url" "$sbt_jar" + { + sbt_jar="$(jar_file "$sbt_version")" + [[ -r "$sbt_jar" ]] + } || { + sbt_jar="$HOME/.ivy2/local/org.scala-sbt/sbt-launch/$sbt_version/jars/sbt-launch.jar" + [[ -r "$sbt_jar" ]] + } || { + sbt_jar="$(jar_file "$sbt_version")" + download_url "$(make_url "$sbt_version")" "$sbt_jar" + } } usage () { + set_sbt_version cat < Turn on JVM debugging, open at the given port. -batch Disable interactive mode -prompt Set the sbt prompt; in expr, 's' is the State and 'e' is Extracted + -script Run the specified file as a scala script # sbt version (default: sbt.version from $buildProps if present, otherwise $sbt_release_version) -sbt-force-latest force the use of the latest release of sbt: $sbt_release_version -sbt-version use the specified version of sbt (default: $sbt_release_version) -sbt-dev use the latest pre-release version of sbt: $sbt_unreleased_version -sbt-jar use the specified jar as the sbt launcher - -sbt-launch-dir directory to hold sbt launchers (default: ~/.sbt/launchers) - -sbt-launch-repo repo url for downloading sbt launcher jar (default: $sbt_launch_repo) + -sbt-launch-dir directory to hold sbt launchers (default: $sbt_launch_dir) + -sbt-launch-repo repo url for downloading sbt launcher jar (default: $(url_base "$sbt_version")) # scala version (default: as chosen by sbt) -28 use $latest_28 -29 use $latest_29 -210 use $latest_210 -211 use $latest_211 + -212 use $latest_212 + -213 use $latest_213 -scala-home use the scala build at the specified directory -scala-version use the specified version of scala -binary-version use the specified scala version when searching for dependencies @@ -280,42 +355,7 @@ runner with the -x option. EOM } -addJava () { - vlog "[addJava] arg = '$1'" - java_args=( "${java_args[@]}" "$1" ) -} -addSbt () { - vlog "[addSbt] arg = '$1'" - sbt_commands=( "${sbt_commands[@]}" "$1" ) -} -setThisBuild () { - vlog "[addBuild] args = '$@'" - local key="$1" && shift - addSbt "set $key in ThisBuild := $@" -} - -addScalac () { - vlog "[addScalac] arg = '$1'" - scalac_args=( "${scalac_args[@]}" "$1" ) -} -addResidual () { - vlog "[residual] arg = '$1'" - residual_args=( "${residual_args[@]}" "$1" ) -} -addResolver () { - addSbt "set resolvers += $1" -} -addDebugger () { - addJava "-Xdebug" - addJava "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$1" -} -setScalaVersion () { - [[ "$1" == *"-SNAPSHOT" ]] && addResolver 'Resolver.sonatypeRepo("snapshots")' - addSbt "++ $1" -} - -process_args () -{ +process_args () { require_arg () { local type="$1" local opt="$2" @@ -327,10 +367,10 @@ process_args () } while [[ $# -gt 0 ]]; do case "$1" in - -h|-help) usage; exit 1 ;; + -h|-help) usage; exit 0 ;; -v) verbose=true && shift ;; -d) addSbt "--debug" && shift ;; - -w) addSbt "--warn" && shift ;; + -w) addSbt "--warn" && shift ;; -q) addSbt "--error" && shift ;; -x) debugUs=true && shift ;; -trace) require_arg integer "$1" "$2" && trace_level="$2" && shift 2 ;; @@ -340,10 +380,11 @@ process_args () -sbt-boot) require_arg path "$1" "$2" && addJava "-Dsbt.boot.directory=$2" && shift 2 ;; -sbt-dir) require_arg path "$1" "$2" && sbt_dir="$2" && shift 2 ;; -debug-inc) addJava "-Dxsbt.inc.debug=true" && shift ;; - -offline) addSbt "set offline := true" && shift ;; + -offline) addSbt "set offline in Global := true" && shift ;; -jvm-debug) require_arg port "$1" "$2" && addDebugger "$2" && shift 2 ;; -batch) batch=true && shift ;; -prompt) require_arg "expr" "$1" "$2" && setThisBuild shellPrompt "(s => { val e = Project.extract(s) ; $2 })" && shift 2 ;; + -script) require_arg file "$1" "$2" && sbt_script="$2" && addJava "-Dsbt.main.class=sbt.ScriptMain" && shift 2 ;; -sbt-create) sbt_create=true && shift ;; -sbt-jar) require_arg path "$1" "$2" && sbt_jar="$2" && shift 2 ;; @@ -354,8 +395,8 @@ process_args () -sbt-launch-repo) require_arg path "$1" "$2" && sbt_launch_repo="$2" && shift 2 ;; -scala-version) require_arg version "$1" "$2" && setScalaVersion "$2" && shift 2 ;; -binary-version) require_arg version "$1" "$2" && setThisBuild scalaBinaryVersion "\"$2\"" && shift 2 ;; - -scala-home) require_arg path "$1" "$2" && setThisBuild scalaHome "Some(file(\"$2\"))" && shift 2 ;; - -java-home) require_arg path "$1" "$2" && java_cmd="$2/bin/java" && shift 2 ;; + -scala-home) require_arg path "$1" "$2" && setThisBuild scalaHome "_root_.scala.Some(file(\"$2\"))" && shift 2 ;; + -java-home) require_arg path "$1" "$2" && setJavaHome "$2" && shift 2 ;; -sbt-opts) require_arg path "$1" "$2" && sbt_opts_file="$2" && shift 2 ;; -jvm-opts) require_arg path "$1" "$2" && jvm_opts_file="$2" && shift 2 ;; @@ -366,7 +407,9 @@ process_args () -29) setScalaVersion "$latest_29" && shift ;; -210) setScalaVersion "$latest_210" && shift ;; -211) setScalaVersion "$latest_211" && shift ;; - + -212) setScalaVersion "$latest_212" && shift ;; + -213) setScalaVersion "$latest_213" && shift ;; + new) sbt_new=true && : ${sbt_explicit_version:=$sbt_release_version} && addResidual "$1" && shift ;; *) addResidual "$1" && shift ;; esac done @@ -377,8 +420,10 @@ process_args "$@" # skip #-styled comments and blank lines readConfigFile() { - while read line; do - [[ $line =~ ^# ]] || [[ -z $line ]] || echo "$line" + local end=false + until $end; do + read || end=true + [[ $REPLY =~ ^# ]] || [[ -z $REPLY ]] || echo "$REPLY" done < "$1" } @@ -403,6 +448,8 @@ argumentCount=$# # set sbt version set_sbt_version +checkJava + # only exists in 0.12+ setTraceLevel() { case "$sbt_version" in @@ -415,19 +462,21 @@ setTraceLevel() { [[ ${#scalac_args[@]} -eq 0 ]] || addSbt "set scalacOptions in ThisBuild += \"${scalac_args[@]}\"" # Update build.properties on disk to set explicit version - sbt gives us no choice -[[ -n "$sbt_explicit_version" ]] && update_build_props_sbt "$sbt_explicit_version" +[[ -n "$sbt_explicit_version" && -z "$sbt_new" ]] && update_build_props_sbt "$sbt_explicit_version" vlog "Detected sbt version $sbt_version" -[[ -n "$scala_version" ]] && vlog "Overriding scala version to $scala_version" - -# no args - alert them there's stuff in here -(( argumentCount > 0 )) || { - vlog "Starting $script_name: invoke with -help for other options" - residual_args=( shell ) -} +if [[ -n "$sbt_script" ]]; then + residual_args=( $sbt_script ${residual_args[@]} ) +else + # no args - alert them there's stuff in here + (( argumentCount > 0 )) || { + vlog "Starting $script_name: invoke with -help for other options" + residual_args=( shell ) + } +fi -# verify this is an sbt dir or -create was given -[[ -r ./build.sbt || -d ./project || -n "$sbt_create" ]] || { +# verify this is an sbt dir, -create was given or user attempts to run a scala script +[[ -r ./build.sbt || -d ./project || -n "$sbt_create" || -n "$sbt_script" || -n "$sbt_new" ]] || { cat < + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + diff --git a/samples/server/petstore/scalatra/src/main/scala/JettyMain.scala b/samples/server/petstore/scalatra/src/main/scala/JettyMain.scala index 01f9a6731ed..757a745ad10 100644 --- a/samples/server/petstore/scalatra/src/main/scala/JettyMain.scala +++ b/samples/server/petstore/scalatra/src/main/scala/JettyMain.scala @@ -10,7 +10,6 @@ * Do not edit the class manually. */ - import org.eclipse.jetty.server._ import org.eclipse.jetty.webapp.WebAppContext import org.scalatra.servlet.ScalatraListener diff --git a/samples/server/petstore/scalatra/src/main/scala/ScalatraBootstrap.scala b/samples/server/petstore/scalatra/src/main/scala/ScalatraBootstrap.scala index 0b7fc9c5a4d..7171a0e2a31 100644 --- a/samples/server/petstore/scalatra/src/main/scala/ScalatraBootstrap.scala +++ b/samples/server/petstore/scalatra/src/main/scala/ScalatraBootstrap.scala @@ -11,9 +11,8 @@ */ -import com.wordnik.client.api._ -import akka.actor.ActorSystem -import io.swagger.app.{ResourcesApp, SwaggerApp} +import io.swagger.server.api._ +import io.swagger.app.{ ResourcesApp, SwaggerApp } import javax.servlet.ServletContext import org.scalatra.LifeCycle @@ -21,7 +20,6 @@ class ScalatraBootstrap extends LifeCycle { implicit val swagger = new SwaggerApp override def init(context: ServletContext) { - implicit val system = ActorSystem("appActorSystem") try { context mount (new PetApi, "/v2/Pet/*") context mount (new StoreApi, "/v2/Store/*") @@ -32,4 +30,4 @@ class ScalatraBootstrap extends LifeCycle { case e: Throwable => e.printStackTrace() } } -} \ No newline at end of file +} diff --git a/samples/server/petstore/scalatra/src/main/scala/ServletApp.scala b/samples/server/petstore/scalatra/src/main/scala/ServletApp.scala index 010c8bc1b08..a48bb76a74e 100644 --- a/samples/server/petstore/scalatra/src/main/scala/ServletApp.scala +++ b/samples/server/petstore/scalatra/src/main/scala/ServletApp.scala @@ -13,40 +13,26 @@ package io.swagger.app -import _root_.akka.actor.ActorSystem - import org.scalatra.swagger.{ ApiInfo, SwaggerWithAuth, Swagger } -import org.scalatra.swagger.{JacksonSwaggerBase, Swagger} +import org.scalatra.swagger.{ JacksonSwaggerBase, Swagger } import org.scalatra.ScalatraServlet -import org.json4s.{DefaultFormats, Formats} +import org.json4s.{ DefaultFormats, Formats } -class ResourcesApp(implicit protected val system: ActorSystem, val swagger: SwaggerApp) +class ResourcesApp(implicit protected val swagger: SwaggerApp) extends ScalatraServlet with JacksonSwaggerBase { before() { response.headers += ("Access-Control-Allow-Origin" -> "*") } - - protected def buildFullUrl(path: String) = if (path.startsWith("http")) path else { - val port = request.getServerPort - val h = request.getServerName - val prot = if (port == 443) "https" else "http" - val (proto, host) = if (port != 80 && port != 443) ("http", h+":"+port.toString) else (prot, h) - "%s://%s%s%s".format( - proto, - host, - request.getContextPath, - path) - } } -class SwaggerApp extends Swagger(apiInfo = ApiSwagger.apiInfo, apiVersion = "1.0", swaggerVersion = "1.2") +class SwaggerApp extends Swagger(apiInfo = ApiSwagger.apiInfo, apiVersion = "1.0", swaggerVersion = Swagger.SpecVersion) object ApiSwagger { val apiInfo = ApiInfo( """Swagger Petstore""", """This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.""", - """""", + """http://swagger.io""", """apiteam@swagger.io""", - """Apache 2.0""", + """Apache-2.0""", """http://www.apache.org/licenses/LICENSE-2.0.html""") -} \ No newline at end of file +} diff --git a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/PetApi.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/PetApi.scala similarity index 90% rename from samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/PetApi.scala rename to samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/PetApi.scala index 7c6d352ae5d..9b2f3da7185 100644 --- a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/PetApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/PetApi.scala @@ -11,31 +11,30 @@ */ -package com.wordnik.client.api +package io.swagger.server.api -import com.wordnik.client.model.ApiResponse +import io.swagger.server.model.ApiResponse import java.io.File -import com.wordnik.client.model.Pet +import io.swagger.server.model.Pet import java.io.File -import org.scalatra.{ TypedParamSupport, ScalatraServlet } +import org.scalatra.ScalatraServlet import org.scalatra.swagger._ import org.json4s._ import org.json4s.JsonDSL._ import org.scalatra.json.{ JValueResult, JacksonJsonSupport } -import org.scalatra.servlet.{FileUploadSupport, MultipartConfig, SizeConstraintExceededException} +import org.scalatra.servlet.{ FileUploadSupport, MultipartConfig, SizeConstraintExceededException } import scala.collection.JavaConverters._ -class PetApi (implicit val swagger: Swagger) extends ScalatraServlet - with FileUploadSupport - with JacksonJsonSupport - with SwaggerSupport { +class PetApi(implicit val swagger: Swagger) extends ScalatraServlet + with FileUploadSupport + with JacksonJsonSupport + with SwaggerSupport { protected implicit val jsonFormats: Formats = DefaultFormats protected val applicationDescription: String = "PetApi" - override protected val applicationName: Option[String] = Some("/v2/Pet") before() { contentType = formats("json") diff --git a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/StoreApi.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/StoreApi.scala similarity index 83% rename from samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/StoreApi.scala rename to samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/StoreApi.scala index 58af1ba24f5..e515a8ded49 100644 --- a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/StoreApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/StoreApi.scala @@ -11,29 +11,28 @@ */ -package com.wordnik.client.api +package io.swagger.server.api -import com.wordnik.client.model.Order +import io.swagger.server.model.Order import java.io.File -import org.scalatra.{ TypedParamSupport, ScalatraServlet } +import org.scalatra.ScalatraServlet import org.scalatra.swagger._ import org.json4s._ import org.json4s.JsonDSL._ import org.scalatra.json.{ JValueResult, JacksonJsonSupport } -import org.scalatra.servlet.{FileUploadSupport, MultipartConfig, SizeConstraintExceededException} +import org.scalatra.servlet.{ FileUploadSupport, MultipartConfig, SizeConstraintExceededException } import scala.collection.JavaConverters._ -class StoreApi (implicit val swagger: Swagger) extends ScalatraServlet - with FileUploadSupport - with JacksonJsonSupport - with SwaggerSupport { +class StoreApi(implicit val swagger: Swagger) extends ScalatraServlet + with FileUploadSupport + with JacksonJsonSupport + with SwaggerSupport { protected implicit val jsonFormats: Formats = DefaultFormats protected val applicationDescription: String = "StoreApi" - override protected val applicationName: Option[String] = Some("/v2/Store") before() { contentType = formats("json") diff --git a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/UserApi.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/UserApi.scala similarity index 89% rename from samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/UserApi.scala rename to samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/UserApi.scala index 8dfcc672c26..31de254933e 100644 --- a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/api/UserApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/UserApi.scala @@ -11,29 +11,28 @@ */ -package com.wordnik.client.api +package io.swagger.server.api -import com.wordnik.client.model.User +import io.swagger.server.model.User import java.io.File -import org.scalatra.{ TypedParamSupport, ScalatraServlet } +import org.scalatra.ScalatraServlet import org.scalatra.swagger._ import org.json4s._ import org.json4s.JsonDSL._ import org.scalatra.json.{ JValueResult, JacksonJsonSupport } -import org.scalatra.servlet.{FileUploadSupport, MultipartConfig, SizeConstraintExceededException} +import org.scalatra.servlet.{ FileUploadSupport, MultipartConfig, SizeConstraintExceededException } import scala.collection.JavaConverters._ -class UserApi (implicit val swagger: Swagger) extends ScalatraServlet - with FileUploadSupport - with JacksonJsonSupport - with SwaggerSupport { +class UserApi(implicit val swagger: Swagger) extends ScalatraServlet + with FileUploadSupport + with JacksonJsonSupport + with SwaggerSupport { protected implicit val jsonFormats: Formats = DefaultFormats protected val applicationDescription: String = "UserApi" - override protected val applicationName: Option[String] = Some("/v2/User") before() { contentType = formats("json") diff --git a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/ApiResponse.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/ApiResponse.scala similarity index 82% rename from samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/ApiResponse.scala rename to samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/ApiResponse.scala index 4998a4996e3..005e2bc2999 100644 --- a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/ApiResponse.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/ApiResponse.scala @@ -10,12 +10,10 @@ * Do not edit the class manually. */ +package io.swagger.server.model -package com.wordnik.client.model - - -case class ApiResponse ( +case class ApiResponse( code: Option[Int], - _type: Option[String], - message: Option[String] -) + _type: Option[String], + message: Option[String] + ) diff --git a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/Category.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Category.scala similarity index 87% rename from samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/Category.scala rename to samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Category.scala index 43b6ba1624e..7d092fa7109 100644 --- a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/Category.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Category.scala @@ -10,11 +10,9 @@ * Do not edit the class manually. */ +package io.swagger.server.model -package com.wordnik.client.model - - -case class Category ( +case class Category( id: Option[Long], - name: Option[String] -) + name: Option[String] + ) diff --git a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/Order.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Order.scala similarity index 79% rename from samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/Order.scala rename to samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Order.scala index a3298b1f5a5..13eaeb08609 100644 --- a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/Order.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Order.scala @@ -10,17 +10,15 @@ * Do not edit the class manually. */ - -package com.wordnik.client.model - +package io.swagger.server.model import java.util.Date -case class Order ( +case class Order( id: Option[Long], - petId: Option[Long], - quantity: Option[Int], - shipDate: Option[Date], + petId: Option[Long], + quantity: Option[Int], + shipDate: Option[Date], /* Order Status */ status: Option[String], - complete: Option[Boolean] -) + complete: Option[Boolean] + ) diff --git a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/Pet.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Pet.scala similarity index 79% rename from samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/Pet.scala rename to samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Pet.scala index ecf56f3b590..4a658da88fc 100644 --- a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/Pet.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Pet.scala @@ -10,16 +10,14 @@ * Do not edit the class manually. */ +package io.swagger.server.model -package com.wordnik.client.model - - -case class Pet ( +case class Pet( id: Option[Long], - category: Option[Category], - name: String, - photoUrls: List[String], - tags: Option[List[Tag]], + category: Option[Category], + name: String, + photoUrls: List[String], + tags: Option[List[Tag]], /* pet status in the store */ status: Option[String] -) + ) diff --git a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/Tag.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Tag.scala similarity index 87% rename from samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/Tag.scala rename to samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Tag.scala index 0e1fb131789..f91b9ca4878 100644 --- a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/Tag.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Tag.scala @@ -10,11 +10,9 @@ * Do not edit the class manually. */ +package io.swagger.server.model -package com.wordnik.client.model - - -case class Tag ( +case class Tag( id: Option[Long], - name: Option[String] -) + name: Option[String] + ) diff --git a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/User.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/User.scala similarity index 72% rename from samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/User.scala rename to samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/User.scala index a2b8ac77250..1065c5492b5 100644 --- a/samples/server/petstore/scalatra/src/main/scala/com/wordnik/client/model/User.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/User.scala @@ -10,18 +10,16 @@ * Do not edit the class manually. */ +package io.swagger.server.model -package com.wordnik.client.model - - -case class User ( +case class User( id: Option[Long], - username: Option[String], - firstName: Option[String], - lastName: Option[String], - email: Option[String], - password: Option[String], - phone: Option[String], + username: Option[String], + firstName: Option[String], + lastName: Option[String], + email: Option[String], + password: Option[String], + phone: Option[String], /* User Status */ userStatus: Option[Int] -) + ) diff --git a/samples/server/petstore/scalatra/src/main/webapp/WEB-INF/web.xml b/samples/server/petstore/scalatra/src/main/webapp/WEB-INF/web.xml index 2a08440458e..bf99b058082 100644 --- a/samples/server/petstore/scalatra/src/main/webapp/WEB-INF/web.xml +++ b/samples/server/petstore/scalatra/src/main/webapp/WEB-INF/web.xml @@ -1,17 +1,16 @@ - + xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee + http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" + version="3.1"> + + org.scalatra.servlet.ScalatraListener - - - default - /*.html - /css/* - /js/*.js - /images/* - From ea8b184931f8f7dbbe616ab8dc2799961410bc5d Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 14 Jan 2018 18:13:25 +0800 Subject: [PATCH 45/65] update circle pom to include scalatra folder --- pom.xml.circleci | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml.circleci b/pom.xml.circleci index fe24e2bfaea..f3547d164c0 100644 --- a/pom.xml.circleci +++ b/pom.xml.circleci @@ -870,6 +870,7 @@ samples/server/petstore/java-msf4j samples/server/petstore/jaxrs-spec-interface samples/server/petstore/scala-lagom-server + samples/server/petstore/scalatra From 66be7a7910e9c2b684d234f36b954b40e68f2a5c Mon Sep 17 00:00:00 2001 From: Tristan Bourvon Date: Sun, 14 Jan 2018 11:18:58 +0100 Subject: [PATCH 46/65] [Rust] Add user agent handling for rust template (master) (#7375) * Add user agent handling for rust template * Run ./bin/rust-petstore.sh --- .../src/main/resources/rust/api.mustache | 7 ++++ .../resources/rust/configuration.mustache | 2 ++ .../petstore/rust/.swagger-codegen/VERSION | 2 +- .../petstore/rust/src/apis/configuration.rs | 2 ++ .../client/petstore/rust/src/apis/pet_api.rs | 35 +++++++++++++++++++ .../petstore/rust/src/apis/store_api.rs | 19 ++++++++++ .../client/petstore/rust/src/apis/user_api.rs | 35 +++++++++++++++++++ 7 files changed, 101 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/rust/api.mustache b/modules/swagger-codegen/src/main/resources/rust/api.mustache index 811f8870448..518908b2aa6 100644 --- a/modules/swagger-codegen/src/main/resources/rust/api.mustache +++ b/modules/swagger-codegen/src/main/resources/rust/api.mustache @@ -1,12 +1,15 @@ {{>partial_header}} use std::rc::Rc; use std::borrow::Borrow; +use std::borrow::Cow; use hyper; use serde_json; use futures; use futures::{Future, Stream}; +use hyper::header::UserAgent; + use super::{Error, configuration}; pub struct {{{classname}}}Client { @@ -57,6 +60,10 @@ impl{{classname}} for {{classname}}Client { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + {{#hasHeaderParams}} { let mut headers = req.headers_mut(); diff --git a/modules/swagger-codegen/src/main/resources/rust/configuration.mustache b/modules/swagger-codegen/src/main/resources/rust/configuration.mustache index 59e82af56b1..52b402c5f7d 100644 --- a/modules/swagger-codegen/src/main/resources/rust/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/rust/configuration.mustache @@ -3,6 +3,7 @@ use hyper; pub struct Configuration { pub base_path: String, + pub user_agent: Option, pub client: hyper::client::Client, } @@ -10,6 +11,7 @@ impl Configuration { pub fn new(client: hyper::client::Client) -> Configuration { Configuration { base_path: "{{{basePath}}}".to_owned(), + user_agent: {{#httpUserAgent}}Some("{{{.}}}".to_owned()){{/httpUserAgent}}{{^httpUserAgent}}None{{/httpUserAgent}}, client: client, } } diff --git a/samples/client/petstore/rust/.swagger-codegen/VERSION b/samples/client/petstore/rust/.swagger-codegen/VERSION index f9f7450d135..50794f17f1a 100644 --- a/samples/client/petstore/rust/.swagger-codegen/VERSION +++ b/samples/client/petstore/rust/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/src/apis/configuration.rs b/samples/client/petstore/rust/src/apis/configuration.rs index 9ea9213594e..9446c8fbdd3 100644 --- a/samples/client/petstore/rust/src/apis/configuration.rs +++ b/samples/client/petstore/rust/src/apis/configuration.rs @@ -12,6 +12,7 @@ use hyper; pub struct Configuration { pub base_path: String, + pub user_agent: Option, pub client: hyper::client::Client, } @@ -19,6 +20,7 @@ impl Configuration { pub fn new(client: hyper::client::Client) -> Configuration { Configuration { base_path: "http://petstore.swagger.io/v2".to_owned(), + user_agent: None, client: client, } } diff --git a/samples/client/petstore/rust/src/apis/pet_api.rs b/samples/client/petstore/rust/src/apis/pet_api.rs index 246f7b0ed13..081ff02a618 100644 --- a/samples/client/petstore/rust/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/src/apis/pet_api.rs @@ -10,12 +10,15 @@ use std::rc::Rc; use std::borrow::Borrow; +use std::borrow::Cow; use hyper; use serde_json; use futures; use futures::{Future, Stream}; +use hyper::header::UserAgent; + use super::{Error, configuration}; pub struct PetApiClient { @@ -57,6 +60,10 @@ implPetApi for PetApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + let serialized = serde_json::to_string(&body).unwrap(); req.headers_mut().set(hyper::header::ContentType::json()); @@ -85,6 +92,10 @@ implPetApi for PetApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + { let mut headers = req.headers_mut(); headers.set_raw("api_key", api_key); @@ -116,6 +127,10 @@ implPetApi for PetApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + // send request @@ -146,6 +161,10 @@ implPetApi for PetApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + // send request @@ -173,6 +192,10 @@ implPetApi for PetApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + // send request @@ -200,6 +223,10 @@ implPetApi for PetApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + let serialized = serde_json::to_string(&body).unwrap(); req.headers_mut().set(hyper::header::ContentType::json()); @@ -228,6 +255,10 @@ implPetApi for PetApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + // send request @@ -252,6 +283,10 @@ implPetApi for PetApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + // send request diff --git a/samples/client/petstore/rust/src/apis/store_api.rs b/samples/client/petstore/rust/src/apis/store_api.rs index fbae7a25883..5f493f2961a 100644 --- a/samples/client/petstore/rust/src/apis/store_api.rs +++ b/samples/client/petstore/rust/src/apis/store_api.rs @@ -10,12 +10,15 @@ use std::rc::Rc; use std::borrow::Borrow; +use std::borrow::Cow; use hyper; use serde_json; use futures; use futures::{Future, Stream}; +use hyper::header::UserAgent; + use super::{Error, configuration}; pub struct StoreApiClient { @@ -53,6 +56,10 @@ implStoreApi for StoreApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + // send request @@ -77,6 +84,10 @@ implStoreApi for StoreApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + // send request @@ -104,6 +115,10 @@ implStoreApi for StoreApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + // send request @@ -131,6 +146,10 @@ implStoreApi for StoreApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + let serialized = serde_json::to_string(&body).unwrap(); req.headers_mut().set(hyper::header::ContentType::json()); diff --git a/samples/client/petstore/rust/src/apis/user_api.rs b/samples/client/petstore/rust/src/apis/user_api.rs index 6a96c86d5c2..71a35e49b26 100644 --- a/samples/client/petstore/rust/src/apis/user_api.rs +++ b/samples/client/petstore/rust/src/apis/user_api.rs @@ -10,12 +10,15 @@ use std::rc::Rc; use std::borrow::Borrow; +use std::borrow::Cow; use hyper; use serde_json; use futures; use futures::{Future, Stream}; +use hyper::header::UserAgent; + use super::{Error, configuration}; pub struct UserApiClient { @@ -57,6 +60,10 @@ implUserApi for UserApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + let serialized = serde_json::to_string(&body).unwrap(); req.headers_mut().set(hyper::header::ContentType::json()); @@ -85,6 +92,10 @@ implUserApi for UserApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + let serialized = serde_json::to_string(&body).unwrap(); req.headers_mut().set(hyper::header::ContentType::json()); @@ -113,6 +124,10 @@ implUserApi for UserApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + let serialized = serde_json::to_string(&body).unwrap(); req.headers_mut().set(hyper::header::ContentType::json()); @@ -141,6 +156,10 @@ implUserApi for UserApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + // send request @@ -165,6 +184,10 @@ implUserApi for UserApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + // send request @@ -196,6 +219,10 @@ implUserApi for UserApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + // send request @@ -223,6 +250,10 @@ implUserApi for UserApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + // send request @@ -247,6 +278,10 @@ implUserApi for UserApiClient { // } let mut req = hyper::Request::new(method, uri.unwrap()); + if let Some(ref user_agent) = configuration.user_agent { + req.headers_mut().set(UserAgent::new(Cow::Owned(user_agent.clone()))); + } + let serialized = serde_json::to_string(&body).unwrap(); req.headers_mut().set(hyper::header::ContentType::json()); From 44853c31b684fc71fbc82e9bacd0c06ef4a948b0 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sun, 14 Jan 2018 18:25:04 +0800 Subject: [PATCH 47/65] update rust default user agent to promote swagger codegen --- .../src/main/resources/rust/configuration.mustache | 2 +- samples/client/petstore/rust/.swagger-codegen/VERSION | 2 +- samples/client/petstore/rust/src/apis/configuration.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/rust/configuration.mustache b/modules/swagger-codegen/src/main/resources/rust/configuration.mustache index 52b402c5f7d..c555c665860 100644 --- a/modules/swagger-codegen/src/main/resources/rust/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/rust/configuration.mustache @@ -11,7 +11,7 @@ impl Configuration { pub fn new(client: hyper::client::Client) -> Configuration { Configuration { base_path: "{{{basePath}}}".to_owned(), - user_agent: {{#httpUserAgent}}Some("{{{.}}}".to_owned()){{/httpUserAgent}}{{^httpUserAgent}}None{{/httpUserAgent}}, + user_agent: {{#httpUserAgent}}Some("{{{.}}}".to_owned()){{/httpUserAgent}}{{^httpUserAgent}}Some("Swagger-Codegen/{{version}}/rust".to_owned()){{/httpUserAgent}}, client: client, } } diff --git a/samples/client/petstore/rust/.swagger-codegen/VERSION b/samples/client/petstore/rust/.swagger-codegen/VERSION index 50794f17f1a..855ff9501eb 100644 --- a/samples/client/petstore/rust/.swagger-codegen/VERSION +++ b/samples/client/petstore/rust/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +2.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/src/apis/configuration.rs b/samples/client/petstore/rust/src/apis/configuration.rs index 9446c8fbdd3..a5d8db713f0 100644 --- a/samples/client/petstore/rust/src/apis/configuration.rs +++ b/samples/client/petstore/rust/src/apis/configuration.rs @@ -20,7 +20,7 @@ impl Configuration { pub fn new(client: hyper::client::Client) -> Configuration { Configuration { base_path: "http://petstore.swagger.io/v2".to_owned(), - user_agent: None, + user_agent: Some("Swagger-Codegen/1.0.0/rust".to_owned()), client: client, } } From 3bd2da9a8b561b775bc470e1c588a8c547e587f7 Mon Sep 17 00:00:00 2001 From: Reijhanniel Jearl Campos Date: Sun, 14 Jan 2018 21:13:56 +0800 Subject: [PATCH 48/65] [Java] #3204 - Fix build warnings (#7364) * [Java] #3024 - Add build-helper-maven-plugin version to retrofit client template * [Java] #3024 - Add build-helper-maven-plugin version to feign client template * [Java] #3024 - Add build-helper-maven-plugin version to jersey client template * [Java] #3024 - Add build-helper-maven-plugin version to resteasy client template --- .../Java/libraries/feign/pom.mustache | 1 + .../Java/libraries/jersey2/pom.mustache | 1 + .../Java/libraries/resteasy/pom.mustache | 1 + .../Java/libraries/retrofit/pom.mustache | 1 + samples/client/petstore/java/feign/pom.xml | 1 + .../petstore/java/jersey2-java6/pom.xml | 139 ++++++------- .../petstore/java/jersey2-java8/pom.xml | 138 ++++++------- samples/client/petstore/java/jersey2/pom.xml | 138 ++++++------- samples/client/petstore/java/resteasy/pom.xml | 182 +++++++++--------- samples/client/petstore/java/retrofit/pom.xml | 137 ++++++------- 10 files changed, 381 insertions(+), 358 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache index 49965181d7b..397d137c95e 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache @@ -104,6 +104,7 @@ org.codehaus.mojo build-helper-maven-plugin + 1.10 add_sources diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache index 02677980e09..99e77acb86a 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -104,6 +104,7 @@ org.codehaus.mojo build-helper-maven-plugin + 1.10 add_sources diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/pom.mustache index d06d96919c6..dffd36c3b34 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/pom.mustache @@ -85,6 +85,7 @@ org.codehaus.mojo build-helper-maven-plugin + 1.10 add_sources diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache index cbb4e298fb5..b287eb2445d 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache @@ -104,6 +104,7 @@ org.codehaus.mojo build-helper-maven-plugin + 1.10 add_sources diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index c363308fa3b..b7e5cc7f294 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -104,6 +104,7 @@ org.codehaus.mojo build-helper-maven-plugin + 1.10 add_sources diff --git a/samples/client/petstore/java/jersey2-java6/pom.xml b/samples/client/petstore/java/jersey2-java6/pom.xml index 722fac22117..66067949ca8 100644 --- a/samples/client/petstore/java/jersey2-java6/pom.xml +++ b/samples/client/petstore/java/jersey2-java6/pom.xml @@ -83,74 +83,77 @@ - - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index 2e0dc20ad8f..553e5bd1cf5 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -84,73 +84,77 @@ - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + diff --git a/samples/client/petstore/java/jersey2/pom.xml b/samples/client/petstore/java/jersey2/pom.xml index 3f5bfd600cd..b3f370e786e 100644 --- a/samples/client/petstore/java/jersey2/pom.xml +++ b/samples/client/petstore/java/jersey2/pom.xml @@ -84,73 +84,77 @@ - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + diff --git a/samples/client/petstore/java/resteasy/pom.xml b/samples/client/petstore/java/resteasy/pom.xml index 192abc5c553..5dfaf67a675 100644 --- a/samples/client/petstore/java/resteasy/pom.xml +++ b/samples/client/petstore/java/resteasy/pom.xml @@ -65,95 +65,99 @@ - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.5.1 - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - - org.jboss.resteasy - resteasy-client - ${resteasy-version} - - - org.jboss.resteasy - resteasy-multipart-provider - ${resteasy-version} - - - - com.fasterxml.jackson.core - jackson-core - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-version} - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - - - joda-time - joda-time - ${jodatime-version} - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.5.1 + + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + + org.jboss.resteasy + resteasy-client + ${resteasy-version} + + + org.jboss.resteasy + resteasy-multipart-provider + ${resteasy-version} + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + joda-time + joda-time + ${jodatime-version} + diff --git a/samples/client/petstore/java/retrofit/pom.xml b/samples/client/petstore/java/retrofit/pom.xml index ffb62b3f28f..91714198b81 100644 --- a/samples/client/petstore/java/retrofit/pom.xml +++ b/samples/client/petstore/java/retrofit/pom.xml @@ -84,73 +84,76 @@ - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + From 72221b1cf9469c8f515f126779201b73d05e890c Mon Sep 17 00:00:00 2001 From: Carl E Leiby Date: Thu, 11 Jan 2018 15:19:36 -0500 Subject: [PATCH 49/65] Adding @Deprecated to retrofit2 client interfaces. --- .../main/resources/Java/libraries/retrofit2/api.mustache | 6 ++++++ 1 file changed, 6 insertions(+) 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 d19c634e29d..c040bd263e3 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 @@ -36,11 +36,17 @@ public interface {{classname}} { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} * @return Call<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object{{/returnType}}> +{{#isDeprecated}} + * @deprecated +{{/isDeprecated}} {{#externalDocs}} * {{description}} * @see {{summary}} Documentation {{/externalDocs}} */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} {{#formParams}} {{#-first}} {{#isMultipart}}@retrofit2.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit2.http.FormUrlEncoded{{/isMultipart}} From 25a127240ace0d2e46469f861f270423b2b61461 Mon Sep 17 00:00:00 2001 From: Carl E Leiby Date: Thu, 11 Jan 2018 15:51:58 -0500 Subject: [PATCH 50/65] Generated retrofit2 petstore files --- .../retrofit2/src/main/java/io/swagger/client/api/PetApi.java | 2 ++ .../retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java | 2 ++ .../src/main/java/io/swagger/client/api/PetApi.java | 2 ++ 3 files changed, 6 insertions(+) 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 8d48189ce93..768a27f23aa 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 @@ -60,7 +60,9 @@ Call> findPetsByStatus( * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) * @return Call<List<Pet>> + * @deprecated */ + @Deprecated @GET("pet/findByTags") Call> findPetsByTags( @retrofit2.http.Query("tags") CSVParams tags 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 4f848e7d69f..ac1fa2082e9 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 @@ -60,7 +60,9 @@ Observable> findPetsByStatus( * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) * @return Call<List<Pet>> + * @deprecated */ + @Deprecated @GET("pet/findByTags") Observable> findPetsByTags( @retrofit2.http.Query("tags") CSVParams tags diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/PetApi.java index e3c9fbf2581..75b58c122cc 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/PetApi.java @@ -60,7 +60,9 @@ Observable> findPetsByStatus( * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) * @return Call<List<Pet>> + * @deprecated */ + @Deprecated @GET("pet/findByTags") Observable> findPetsByTags( @retrofit2.http.Query("tags") CSVParams tags From 027df610b1b2035cb2af0a9c22244b92763f131f Mon Sep 17 00:00:00 2001 From: Euan Kemp Date: Sun, 14 Jan 2018 19:38:11 -0800 Subject: [PATCH 51/65] [Rust] Handle error response statuses (#6865) * [Rust] Consider error statuscodes to be errors * [Rust] Introduce 'ApiError' type for 4xx/5xx resp This updates the previous commit which added an 'ErrorStatus' variant to an 'ApiError' variant. It does not specialize the error to the specific possible error responses yet, rather returning a 'serde_json::Value' for any case. This will lose any error messages which cannot be parsed as json and instead return a json-parse error. A future change should update the generated signatures such that the returned future's error type is specialized to the specific errors that may be returned by that api (and possibly a catchall json::Value still). * [Rust] Regenerate petstore samples * [Rust] Add error example to petstore sample --- .../src/main/resources/rust/api.mustache | 21 ++- .../src/main/resources/rust/api_mod.mustache | 35 +++- .../src/main/resources/rust/lib.rs | 1 + .../petstore/rust/examples/error_handling.rs | 49 ++++++ samples/client/petstore/rust/src/apis/mod.rs | 35 +++- .../client/petstore/rust/src/apis/pet_api.rs | 160 +++++++++++++++--- .../petstore/rust/src/apis/store_api.rs | 82 +++++++-- .../client/petstore/rust/src/apis/user_api.rs | 156 ++++++++++++++--- samples/client/petstore/rust/src/lib.rs | 1 + .../rust-server/.swagger-codegen/VERSION | 2 +- samples/server/petstore/rust-server/README.md | 2 +- .../petstore/rust-server/api/swagger.yaml | 8 +- 12 files changed, 467 insertions(+), 85 deletions(-) create mode 100644 samples/client/petstore/rust/examples/error_handling.rs diff --git a/modules/swagger-codegen/src/main/resources/rust/api.mustache b/modules/swagger-codegen/src/main/resources/rust/api.mustache index 518908b2aa6..ad9b3f26533 100644 --- a/modules/swagger-codegen/src/main/resources/rust/api.mustache +++ b/modules/swagger-codegen/src/main/resources/rust/api.mustache @@ -27,7 +27,7 @@ impl {{{classname}}}Client { pub trait {{classname}} { {{#operations}} {{#operation}} - fn {{{operationId}}}(&self, {{#allParams}}{{paramName}}: {{#isString}}&str{{/isString}}{{^isString}}{{^isPrimitiveType}}{{^isContainer}}::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isString}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> Box>; + fn {{{operationId}}}(&self, {{#allParams}}{{paramName}}: {{#isString}}&str{{/isString}}{{^isString}}{{^isPrimitiveType}}{{^isContainer}}::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isString}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> Box>>; {{/operation}} {{/operations}} } @@ -36,7 +36,7 @@ pub trait {{classname}} { impl{{classname}} for {{classname}}Client { {{#operations}} {{#operation}} - fn {{{operationId}}}(&self, {{#allParams}}{{paramName}}: {{#isString}}&str{{/isString}}{{^isString}}{{^isPrimitiveType}}{{^isContainer}}::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isString}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> Box> { + fn {{{operationId}}}(&self, {{#allParams}}{{paramName}}: {{#isString}}&str{{/isString}}{{^isString}}{{^isPrimitiveType}}{{^isContainer}}::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isString}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::{{httpMethod}}; @@ -84,8 +84,21 @@ impl{{classname}} for {{classname}}Client { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) {{^returnType}} .and_then(|_| futures::future::ok(())) {{/returnType}} @@ -93,7 +106,7 @@ impl{{classname}} for {{classname}}Client { .and_then(|body| { let parsed: Result<{{{returnType}}}, _> = serde_json::from_slice(&body); parsed.map_err(|e| Error::from(e)) - }).map_err(|e| Error::from(e)) + }) {{/returnType}} ) } diff --git a/modules/swagger-codegen/src/main/resources/rust/api_mod.mustache b/modules/swagger-codegen/src/main/resources/rust/api_mod.mustache index 5b62b897cdd..5c8f6b86a4d 100644 --- a/modules/swagger-codegen/src/main/resources/rust/api_mod.mustache +++ b/modules/swagger-codegen/src/main/resources/rust/api_mod.mustache @@ -1,19 +1,48 @@ use hyper; +use serde; use serde_json; #[derive(Debug)] -pub enum Error { +pub enum Error { Hyper(hyper::Error), Serde(serde_json::Error), + ApiError(ApiError), } -impl From for Error { +#[derive(Debug)] +pub struct ApiError { + pub code: hyper::StatusCode, + pub content: Option, +} + +impl<'de, T> From<(hyper::StatusCode, &'de [u8])> for Error + where T: serde::Deserialize<'de> { + fn from(e: (hyper::StatusCode, &'de [u8])) -> Self { + if e.1.len() == 0 { + return Error::ApiError(ApiError{ + code: e.0, + content: None, + }); + } + match serde_json::from_slice::(e.1) { + Ok(t) => Error::ApiError(ApiError{ + code: e.0, + content: Some(t), + }), + Err(e) => { + Error::from(e) + } + } + } +} + +impl From for Error { fn from(e: hyper::Error) -> Self { return Error::Hyper(e) } } -impl From for Error { +impl From for Error { fn from(e: serde_json::Error) -> Self { return Error::Serde(e) } diff --git a/modules/swagger-codegen/src/main/resources/rust/lib.rs b/modules/swagger-codegen/src/main/resources/rust/lib.rs index 2ad195c6fb1..b51fea8150e 100644 --- a/modules/swagger-codegen/src/main/resources/rust/lib.rs +++ b/modules/swagger-codegen/src/main/resources/rust/lib.rs @@ -2,6 +2,7 @@ extern crate serde_derive; extern crate hyper; +extern crate serde; extern crate serde_json; extern crate futures; extern crate url; diff --git a/samples/client/petstore/rust/examples/error_handling.rs b/samples/client/petstore/rust/examples/error_handling.rs new file mode 100644 index 00000000000..cb3a91d2833 --- /dev/null +++ b/samples/client/petstore/rust/examples/error_handling.rs @@ -0,0 +1,49 @@ +extern crate futures; +extern crate hyper; +extern crate petstore_client; +extern crate tokio_core; + +use hyper::Client; +use hyper::client::HttpConnector; +use tokio_core::reactor::Core; +use futures::Future; +use petstore_client::apis::client::APIClient; +use petstore_client::apis::Error; + +fn main() { + let mut core = Core::new().expect("failed to init core"); + let handle = core.handle(); + + let mut configuration = petstore_client::apis::configuration::Configuration::new( + Client::configure() + .connector(HttpConnector::new(4, &handle)) + .build(&handle), + ); + if let Ok(env_override) = std::env::var("PETSTORE_BASEPATH") { + configuration.base_path = env_override; + } + + let apicli = APIClient::new(configuration); + let work = apicli + .user_api() + .delete_user("404") + .then(|resp| match resp { + Ok(resp) => { + panic!(format!( + "update for nonexistent pet should fail, but got: {:?}", + resp + )); + } + Err(Error::ApiError(s)) => { + println!("got expected error: {:?}", s); + futures::future::ok::<(), ()>(()) + } + Err(Error::Hyper(e)) => { + println!("network error: {}", e); + futures::future::ok::<(), ()>(()) + } + Err(e) => panic!("unexpected error: {:?}", e), + }); + + core.run(work).expect("failed to run core"); +} diff --git a/samples/client/petstore/rust/src/apis/mod.rs b/samples/client/petstore/rust/src/apis/mod.rs index ebd01fe651a..7199222c3f7 100644 --- a/samples/client/petstore/rust/src/apis/mod.rs +++ b/samples/client/petstore/rust/src/apis/mod.rs @@ -1,19 +1,48 @@ use hyper; +use serde; use serde_json; #[derive(Debug)] -pub enum Error { +pub enum Error { Hyper(hyper::Error), Serde(serde_json::Error), + ApiError(ApiError), } -impl From for Error { +#[derive(Debug)] +pub struct ApiError { + pub code: hyper::StatusCode, + pub content: Option, +} + +impl<'de, T> From<(hyper::StatusCode, &'de [u8])> for Error + where T: serde::Deserialize<'de> { + fn from(e: (hyper::StatusCode, &'de [u8])) -> Self { + if e.1.len() == 0 { + return Error::ApiError(ApiError{ + code: e.0, + content: None, + }); + } + match serde_json::from_slice::(e.1) { + Ok(t) => Error::ApiError(ApiError{ + code: e.0, + content: Some(t), + }), + Err(e) => { + Error::from(e) + } + } + } +} + +impl From for Error { fn from(e: hyper::Error) -> Self { return Error::Hyper(e) } } -impl From for Error { +impl From for Error { fn from(e: serde_json::Error) -> Self { return Error::Serde(e) } diff --git a/samples/client/petstore/rust/src/apis/pet_api.rs b/samples/client/petstore/rust/src/apis/pet_api.rs index 081ff02a618..315ffeec112 100644 --- a/samples/client/petstore/rust/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/src/apis/pet_api.rs @@ -34,19 +34,19 @@ impl PetApiClient { } pub trait PetApi { - fn add_pet(&self, body: ::models::Pet) -> Box>; - fn delete_pet(&self, pet_id: i64, api_key: &str) -> Box>; - fn find_pets_by_status(&self, status: Vec) -> Box, Error = Error>>; - fn find_pets_by_tags(&self, tags: Vec) -> Box, Error = Error>>; - fn get_pet_by_id(&self, pet_id: i64) -> Box>; - fn update_pet(&self, body: ::models::Pet) -> Box>; - fn update_pet_with_form(&self, pet_id: i64, name: &str, status: &str) -> Box>; - fn upload_file(&self, pet_id: i64, additional_metadata: &str, file: ::models::File) -> Box>; + fn add_pet(&self, body: ::models::Pet) -> Box>>; + fn delete_pet(&self, pet_id: i64, api_key: &str) -> Box>>; + fn find_pets_by_status(&self, status: Vec) -> Box, Error = Error>>; + fn find_pets_by_tags(&self, tags: Vec) -> Box, Error = Error>>; + fn get_pet_by_id(&self, pet_id: i64) -> Box>>; + fn update_pet(&self, body: ::models::Pet) -> Box>>; + fn update_pet_with_form(&self, pet_id: i64, name: &str, status: &str) -> Box>>; + fn upload_file(&self, pet_id: i64, additional_metadata: &str, file: ::models::File) -> Box>>; } implPetApi for PetApiClient { - fn add_pet(&self, body: ::models::Pet) -> Box> { + fn add_pet(&self, body: ::models::Pet) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Post; @@ -72,13 +72,26 @@ implPetApi for PetApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|_| futures::future::ok(())) ) } - fn delete_pet(&self, pet_id: i64, api_key: &str) -> Box> { + fn delete_pet(&self, pet_id: i64, api_key: &str) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Delete; @@ -104,13 +117,26 @@ implPetApi for PetApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|_| futures::future::ok(())) ) } - fn find_pets_by_status(&self, status: Vec) -> Box, Error = Error>> { + fn find_pets_by_status(&self, status: Vec) -> Box, Error = Error>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Get; @@ -135,16 +161,29 @@ implPetApi for PetApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|body| { let parsed: Result, _> = serde_json::from_slice(&body); parsed.map_err(|e| Error::from(e)) - }).map_err(|e| Error::from(e)) + }) ) } - fn find_pets_by_tags(&self, tags: Vec) -> Box, Error = Error>> { + fn find_pets_by_tags(&self, tags: Vec) -> Box, Error = Error>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Get; @@ -169,16 +208,29 @@ implPetApi for PetApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|body| { let parsed: Result, _> = serde_json::from_slice(&body); parsed.map_err(|e| Error::from(e)) - }).map_err(|e| Error::from(e)) + }) ) } - fn get_pet_by_id(&self, pet_id: i64) -> Box> { + fn get_pet_by_id(&self, pet_id: i64) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Get; @@ -200,16 +252,29 @@ implPetApi for PetApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|body| { let parsed: Result<::models::Pet, _> = serde_json::from_slice(&body); parsed.map_err(|e| Error::from(e)) - }).map_err(|e| Error::from(e)) + }) ) } - fn update_pet(&self, body: ::models::Pet) -> Box> { + fn update_pet(&self, body: ::models::Pet) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Put; @@ -235,13 +300,26 @@ implPetApi for PetApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|_| futures::future::ok(())) ) } - fn update_pet_with_form(&self, pet_id: i64, name: &str, status: &str) -> Box> { + fn update_pet_with_form(&self, pet_id: i64, name: &str, status: &str) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Post; @@ -263,13 +341,26 @@ implPetApi for PetApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|_| futures::future::ok(())) ) } - fn upload_file(&self, pet_id: i64, additional_metadata: &str, file: ::models::File) -> Box> { + fn upload_file(&self, pet_id: i64, additional_metadata: &str, file: ::models::File) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Post; @@ -291,12 +382,25 @@ implPetApi for PetApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|body| { let parsed: Result<::models::ApiResponse, _> = serde_json::from_slice(&body); parsed.map_err(|e| Error::from(e)) - }).map_err(|e| Error::from(e)) + }) ) } diff --git a/samples/client/petstore/rust/src/apis/store_api.rs b/samples/client/petstore/rust/src/apis/store_api.rs index 5f493f2961a..fe3c1d325c7 100644 --- a/samples/client/petstore/rust/src/apis/store_api.rs +++ b/samples/client/petstore/rust/src/apis/store_api.rs @@ -34,15 +34,15 @@ impl StoreApiClient { } pub trait StoreApi { - fn delete_order(&self, order_id: &str) -> Box>; - fn get_inventory(&self, ) -> Box, Error = Error>>; - fn get_order_by_id(&self, order_id: i64) -> Box>; - fn place_order(&self, body: ::models::Order) -> Box>; + fn delete_order(&self, order_id: &str) -> Box>>; + fn get_inventory(&self, ) -> Box, Error = Error>>; + fn get_order_by_id(&self, order_id: i64) -> Box>>; + fn place_order(&self, body: ::models::Order) -> Box>>; } implStoreApi for StoreApiClient { - fn delete_order(&self, order_id: &str) -> Box> { + fn delete_order(&self, order_id: &str) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Delete; @@ -64,13 +64,26 @@ implStoreApi for StoreApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|_| futures::future::ok(())) ) } - fn get_inventory(&self, ) -> Box, Error = Error>> { + fn get_inventory(&self, ) -> Box, Error = Error>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Get; @@ -92,16 +105,29 @@ implStoreApi for StoreApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|body| { let parsed: Result<::std::collections::HashMap, _> = serde_json::from_slice(&body); parsed.map_err(|e| Error::from(e)) - }).map_err(|e| Error::from(e)) + }) ) } - fn get_order_by_id(&self, order_id: i64) -> Box> { + fn get_order_by_id(&self, order_id: i64) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Get; @@ -123,16 +149,29 @@ implStoreApi for StoreApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|body| { let parsed: Result<::models::Order, _> = serde_json::from_slice(&body); parsed.map_err(|e| Error::from(e)) - }).map_err(|e| Error::from(e)) + }) ) } - fn place_order(&self, body: ::models::Order) -> Box> { + fn place_order(&self, body: ::models::Order) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Post; @@ -158,12 +197,25 @@ implStoreApi for StoreApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|body| { let parsed: Result<::models::Order, _> = serde_json::from_slice(&body); parsed.map_err(|e| Error::from(e)) - }).map_err(|e| Error::from(e)) + }) ) } diff --git a/samples/client/petstore/rust/src/apis/user_api.rs b/samples/client/petstore/rust/src/apis/user_api.rs index 71a35e49b26..c3c9f7d457e 100644 --- a/samples/client/petstore/rust/src/apis/user_api.rs +++ b/samples/client/petstore/rust/src/apis/user_api.rs @@ -34,19 +34,19 @@ impl UserApiClient { } pub trait UserApi { - fn create_user(&self, body: ::models::User) -> Box>; - fn create_users_with_array_input(&self, body: Vec<::models::User>) -> Box>; - fn create_users_with_list_input(&self, body: Vec<::models::User>) -> Box>; - fn delete_user(&self, username: &str) -> Box>; - fn get_user_by_name(&self, username: &str) -> Box>; - fn login_user(&self, username: &str, password: &str) -> Box>; - fn logout_user(&self, ) -> Box>; - fn update_user(&self, username: &str, body: ::models::User) -> Box>; + fn create_user(&self, body: ::models::User) -> Box>>; + fn create_users_with_array_input(&self, body: Vec<::models::User>) -> Box>>; + fn create_users_with_list_input(&self, body: Vec<::models::User>) -> Box>>; + fn delete_user(&self, username: &str) -> Box>>; + fn get_user_by_name(&self, username: &str) -> Box>>; + fn login_user(&self, username: &str, password: &str) -> Box>>; + fn logout_user(&self, ) -> Box>>; + fn update_user(&self, username: &str, body: ::models::User) -> Box>>; } implUserApi for UserApiClient { - fn create_user(&self, body: ::models::User) -> Box> { + fn create_user(&self, body: ::models::User) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Post; @@ -72,13 +72,26 @@ implUserApi for UserApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|_| futures::future::ok(())) ) } - fn create_users_with_array_input(&self, body: Vec<::models::User>) -> Box> { + fn create_users_with_array_input(&self, body: Vec<::models::User>) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Post; @@ -104,13 +117,26 @@ implUserApi for UserApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|_| futures::future::ok(())) ) } - fn create_users_with_list_input(&self, body: Vec<::models::User>) -> Box> { + fn create_users_with_list_input(&self, body: Vec<::models::User>) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Post; @@ -136,13 +162,26 @@ implUserApi for UserApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|_| futures::future::ok(())) ) } - fn delete_user(&self, username: &str) -> Box> { + fn delete_user(&self, username: &str) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Delete; @@ -164,13 +203,26 @@ implUserApi for UserApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|_| futures::future::ok(())) ) } - fn get_user_by_name(&self, username: &str) -> Box> { + fn get_user_by_name(&self, username: &str) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Get; @@ -192,16 +244,29 @@ implUserApi for UserApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|body| { let parsed: Result<::models::User, _> = serde_json::from_slice(&body); parsed.map_err(|e| Error::from(e)) - }).map_err(|e| Error::from(e)) + }) ) } - fn login_user(&self, username: &str, password: &str) -> Box> { + fn login_user(&self, username: &str, password: &str) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Get; @@ -227,16 +292,29 @@ implUserApi for UserApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|body| { let parsed: Result = serde_json::from_slice(&body); parsed.map_err(|e| Error::from(e)) - }).map_err(|e| Error::from(e)) + }) ) } - fn logout_user(&self, ) -> Box> { + fn logout_user(&self, ) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Get; @@ -258,13 +336,26 @@ implUserApi for UserApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|_| futures::future::ok(())) ) } - fn update_user(&self, username: &str, body: ::models::User) -> Box> { + fn update_user(&self, username: &str, body: ::models::User) -> Box>> { let configuration: &configuration::Configuration = self.configuration.borrow(); let method = hyper::Method::Put; @@ -290,8 +381,21 @@ implUserApi for UserApiClient { // send request Box::new( - configuration.client.request(req).and_then(|res| { res.body().concat2() }) + configuration.client.request(req) .map_err(|e| Error::from(e)) + .and_then(|resp| { + let status = resp.status(); + resp.body().concat2() + .and_then(move |body| Ok((status, body))) + .map_err(|e| Error::from(e)) + }) + .and_then(|(status, body)| { + if status.is_success() { + Ok(body) + } else { + Err(Error::from((status, &*body))) + } + }) .and_then(|_| futures::future::ok(())) ) } diff --git a/samples/client/petstore/rust/src/lib.rs b/samples/client/petstore/rust/src/lib.rs index 2ad195c6fb1..b51fea8150e 100644 --- a/samples/client/petstore/rust/src/lib.rs +++ b/samples/client/petstore/rust/src/lib.rs @@ -2,6 +2,7 @@ extern crate serde_derive; extern crate hyper; +extern crate serde; extern crate serde_json; extern crate futures; extern crate url; diff --git a/samples/server/petstore/rust-server/.swagger-codegen/VERSION b/samples/server/petstore/rust-server/.swagger-codegen/VERSION index f9f7450d135..cc6612c36e0 100644 --- a/samples/server/petstore/rust-server/.swagger-codegen/VERSION +++ b/samples/server/petstore/rust-server/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.0 \ No newline at end of file diff --git a/samples/server/petstore/rust-server/README.md b/samples/server/petstore/rust-server/README.md index 09fa6742f17..f8bdb0ab4d1 100644 --- a/samples/server/petstore/rust-server/README.md +++ b/samples/server/petstore/rust-server/README.md @@ -13,7 +13,7 @@ To see how to make this your own, look here: [README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) - API version: 1.0.0 -- Build date: 2017-12-20T15:51:59.221+09:00 +- Build date: 2018-01-07T09:31:52.377-08:00 This autogenerated project defines an API crate `petstore_api` which contains: * An `Api` trait defining the API in Rust. diff --git a/samples/server/petstore/rust-server/api/swagger.yaml b/samples/server/petstore/rust-server/api/swagger.yaml index a9b80a7cef3..128267b767d 100644 --- a/samples/server/petstore/rust-server/api/swagger.yaml +++ b/samples/server/petstore/rust-server/api/swagger.yaml @@ -143,11 +143,11 @@ paths: type: "array" items: type: "string" + default: "available" enum: - "available" - "pending" - "sold" - default: "available" collectionFormat: "csv" formatString: "{:?}" example: "&Vec::new()" @@ -938,10 +938,10 @@ paths: type: "array" items: type: "string" + default: "$" enum: - ">" - "$" - default: "$" formatString: "{:?}" example: "Some(&Vec::new())" - name: "enum_form_string" @@ -963,10 +963,10 @@ paths: type: "array" items: type: "string" + default: "$" enum: - ">" - "$" - default: "$" formatString: "{:?}" example: "Some(&Vec::new())" - name: "enum_header_string" @@ -988,10 +988,10 @@ paths: type: "array" items: type: "string" + default: "$" enum: - ">" - "$" - default: "$" formatString: "{:?}" example: "Some(&Vec::new())" - name: "enum_query_string" From 612cfb7af4b5a4e9bd1126f3ecda650ea07f7aa3 Mon Sep 17 00:00:00 2001 From: Jinkui Shi Date: Mon, 15 Jan 2018 14:14:10 +0800 Subject: [PATCH 52/65] [Akka-scala] Clean unused dependencies such swagger-core #7329 (#7329) --- .../resources/akka-scala/build.sbt.mustache | 3 +- .../main/resources/akka-scala/pom.mustache | 99 ++++++++----------- samples/client/petstore/akka-scala/build.sbt | 3 +- samples/client/petstore/akka-scala/pom.xml | 99 ++++++++----------- 4 files changed, 86 insertions(+), 118 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/akka-scala/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/akka-scala/build.sbt.mustache index 30510f4da30..971bc97364b 100644 --- a/modules/swagger-codegen/src/main/resources/akka-scala/build.sbt.mustache +++ b/modules/swagger-codegen/src/main/resources/akka-scala/build.sbt.mustache @@ -4,13 +4,12 @@ organization := "{{groupId}}" scalaVersion := "2.11.12" libraryDependencies ++= Seq( - "io.swagger" % "swagger-core" % "1.5.15", "com.typesafe" % "config" % "1.3.2", "com.typesafe.akka" %% "akka-actor" % "2.5.8", "io.spray" % "spray-client" % "1.3.1", "joda-time" % "joda-time" % "2.9.9", - "org.joda" % "joda-convert" % "1.9.2", "org.json4s" %% "json4s-jackson" % "3.5.3", + // test dependencies "org.scalatest" %% "scalatest" % "3.0.4" % "test", "junit" % "junit" % "4.12" % "test" ) diff --git a/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache b/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache index da8f9d9043f..0cc69bdc424 100644 --- a/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/akka-scala/pom.mustache @@ -13,90 +13,86 @@ UTF-8 UTF-8 - 1.8 - 2.11.12 - 3.5.3 - 3.2.11 - 1.3.1 - 2.5.8 - 1.9.2 - 2.9.9 - 1.5.15 - 1.0.0 - 4.12 - 3.0.4 + 1.8 + 2.11.12 + 3.5.3 + 3.2.11 + 1.3.1 + 2.5.8 + 2.9.9 - 3.3.1 + 4.12 + 3.0.4 + + 3.3.1 org.scala-lang scala-library - ${scala-version} - - - io.swagger - swagger-core - ${swagger-core-version} + ${scala.version} + provided joda-time joda-time - ${joda-time-version} - - - org.joda - joda-convert - ${joda-convert-version} + ${joda.time.version} com.typesafe config - 1.2.1 + 1.3.2 com.typesafe.akka akka-actor_2.11 - ${akka-version} + ${akka.version} io.spray spray-client - ${spray-version} + ${spray.version} org.json4s json4s-jackson_2.11 - ${json4s-jackson-version} + ${json4s.jackson.version} + org.scalatest scalatest_2.11 - ${scala-test-version} + ${scala.test.version} test junit junit - ${junit-version} + ${junit.version} test - - - maven-mongodb-plugin-repo - maven mongodb plugin repository - http://maven-mongodb-plugin.googlecode.com/svn/maven/repo - default - - - + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + org.apache.maven.plugins maven-enforcer-plugin @@ -181,7 +177,7 @@ - src/main/java + src/main/java @@ -195,7 +191,7 @@ - src/test/java + src/test/java @@ -207,14 +203,14 @@ maven-compiler-plugin 3.7.0 - ${jdk.version} - ${jdk.version} + ${java.version} + ${java.version} net.alchim31.maven scala-maven-plugin - ${scala-maven-plugin-version} + ${scala.maven.plugin.version} scala-compile-first @@ -244,15 +240,4 @@ - - - - org.scala-tools - maven-scala-plugin - - ${scala-version} - - - - - + \ No newline at end of file diff --git a/samples/client/petstore/akka-scala/build.sbt b/samples/client/petstore/akka-scala/build.sbt index 6a714038224..de6f172c1f4 100644 --- a/samples/client/petstore/akka-scala/build.sbt +++ b/samples/client/petstore/akka-scala/build.sbt @@ -4,13 +4,12 @@ organization := "io.swagger" scalaVersion := "2.11.12" libraryDependencies ++= Seq( - "io.swagger" % "swagger-core" % "1.5.15", "com.typesafe" % "config" % "1.3.2", "com.typesafe.akka" %% "akka-actor" % "2.5.8", "io.spray" % "spray-client" % "1.3.1", "joda-time" % "joda-time" % "2.9.9", - "org.joda" % "joda-convert" % "1.9.2", "org.json4s" %% "json4s-jackson" % "3.5.3", + // test dependencies "org.scalatest" %% "scalatest" % "3.0.4" % "test", "junit" % "junit" % "4.12" % "test" ) diff --git a/samples/client/petstore/akka-scala/pom.xml b/samples/client/petstore/akka-scala/pom.xml index c2850648f1d..fcd419565d5 100644 --- a/samples/client/petstore/akka-scala/pom.xml +++ b/samples/client/petstore/akka-scala/pom.xml @@ -13,90 +13,86 @@ UTF-8 UTF-8 - 1.8 - 2.11.12 - 3.5.3 - 3.2.11 - 1.3.1 - 2.5.8 - 1.9.2 - 2.9.9 - 1.5.15 - 1.0.0 - 4.12 - 3.0.4 + 1.8 + 2.11.12 + 3.5.3 + 3.2.11 + 1.3.1 + 2.5.8 + 2.9.9 - 3.3.1 + 4.12 + 3.0.4 + + 3.3.1 org.scala-lang scala-library - ${scala-version} - - - io.swagger - swagger-core - ${swagger-core-version} + ${scala.version} + provided joda-time joda-time - ${joda-time-version} - - - org.joda - joda-convert - ${joda-convert-version} + ${joda.time.version} com.typesafe config - 1.2.1 + 1.3.2 com.typesafe.akka akka-actor_2.11 - ${akka-version} + ${akka.version} io.spray spray-client - ${spray-version} + ${spray.version} org.json4s json4s-jackson_2.11 - ${json4s-jackson-version} + ${json4s.jackson.version} + org.scalatest scalatest_2.11 - ${scala-test-version} + ${scala.test.version} test junit junit - ${junit-version} + ${junit.version} test - - - maven-mongodb-plugin-repo - maven mongodb plugin repository - http://maven-mongodb-plugin.googlecode.com/svn/maven/repo - default - - - + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + org.apache.maven.plugins maven-enforcer-plugin @@ -181,7 +177,7 @@ - src/main/java + src/main/java @@ -195,7 +191,7 @@ - src/test/java + src/test/java @@ -207,14 +203,14 @@ maven-compiler-plugin 3.7.0 - ${jdk.version} - ${jdk.version} + ${java.version} + ${java.version} net.alchim31.maven scala-maven-plugin - ${scala-maven-plugin-version} + ${scala.maven.plugin.version} scala-compile-first @@ -244,15 +240,4 @@ - - - - org.scala-tools - maven-scala-plugin - - ${scala-version} - - - - - + \ No newline at end of file From 389344726e0d902c8be7f6fdd3f3fc36892d56a7 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 15 Jan 2018 16:46:33 +0800 Subject: [PATCH 53/65] Split CircleCI test into JDK7, JDK8 specified tests (#7405) * split out circleci pom for jdk7, jdk8 * update circle config to use jdk7 pom --- circle.yml | 1 + pom.xml.circleci | 1 + pom.xml.circleci.java7 | 960 ++++++++++++++++++ .../java-msf4j/dependency-reduced-pom.xml | 68 ++ .../petstore/java-msf4j/mvn_test_jdk8_only.sh | 11 - samples/server/petstore/java-msf4j/pom.xml | 17 - .../petstore/java-play-framework/pom.xml | 5 +- .../java-play-framework/sbt_test_jdk8_only.sh | 11 - .../petstore/scala-lagom-server/pom.xml | 5 +- .../scala-lagom-server/sbt_test_jdk8_only.sh | 11 - 10 files changed, 1038 insertions(+), 52 deletions(-) create mode 100644 pom.xml.circleci.java7 create mode 100644 samples/server/petstore/java-msf4j/dependency-reduced-pom.xml delete mode 100755 samples/server/petstore/java-msf4j/mvn_test_jdk8_only.sh delete mode 100755 samples/server/petstore/java-play-framework/sbt_test_jdk8_only.sh delete mode 100755 samples/server/petstore/scala-lagom-server/sbt_test_jdk8_only.sh diff --git a/circle.yml b/circle.yml index f9aea77a432..17a76fae0ce 100644 --- a/circle.yml +++ b/circle.yml @@ -41,6 +41,7 @@ test: ## test with jdk7 - sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 - java -version + - cp pom.xml.circleci.java7 pom.xml # use jdk7 pom - mvn clean install - mvn -q verify -Psamples # skip the rest if previous mvn task fails diff --git a/pom.xml.circleci b/pom.xml.circleci index f3547d164c0..b96cf08d3d6 100644 --- a/pom.xml.circleci +++ b/pom.xml.circleci @@ -1,3 +1,4 @@ + org.sonatype.oss diff --git a/pom.xml.circleci.java7 b/pom.xml.circleci.java7 new file mode 100644 index 00000000000..09b21ef76b7 --- /dev/null +++ b/pom.xml.circleci.java7 @@ -0,0 +1,960 @@ + + + + org.sonatype.oss + oss-parent + 5 + + 4.0.0 + io.swagger + swagger-codegen-project + pom + swagger-codegen-project + 2.4.0-SNAPSHOT + https://github.com/swagger-api/swagger-codegen + + scm:git:git@github.com:swagger-api/swagger-codegen.git + scm:git:git@github.com:swagger-api/swagger-codegen.git + https://github.com/swagger-api/swagger-codegen + + + 2.2.0 + + + + fehguy + Tony Tam + fehguy@gmail.com + + + wing328 + William Cheng + wing328hk@gmail.com + + + + github + https://github.com/swagger-api/swagger-codegen/issues + + + + swagger-swaggersocket + https://groups.google.com/forum/#!forum/swagger-swaggersocket + + + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + src/main/java + target/classes + + + org.jvnet.wagon-svn + wagon-svn + 1.8 + + + org.apache.maven.wagon + wagon-ssh-external + 1.0-alpha-6 + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-1 + + + install + target + ${project.artifactId}-${project.version} + + + net.revelc.code + formatter-maven-plugin + + + + 1.7 + 1.7 + 1.7 + LF + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire-version} + + none:none + -XX:+StartAttachListener + + + + test-testng + test + + test + + + none:none + org.testng:testng + + + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + maven-compiler-plugin + 3.6.1 + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-jar-plugin + 3.0.2 + + + + development + ${project.url} + ${project.version} + io.swagger + + + + + + org.apache.maven.plugins + maven-site-plugin + 3.5.1 + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + true + 1.7 + UTF-8 + 1g + ${javadoc.package.exclude} + + + + attach-javadocs + verify + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + + + attach-sources + verify + + jar-no-fork + + + + + + + + + net.revelc.code + formatter-maven-plugin + 0.5.2 + + + + + + + release-profile + + true + + + + + net.alchim31.maven + scala-maven-plugin + + + + compile + testCompile + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-source + prepare-package + + add-source + + + + src/main/scala + + + + + + + + + + release-sign-artifacts + + + performRelease + true + + + + + + org.apache.maven.plugins + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + + + + + + + + android-client + + + env + java + + + + samples/client/petstore/android/volley + + + + bash-client + + + env + java + + + + samples/client/petstore/bash + + + + clojure-client + + + env + clojure + + + + samples/client/petstore/clojure + + + + java-client-jersey1 + + + env + java + + + + samples/client/petstore/java/jersey1 + + + + java-client-jersey2 + + + env + java + + + + samples/client/petstore/java/jersey2 + + + + java-client-jersey2-java6 + + + env + java + + + + samples/client/petstore/java/jersey2-java6 + + + + java-client-okhttp-gson + + + env + java + + + + samples/client/petstore/java/okhttp-gson + + + + java-client-okhttp-gson-parcelable + + + env + java + + + + samples/client/petstore/java/okhttp-gson/parcelableModel + + + + java-client-retrofit + + + env + java + + + + samples/client/petstore/java/retrofit + + + + java-client-retrofit2 + + + env + java + + + + samples/client/petstore/java/retrofit2 + + + + java-client-retrofit2-rx + + + env + java + + + + samples/client/petstore/java/retrofit2rx + + + + java-client-feign + + + env + java + + + + samples/client/petstore/java/feign + + + + javascript-client + + + env + javascript + + + + samples/client/petstore/javascript + + + + scala-client + + + env + scala + + + + samples/client/petstore/scala + + + + objc-client + + + env + objc + + + + samples/client/petstore/objc/default/SwaggerClientTests + + + + swift-client + + + env + swift + + + + samples/client/petstore/swift/default/SwaggerClientTests + + + + java-msf4j-server + + + env + java + + + + samples/server/petstore/java-msf4/ + + + + jaxrs-cxf-server + + + env + java + + + + samples/server/petstore/jaxrs-cxf + + + + jaxrs-resteasy-server + + + env + java + + + + samples/server/petstore/jaxrs-resteasy/default + + + + jaxrs-resteasy-server-joda + + + env + java + + + + samples/server/petstore/jaxrs-resteasy/joda + + + + jaxrs-resteasy-eap-server + + + env + java + + + + samples/server/petstore/jaxrs-resteasy/eap + + + + jaxrs-resteasy-eap-server-java8 + + + env + java + + + + samples/server/petstore/jaxrs-resteasy/eap-java8 + + + + jaxrs-resteasy-eap-server-joda + + + env + java + + + + samples/server/petstore/jaxrs-resteasy/eap-joda + + + + jaxrs-server + + + env + java + + + + samples/server/petstore/jaxrs/jersey2 + + + + jaxrs-server-jersey1 + + + env + java + + + + samples/server/petstore/jaxrs/jersey1 + + + + typescript-fetch-client-tests-default + + + env + java + + + + samples/client/petstore/typescript-fetch/tests/default + + + + typescript-fetch-client-builds-default + + + env + java + + + + samples/client/petstore/typescript-fetch/builds/default + + + + typescript-fetch-client-builds-es6-target + + + env + java + + + + samples/client/petstore/typescript-fetch/builds/es6-target + + + + typescript-fetch-client-builds-with-npm-version + + + env + java + + + + samples/client/petstore/typescript-fetch/builds/with-npm-version + + + + typescript-angularjs-client + + + env + java + + + + samples/client/petstore/typescript-angularjs/npm + + + + typescript-node-npm-client + + + env + java + + + + samples/client/petstore/typescript-node/npm + + + + python-client + + + env + java + + + + samples/client/petstore/python + + + + ruby-client + + + env + java + + + + samples/client/petstore/ruby + + + + go-client + + + env + java + + + + samples/client/petstore/go + + + + spring-mvc + + + env + java + + + + samples/server/petstore/spring-mvc + + + + springboot-useoptional + + + env + java + + + + samples/server/petstore/springboot-useoptional + + + + springboot-beanvalidation + + + env + java + + + + samples/server/petstore/springboot-beanvalidation + + + + springboot + + + env + java + + + + samples/server/petstore/springboot + + + + spring-cloud + + + env + java + + + + samples/client/petstore/spring-cloud + + + + scalatra-server + + + env + java + + + + samples/server/petstore/scalatra + + + + java-inflector + + + env + java + + + + samples/server/petstore/java-inflector + + + + java-undertowr + + + env + java + + + + samples/server/petstore/undertow + + + + samples + + + env + samples + + + + + + samples/client/petstore/akka-scala + samples/client/petstore/scala + samples/client/petstore/scalaz + samples/client/petstore/clojure + samples/client/petstore/java/feign + samples/client/petstore/java/jersey1 + samples/client/petstore/java/jersey2 + samples/client/petstore/java/okhttp-gson + samples/client/petstore/java/retrofit + samples/client/petstore/java/retrofit2 + samples/client/petstore/java/retrofit2rx + samples/client/petstore/jaxrs-cxf-client + samples/client/petstore/java/resttemplate + samples/client/petstore/java/resttemplate-withXml + samples/client/petstore/java/vertx + samples/client/petstore/java/resteasy + samples/client/petstore/java/google-api-client + samples/client/petstore/kotlin/ + + samples/client/petstore/go + + samples/server/petstore/java-vertx/rx + samples/server/petstore/java-vertx/async + samples/server/petstore/java-inflector + samples/server/petstore/undertow + samples/server/petstore/jaxrs/jersey1 + samples/server/petstore/jaxrs/jersey2 + samples/server/petstore/jaxrs/jersey1-useTags + samples/server/petstore/jaxrs/jersey2-useTags + samples/server/petstore/jaxrs-resteasy/default + samples/server/petstore/jaxrs-resteasy/eap + samples/server/petstore/jaxrs-resteasy/eap-joda + samples/server/petstore/jaxrs-resteasy/eap-java8 + samples/server/petstore/jaxrs-resteasy/joda + samples/server/petstore/spring-mvc + samples/client/petstore/spring-cloud + samples/server/petstore/springboot + samples/server/petstore/springboot-beanvalidation + samples/server/petstore/springboot-useoptional + samples/server/petstore/jaxrs-cxf + samples/server/petstore/jaxrs-cxf-annotated-base-path + samples/server/petstore/jaxrs-cxf-cdi + samples/server/petstore/jaxrs-cxf-non-spring-app + samples/server/petstore/java-msf4j + samples/server/petstore/jaxrs-spec-interface + + + + + modules/swagger-codegen + modules/swagger-codegen-cli + modules/swagger-codegen-maven-plugin + modules/swagger-generator + + + target/site + + + net.alchim31.maven + scala-maven-plugin + ${scala-maven-plugin-version} + + + org.apache.maven.plugins + maven-jxr-plugin + 2.5 + + true + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 2.9 + + + + project-team + + + + + + + + + + junit + junit + ${junit-version} + test + + + org.testng + testng + ${testng-version} + test + + + org.jmockit + jmockit + ${jmockit-version} + test + + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 1.0.31 + 2.11.1 + 3.3.0 + 1.5.15 + 2.4 + 1.2 + 4.8.1 + 2.8.9 + 1.0.0 + 3.4 + 1.7.12 + 3.2.1 + 1.12 + 6.9.6 + 2.19.1 + 1.25 + 0.9.10 + + diff --git a/samples/server/petstore/java-msf4j/dependency-reduced-pom.xml b/samples/server/petstore/java-msf4j/dependency-reduced-pom.xml new file mode 100644 index 00000000000..666f88657e6 --- /dev/null +++ b/samples/server/petstore/java-msf4j/dependency-reduced-pom.xml @@ -0,0 +1,68 @@ + + + + msf4j-service + org.wso2.msf4j + 2.0.0 + ../pom.xml/pom.xml + + 4.0.0 + io.swagger + swagger-msf4j-server + swagger-msf4j-server + 1.0.0 + + src/main/java + + + maven-jar-plugin + + + + io.swagger.api.Application + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + + 1.5.15 + 2.22.2 + 1.8 + 4.12 + 9.2.9.v20150224 + ${java.version} + UTF-8 + 2.5 + 1.1.7 + ${java.version} + + + diff --git a/samples/server/petstore/java-msf4j/mvn_test_jdk8_only.sh b/samples/server/petstore/java-msf4j/mvn_test_jdk8_only.sh deleted file mode 100755 index 48e5cea3cfd..00000000000 --- a/samples/server/petstore/java-msf4j/mvn_test_jdk8_only.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -java -version 2>&1 | grep "java version \"1.8" - -if [ $? -eq 0 ] -then - echo "Running JDK8" - mvn test -else - echo "Not running JDK8" -fi diff --git a/samples/server/petstore/java-msf4j/pom.xml b/samples/server/petstore/java-msf4j/pom.xml index 85157e6046e..22eee0d5718 100644 --- a/samples/server/petstore/java-msf4j/pom.xml +++ b/samples/server/petstore/java-msf4j/pom.xml @@ -43,23 +43,6 @@ - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - - Play Test - integration-test - - exec - - - ./mvn_test_jdk8_only.sh - - - - diff --git a/samples/server/petstore/java-play-framework/pom.xml b/samples/server/petstore/java-play-framework/pom.xml index 11bbefd17f5..a34d23f83d7 100644 --- a/samples/server/petstore/java-play-framework/pom.xml +++ b/samples/server/petstore/java-play-framework/pom.xml @@ -33,7 +33,10 @@ exec - ./sbt_test_jdk8_only.sh + sbt + + test + diff --git a/samples/server/petstore/java-play-framework/sbt_test_jdk8_only.sh b/samples/server/petstore/java-play-framework/sbt_test_jdk8_only.sh deleted file mode 100755 index 31ad9761486..00000000000 --- a/samples/server/petstore/java-play-framework/sbt_test_jdk8_only.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -java -version 2>&1 | grep "java version \"1.8" - -if [ $? -eq 0 ] -then - echo "Running JDK8" - sbt test -else - echo "Not running JDK8" -fi diff --git a/samples/server/petstore/scala-lagom-server/pom.xml b/samples/server/petstore/scala-lagom-server/pom.xml index 3ea25563d18..7b7cbe76b93 100644 --- a/samples/server/petstore/scala-lagom-server/pom.xml +++ b/samples/server/petstore/scala-lagom-server/pom.xml @@ -19,7 +19,10 @@ exec - ./sbt_test_jdk8_only.sh + sbt + + test + diff --git a/samples/server/petstore/scala-lagom-server/sbt_test_jdk8_only.sh b/samples/server/petstore/scala-lagom-server/sbt_test_jdk8_only.sh deleted file mode 100755 index 31ad9761486..00000000000 --- a/samples/server/petstore/scala-lagom-server/sbt_test_jdk8_only.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -java -version 2>&1 | grep "java version \"1.8" - -if [ $? -eq 0 ] -then - echo "Running JDK8" - sbt test -else - echo "Not running JDK8" -fi From 7b8e409cf943edf9523aefb999f66043508f0ada Mon Sep 17 00:00:00 2001 From: magnolia Date: Mon, 15 Jan 2018 22:00:26 +0900 Subject: [PATCH 54/65] Added gitignore generation function (#7402) Copy gitignore template from client --- .../languages/ScalatraServerCodegen.java | 1 + .../main/resources/scalatra/gitignore.mustache | 17 +++++++++++++++++ samples/server/petstore/scalatra/.gitignore | 17 +++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 modules/swagger-codegen/src/main/resources/scalatra/gitignore.mustache create mode 100644 samples/server/petstore/scalatra/.gitignore diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalatraServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalatraServerCodegen.java index 8db4cc62fc5..cfa03e3639b 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalatraServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalatraServerCodegen.java @@ -80,6 +80,7 @@ public ScalatraServerCodegen() { supportingFiles.add(new SupportingFile("build.sbt", "", "build.sbt")); supportingFiles.add(new SupportingFile("web.xml", "/src/main/webapp/WEB-INF", "web.xml")); supportingFiles.add(new SupportingFile("logback.xml", "/src/main/resources", "logback.xml")); + supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("JettyMain.mustache", sourceFolder, "JettyMain.scala")); supportingFiles.add(new SupportingFile("Bootstrap.mustache", sourceFolder, "ScalatraBootstrap.scala")); supportingFiles.add(new SupportingFile("ServletApp.mustache", sourceFolder, "ServletApp.scala")); diff --git a/modules/swagger-codegen/src/main/resources/scalatra/gitignore.mustache b/modules/swagger-codegen/src/main/resources/scalatra/gitignore.mustache new file mode 100644 index 00000000000..c58d83b3189 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/scalatra/gitignore.mustache @@ -0,0 +1,17 @@ +*.class +*.log + +# sbt specific +.cache +.history +.lib/ +dist/* +target/ +lib_managed/ +src_managed/ +project/boot/ +project/plugins/project/ + +# Scala-IDE specific +.scala_dependencies +.worksheet diff --git a/samples/server/petstore/scalatra/.gitignore b/samples/server/petstore/scalatra/.gitignore new file mode 100644 index 00000000000..c58d83b3189 --- /dev/null +++ b/samples/server/petstore/scalatra/.gitignore @@ -0,0 +1,17 @@ +*.class +*.log + +# sbt specific +.cache +.history +.lib/ +dist/* +target/ +lib_managed/ +src_managed/ +project/boot/ +project/plugins/project/ + +# Scala-IDE specific +.scala_dependencies +.worksheet From 30c1448d78b16696a4822a38f68bcbfa7a13fc1e Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 19 Jan 2018 13:21:39 +0800 Subject: [PATCH 55/65] Fix build.gradle for Java RESTEasy client (#7448) * update release 2.3.1 * add jeff9finger to java tech committee * fix build.gradle for java resteasy --- README.md | 14 +-- .../libraries/resteasy/build.gradle.mustache | 7 +- .../Java/libraries/resteasy/pom.mustache | 80 ++++++++-------- .../java/resteasy/.swagger-codegen/VERSION | 2 +- .../petstore/java/resteasy/build.gradle | 7 +- samples/client/petstore/java/resteasy/pom.xml | 95 ++++++++++--------- 6 files changed, 109 insertions(+), 96 deletions(-) diff --git a/README.md b/README.md index 976e97fbe4a..f0a3b8a8403 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ This is the swagger codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification). Currently, the following languages/frameworks are supported: - **API clients**: **ActionScript**, **Ada**, **Apex**, **Bash**, **C#** (.net 2.0, 3.5 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (Angular1.x, Angular2.x, Fetch, jQuery, Node) -- **Server stubs**: **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed), **Erlang**, **Go**, **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **PHP** (Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), Scalatra) +- **Server stubs**: **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed), **Erlang**, **Go**, **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **PHP** (Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), Scalatra) - **API documentation generators**: **HTML**, **Confluence Wiki** - **Configuration files**: [**Apache2**](https://httpd.apache.org/) - **Others**: **JMeter** @@ -81,7 +81,8 @@ Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes -------------------------- | ------------ | -------------------------- | ----- 3.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/3.0.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Major release with breaking changes 2.4.0 (current master, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/2.4.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes -[2.3.0](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.3.0) (**current stable**) | 2017-12-21 | 1.0, 1.1, 1.2, 2.0 | [tag v2.3.0](https://github.com/swagger-api/swagger-codegen/tree/v2.3.0) +[2.3.1](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.3.1) (**current stable**) | 2018-01-17 | 1.0, 1.1, 1.2, 2.0 | [tag v2.3.1](https://github.com/swagger-api/swagger-codegen/tree/v2.3.1) +[2.3.0](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.3.0) | 2017-12-21 | 1.0, 1.1, 1.2, 2.0 | [tag v2.3.0](https://github.com/swagger-api/swagger-codegen/tree/v2.3.0) [2.2.3](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.3) | 2017-07-15 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.3](https://github.com/swagger-api/swagger-codegen/tree/v2.2.3) [2.2.2](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.2) | 2017-03-01 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.2](https://github.com/swagger-api/swagger-codegen/tree/v2.2.2) [2.2.1](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.1) | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1) @@ -94,12 +95,12 @@ Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 7 runtime at a minimum): ```sh -wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.3.0/swagger-codegen-cli-2.3.0.jar -O swagger-codegen-cli.jar +wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.3.1/swagger-codegen-cli-2.3.1.jar -O swagger-codegen-cli.jar java -jar swagger-codegen-cli.jar help ``` -For Windows users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. `Invoke-WebRequest -OutFile swagger-codegen-cli.jar http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.3.0/swagger-codegen-cli-2.3.0.jar` +For Windows users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. `Invoke-WebRequest -OutFile swagger-codegen-cli.jar http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.3.1/swagger-codegen-cli-2.3.1.jar` On a mac, it's even easier with `brew`: ```sh @@ -237,7 +238,7 @@ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ ``` (if you're on Windows, replace the last command with `java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client`) -You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.3.0/swagger-codegen-cli-2.3.0.jar) +You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.3.1/swagger-codegen-cli-2.3.1.jar) To get a list of **general** options available, please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate` @@ -1032,6 +1033,7 @@ Here is a list of template creators: * TypeScript (Angular2): @roni-frantchi * TypeScript (jQuery): @bherila * Server Stubs + * Ada: @stcarrez * C# ASP.NET5: @jimschubert * C# NancyFX: @mstefaniuk * C++ Pistache: @sebymiano @@ -1107,7 +1109,7 @@ If you want to join the committee, please kindly apply by sending an email to wi | Groovy | | | Go | @antihax (2017/11) @bvwells (2017/12) | | Haskell | | -| Java | @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) | +| Java | @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) | | Kotlin | @jimschubert (2017/09) | | Lua | @daurnimator (2017/08) | | NodeJS/Javascript | @CodeNinjai (2017/07) @frol (2017/07) @cliffano (2017/07) | diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/build.gradle.mustache index 5a8e29157a6..fc42da3e68c 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/build.gradle.mustache @@ -106,8 +106,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.8" - jackson_version = "2.7.5" + jackson_version = "2.6.4" jersey_version = "2.22.2" + resteasy_version = "3.1.3.Final" {{^java8}} jodatime_version = "2.9.4" {{/java8}} @@ -120,12 +121,16 @@ ext { dependencies { compile "io.swagger:swagger-annotations:$swagger_annotations_version" + compile "org.jboss.resteasy:resteasy-client:$resteasy_version" + compile "org.jboss.resteasy:resteasy-multipart-provider:$resteasy_version" + compile "org.jboss.resteasy:resteasy-jackson2-provider:$resteasy_version" compile "org.glassfish.jersey.core:jersey-client:$jersey_version" compile "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version" compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version" compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" + compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_version" {{#java8}} compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" {{/java8}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/pom.mustache index dffd36c3b34..cd6e8e429b0 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/pom.mustache @@ -174,53 +174,53 @@ {{#withXml}} - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - ${jackson-version} - + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + {{/withXml}} {{#java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + {{/java8}} {{^java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - - - joda-time - joda-time - ${jodatime-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + joda-time + joda-time + ${jodatime-version} + - - - com.brsanthu - migbase64 - 2.2 - + + + com.brsanthu + migbase64 + 2.2 + {{/java8}} {{#supportJava6}} - - org.apache.commons - commons-lang3 - ${commons_lang3_version} - + + org.apache.commons + commons-lang3 + ${commons_lang3_version} + - - commons-io - commons-io - ${commons_io_version} - + + commons-io + commons-io + ${commons_io_version} + {{/supportJava6}} org.jboss.resteasy @@ -251,11 +251,11 @@ 3.1.3.Final 2.6.4 {{^java8}} - 2.9.9 + 2.9.9 {{/java8}} {{#supportJava6}} - 2.5 - 3.6 + 2.5 + 3.6 {{/supportJava6}} 1.0.0 4.12 diff --git a/samples/client/petstore/java/resteasy/.swagger-codegen/VERSION b/samples/client/petstore/java/resteasy/.swagger-codegen/VERSION index 50794f17f1a..a6254504e40 100644 --- a/samples/client/petstore/java/resteasy/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/resteasy/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +2.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/resteasy/build.gradle b/samples/client/petstore/java/resteasy/build.gradle index 05970eaa2d8..7153f2820a7 100644 --- a/samples/client/petstore/java/resteasy/build.gradle +++ b/samples/client/petstore/java/resteasy/build.gradle @@ -94,20 +94,25 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.8" - jackson_version = "2.7.5" + jackson_version = "2.6.4" jersey_version = "2.22.2" + resteasy_version = "3.1.3.Final" jodatime_version = "2.9.4" junit_version = "4.12" } dependencies { compile "io.swagger:swagger-annotations:$swagger_annotations_version" + compile "org.jboss.resteasy:resteasy-client:$resteasy_version" + compile "org.jboss.resteasy:resteasy-multipart-provider:$resteasy_version" + compile "org.jboss.resteasy:resteasy-jackson2-provider:$resteasy_version" compile "org.glassfish.jersey.core:jersey-client:$jersey_version" compile "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version" compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version" compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" + compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_version" compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" compile "joda-time:joda-time:$jodatime_version" compile "com.brsanthu:migbase64:2.2" diff --git a/samples/client/petstore/java/resteasy/pom.xml b/samples/client/petstore/java/resteasy/pom.xml index 5dfaf67a675..72329e3fc98 100644 --- a/samples/client/petstore/java/resteasy/pom.xml +++ b/samples/client/petstore/java/resteasy/pom.xml @@ -148,53 +148,54 @@ jackson-databind ${jackson-version} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - - - joda-time - joda-time - ${jodatime-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + joda-time + joda-time + ${jodatime-version} + - - - com.brsanthu - migbase64 - 2.2 - + + + com.brsanthu + migbase64 + 2.2 + - - org.jboss.resteasy - resteasy-jackson2-provider - 3.1.3.Final - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-version} - - - - junit - junit - ${junit-version} - test - - - - 1.5.15 - 3.1.3.Final - 2.6.4 - 2.9.9 - 1.0.0 - 4.12 - + + org.jboss.resteasy + resteasy-jackson2-provider + 3.1.3.Final + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-version} + + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.5.15 + 3.1.3.Final + 2.6.4 + 2.9.9 + 1.0.0 + 4.12 + From ea4b948428654e5c7066014bccd9843e47ab5e64 Mon Sep 17 00:00:00 2001 From: etherealjoy <33183834+etherealjoy@users.noreply.github.com> Date: Fri, 19 Jan 2018 08:36:45 +0100 Subject: [PATCH 56/65] [qt5cpp] Add nullptr guard to prevent crash when empty model is being serialized (#7434) * Small fixes to prevent crash when empty json body is provided. * Updated PetStore example for Qt5 --- .../src/main/resources/qt5cpp/helpers-header.mustache | 2 ++ .../src/main/resources/qt5cpp/model-body.mustache | 2 +- samples/client/petstore/qt5cpp/client/SWGHelpers.h | 2 ++ samples/client/petstore/qt5cpp/client/SWGPet.cpp | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-header.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-header.mustache index c3569d7e7be..b40c2ee8ba6 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-header.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/helpers-header.mustache @@ -3,6 +3,8 @@ #define {{prefix}}_HELPERS_H #include +#include +#include {{#cppNamespaceDeclarations}} namespace {{this}} { diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache index f5e707f5605..011bf19fd69 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/model-body.mustache @@ -105,7 +105,7 @@ QJsonObject* QJsonObject* obj = new QJsonObject(); {{#vars}} {{^isContainer}}{{#complexType}}{{^isString}}{{^isDate}}{{^isDateTime}}{{^isByteArray}} - if({{name}}->isSet()){ + if(({{name}} != nullptr) && ({{name}}->isSet())){ toJsonValue(QString("{{baseName}}"), {{name}}, obj, QString("{{complexType}}")); }{{/isByteArray}}{{/isDateTime}}{{/isDate}}{{/isString}}{{#isString}} if({{name}} != nullptr && *{{name}} != QString("")){ diff --git a/samples/client/petstore/qt5cpp/client/SWGHelpers.h b/samples/client/petstore/qt5cpp/client/SWGHelpers.h index bf721a6a1b9..337d2150d3d 100644 --- a/samples/client/petstore/qt5cpp/client/SWGHelpers.h +++ b/samples/client/petstore/qt5cpp/client/SWGHelpers.h @@ -14,6 +14,8 @@ #define SWG_HELPERS_H #include +#include +#include namespace Swagger { diff --git a/samples/client/petstore/qt5cpp/client/SWGPet.cpp b/samples/client/petstore/qt5cpp/client/SWGPet.cpp index a57cfdbc8d3..77a84be36a1 100644 --- a/samples/client/petstore/qt5cpp/client/SWGPet.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGPet.cpp @@ -122,7 +122,7 @@ SWGPet::asJsonObject() { obj->insert("id", QJsonValue(id)); } - if(category->isSet()){ + if((category != nullptr) && (category->isSet())){ toJsonValue(QString("category"), category, obj, QString("SWGCategory")); } From 1ee85de94e4f856dafc5b41b5c0cbdc9f2784c48 Mon Sep 17 00:00:00 2001 From: magnolia Date: Fri, 19 Jan 2018 17:20:12 +0900 Subject: [PATCH 57/65] Added Intelli J ignore (#7423) .idea *.iml --- .../src/main/resources/scala/gitignore.mustache | 5 +++++ .../src/main/resources/scalatra/gitignore.mustache | 5 +++++ samples/client/petstore/scala/.gitignore | 5 +++++ samples/server/petstore/scalatra/.gitignore | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/modules/swagger-codegen/src/main/resources/scala/gitignore.mustache b/modules/swagger-codegen/src/main/resources/scala/gitignore.mustache index c58d83b3189..ad2b0d3ecd8 100644 --- a/modules/swagger-codegen/src/main/resources/scala/gitignore.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/gitignore.mustache @@ -1,3 +1,4 @@ +# scala specific *.class *.log @@ -15,3 +16,7 @@ project/plugins/project/ # Scala-IDE specific .scala_dependencies .worksheet + +# IntelliJ specific +.idea +*.iml diff --git a/modules/swagger-codegen/src/main/resources/scalatra/gitignore.mustache b/modules/swagger-codegen/src/main/resources/scalatra/gitignore.mustache index c58d83b3189..ad2b0d3ecd8 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/gitignore.mustache +++ b/modules/swagger-codegen/src/main/resources/scalatra/gitignore.mustache @@ -1,3 +1,4 @@ +# scala specific *.class *.log @@ -15,3 +16,7 @@ project/plugins/project/ # Scala-IDE specific .scala_dependencies .worksheet + +# IntelliJ specific +.idea +*.iml diff --git a/samples/client/petstore/scala/.gitignore b/samples/client/petstore/scala/.gitignore index c58d83b3189..ad2b0d3ecd8 100644 --- a/samples/client/petstore/scala/.gitignore +++ b/samples/client/petstore/scala/.gitignore @@ -1,3 +1,4 @@ +# scala specific *.class *.log @@ -15,3 +16,7 @@ project/plugins/project/ # Scala-IDE specific .scala_dependencies .worksheet + +# IntelliJ specific +.idea +*.iml diff --git a/samples/server/petstore/scalatra/.gitignore b/samples/server/petstore/scalatra/.gitignore index c58d83b3189..ad2b0d3ecd8 100644 --- a/samples/server/petstore/scalatra/.gitignore +++ b/samples/server/petstore/scalatra/.gitignore @@ -1,3 +1,4 @@ +# scala specific *.class *.log @@ -15,3 +16,7 @@ project/plugins/project/ # Scala-IDE specific .scala_dependencies .worksheet + +# IntelliJ specific +.idea +*.iml From 7853308c8e3ced9aecfbd71b8a1d5fe212e96c39 Mon Sep 17 00:00:00 2001 From: magnolia Date: Fri, 19 Jan 2018 17:20:41 +0900 Subject: [PATCH 58/65] Rebuild Scalatra sample (#7431) When creating the following PR, sample was generated without reflecting the last change. https://github.com/swagger-api/swagger-codegen/pull/7393 With this commit, it will be synchronized --- .../scala/io/swagger/client/api/PetApi.scala | 2 -- .../scalatra/src/main/resources/logback.xml | 18 +++++++++++++++++- .../io/swagger/server/model/ApiResponse.scala | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala index 827788f03e4..4763f547e1a 100644 --- a/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala +++ b/samples/client/petstore/scala/src/main/scala/io/swagger/client/api/PetApi.scala @@ -350,7 +350,6 @@ class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends val headerParams = new mutable.HashMap[String, String] if (status == null) throw new Exception("Missing required parameter 'status' when calling PetApi->findPetsByStatus") - queryParams += "status" -> status.toString val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") @@ -368,7 +367,6 @@ class PetApiAsyncHelper(client: TransportClient, config: SwaggerConfig) extends val headerParams = new mutable.HashMap[String, String] if (tags == null) throw new Exception("Missing required parameter 'tags' when calling PetApi->findPetsByTags") - queryParams += "tags" -> tags.toString val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") diff --git a/samples/server/petstore/scalatra/src/main/resources/logback.xml b/samples/server/petstore/scalatra/src/main/resources/logback.xml index 67b13552c87..9f46cb2c657 100644 --- a/samples/server/petstore/scalatra/src/main/resources/logback.xml +++ b/samples/server/petstore/scalatra/src/main/resources/logback.xml @@ -7,7 +7,23 @@ - + + logFile.log + + + logFile.%d{yyyy-MM-dd}.log + + + 30 + + + + %-4relative [%thread] %-5level %logger{35} - %msg%n + + + + + diff --git a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/ApiResponse.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/ApiResponse.scala index 005e2bc2999..f47a2cbf8e6 100644 --- a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/ApiResponse.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/ApiResponse.scala @@ -14,6 +14,6 @@ package io.swagger.server.model case class ApiResponse( code: Option[Int], - _type: Option[String], + `type`: Option[String], message: Option[String] ) From 8e270f4651b7998dcfbffc52842a4bb4b036ad23 Mon Sep 17 00:00:00 2001 From: chiman-jang <35390072+chiman-jang@users.noreply.github.com> Date: Fri, 19 Jan 2018 17:24:10 +0900 Subject: [PATCH 59/65] add vendorExtensions field in CodegenSecurity class (ref: #7236) (#7415) --- .../src/main/java/io/swagger/codegen/CodegenSecurity.java | 4 ++++ .../src/main/java/io/swagger/codegen/DefaultCodegen.java | 1 + 2 files changed, 5 insertions(+) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenSecurity.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenSecurity.java index 4e9dd098a4e..8d2460c2dc1 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenSecurity.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenSecurity.java @@ -7,6 +7,7 @@ public class CodegenSecurity { public String name; public String type; public Boolean hasMore, isBasic, isOAuth, isApiKey; + public Map vendorExtensions; // ApiKey specific public String keyParamName; public Boolean isKeyInQuery, isKeyInHeader; @@ -39,6 +40,8 @@ public boolean equals(Object o) { return false; if (isApiKey != null ? !isApiKey.equals(that.isApiKey) : that.isApiKey != null) return false; + if (vendorExtensions != null ? !vendorExtensions.equals(that.vendorExtensions) : that.vendorExtensions != null) + return false; if (keyParamName != null ? !keyParamName.equals(that.keyParamName) : that.keyParamName != null) return false; if (isKeyInQuery != null ? !isKeyInQuery.equals(that.isKeyInQuery) : that.isKeyInQuery != null) @@ -71,6 +74,7 @@ public int hashCode() { result = 31 * result + (isBasic != null ? isBasic.hashCode() : 0); result = 31 * result + (isOAuth != null ? isOAuth.hashCode() : 0); result = 31 * result + (isApiKey != null ? isApiKey.hashCode() : 0); + result = 31 * result + (vendorExtensions != null ? vendorExtensions.hashCode() : 0); result = 31 * result + (keyParamName != null ? keyParamName.hashCode() : 0); result = 31 * result + (isKeyInQuery != null ? isKeyInQuery.hashCode() : 0); result = 31 * result + (isKeyInHeader != null ? isKeyInHeader.hashCode() : 0); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 1f863afb990..46b31091bc7 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -2756,6 +2756,7 @@ public List fromSecurity(Map sec.name = entry.getKey(); sec.type = schemeDefinition.getType(); sec.isCode = sec.isPassword = sec.isApplication = sec.isImplicit = false; + sec.vendorExtensions = schemeDefinition.getVendorExtensions(); if (schemeDefinition instanceof ApiKeyAuthDefinition) { final ApiKeyAuthDefinition apiKeyDefinition = (ApiKeyAuthDefinition) schemeDefinition; From a61d23265df8f7fbab0577ac0007ea27e2f67cb3 Mon Sep 17 00:00:00 2001 From: Kane Lai Date: Fri, 19 Jan 2018 17:30:04 +0800 Subject: [PATCH 60/65] Fixed incorrect renaming of header and query param to camel cases for Kotlin Client template (#7420) * - Fixed incorrect renaming of header and query param to camel cases * Generated petstore code base on modified Kotlin template --- .../src/main/resources/kotlin-client/api.mustache | 4 ++-- samples/client/petstore/kotlin/.swagger-codegen/VERSION | 2 +- .../kotlin/src/main/kotlin/io/swagger/client/apis/PetApi.kt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/kotlin-client/api.mustache b/modules/swagger-codegen/src/main/resources/kotlin-client/api.mustache index 9b78ac8f2cb..11ecf02624a 100644 --- a/modules/swagger-codegen/src/main/resources/kotlin-client/api.mustache +++ b/modules/swagger-codegen/src/main/resources/kotlin-client/api.mustache @@ -19,8 +19,8 @@ class {{classname}}(basePath: kotlin.String = "{{{basePath}}}") : ApiClient(base @Suppress("UNCHECKED_CAST"){{/returnType}} fun {{operationId}}({{#allParams}}{{paramName}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}} { val localVariableBody: kotlin.Any? = {{#hasBodyParam}}{{#bodyParams}}{{paramName}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}null{{/hasFormParams}}{{#hasFormParams}}mapOf({{#formParams}}"{{{baseName}}}" to "${{paramName}}"{{#hasMore}}, {{/hasMore}}{{/formParams}}){{/hasFormParams}}{{/hasBodyParam}} - val localVariableQuery: MultiValueMap = {{^hasQueryParams}}mapOf(){{/hasQueryParams}}{{#hasQueryParams}}mapOf({{#queryParams}}"{{paramName}}" to {{#isContainer}}toMultiValue({{paramName}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf("${{paramName}}"){{/isContainer}}{{#hasMore}}, {{/hasMore}}{{/queryParams}}){{/hasQueryParams}} - val localVariableHeaders: kotlin.collections.Map = mapOf({{#hasFormParams}}"Content-Type" to "multipart/form-data"{{/hasFormParams}}{{^hasHeaderParams}}){{/hasHeaderParams}}{{#hasHeaderParams}}{{#hasFormParams}}, {{/hasFormParams}}{{#headerParams}}"{{paramName}}" to {{#isContainer}}{{paramName}}.joinToString(separator = collectionDelimiter("{{collectionFormat}}"){{/isContainer}}{{^isContainer}}{{paramName}}{{/isContainer}}{{#hasMore}}, {{/hasMore}}{{/headerParams}}){{/hasHeaderParams}} + val localVariableQuery: MultiValueMap = {{^hasQueryParams}}mapOf(){{/hasQueryParams}}{{#hasQueryParams}}mapOf({{#queryParams}}"{{baseName}}" to {{#isContainer}}toMultiValue({{paramName}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf("${{paramName}}"){{/isContainer}}{{#hasMore}}, {{/hasMore}}{{/queryParams}}){{/hasQueryParams}} + val localVariableHeaders: kotlin.collections.Map = mapOf({{#hasFormParams}}"Content-Type" to "multipart/form-data"{{/hasFormParams}}{{^hasHeaderParams}}){{/hasHeaderParams}}{{#hasHeaderParams}}{{#hasFormParams}}, {{/hasFormParams}}{{#headerParams}}"{{baseName}}" to {{#isContainer}}{{paramName}}.joinToString(separator = collectionDelimiter("{{collectionFormat}}"){{/isContainer}}{{^isContainer}}{{paramName}}{{/isContainer}}{{#hasMore}}, {{/hasMore}}{{/headerParams}}){{/hasHeaderParams}} val localVariableConfig = RequestConfig( RequestMethod.{{httpMethod}}, "{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", "${{paramName}}"){{/pathParams}}, diff --git a/samples/client/petstore/kotlin/.swagger-codegen/VERSION b/samples/client/petstore/kotlin/.swagger-codegen/VERSION index f9f7450d135..a6254504e40 100644 --- a/samples/client/petstore/kotlin/.swagger-codegen/VERSION +++ b/samples/client/petstore/kotlin/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +2.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/apis/PetApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/apis/PetApi.kt index c716883b340..5d6d2f187eb 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/apis/PetApi.kt @@ -59,7 +59,7 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli fun deletePet(petId: kotlin.Long, apiKey: kotlin.String) : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf("apiKey" to apiKey) + val localVariableHeaders: kotlin.collections.Map = mapOf("api_key" to apiKey) val localVariableConfig = RequestConfig( RequestMethod.DELETE, "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), From 6bf84d5fa741fb2440e25c58cd24bcef3f4fccaf Mon Sep 17 00:00:00 2001 From: Alessio Fachechi Date: Sat, 20 Jan 2018 07:05:32 +0100 Subject: [PATCH 61/65] fix of issue #7386 (#7401) --- .../src/main/resources/JavaJaxRS/spec/enumClass.mustache | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/enumClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/enumClass.mustache index a9d67c0471e..4589ba05c29 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/enumClass.mustache @@ -16,10 +16,12 @@ public enum {{datatypeWithEnum}} { } @Override + @JsonValue public String toString() { return String.valueOf(value); } + @JsonCreator public static {{datatypeWithEnum}} fromValue(String v) { for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (String.valueOf(b.value).equals(v)) { From 197b4481efd36aeba393809086c42ccf4de802f6 Mon Sep 17 00:00:00 2001 From: Jinkui Shi Date: Sat, 20 Jan 2018 14:15:16 +0800 Subject: [PATCH 62/65] [doc] akka-scala and Java README normalize (#7382) * normalize scala-akka and Java README.mustache * move version info to the project info section --- .../src/main/resources/Java/README.mustache | 41 ++++++++---- .../main/resources/akka-scala/README.mustache | 66 +++++++------------ 2 files changed, 52 insertions(+), 55 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/README.mustache b/modules/swagger-codegen/src/main/resources/Java/README.mustache index fff0bf0973c..6ec3efff471 100644 --- a/modules/swagger-codegen/src/main/resources/Java/README.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/README.mustache @@ -1,24 +1,41 @@ # {{artifactId}} +{{appName}} +- API version: {{appVersion}} +{{^hideGenerationTimestamp}} + - Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} + +{{#appDescription}}{{{appDescription}}}{{/appDescription}} + +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +*Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)* + + ## Requirements -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. +Building the API client library requires: +1. Java 1.7+ +2. Maven/Gradle ## Installation To install the API client library to your local Maven repository, simply execute: ```shell -mvn install +mvn clean install ``` To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: ```shell -mvn deploy +mvn clean deploy ``` -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. ### Maven users @@ -26,10 +43,10 @@ Add this dependency to your project's POM: ```xml - {{{groupId}}} - {{{artifactId}}} - {{{artifactVersion}}} - compile + {{{groupId}}} + {{{artifactId}}} + {{{artifactVersion}}} + compile ``` @@ -45,12 +62,14 @@ compile "{{{groupId}}}:{{{artifactId}}}:{{{artifactVersion}}}" At first generate the JAR by executing: - mvn package +```shell +mvn clean package +``` Then manually install the following JARs: -* target/{{{artifactId}}}-{{{artifactVersion}}}.jar -* target/lib/*.jar +* `target/{{{artifactId}}}-{{{artifactVersion}}}.jar` +* `target/lib/*.jar` ## Getting Started diff --git a/modules/swagger-codegen/src/main/resources/akka-scala/README.mustache b/modules/swagger-codegen/src/main/resources/akka-scala/README.mustache index 85c72cd1d16..eb2a9ba67ba 100644 --- a/modules/swagger-codegen/src/main/resources/akka-scala/README.mustache +++ b/modules/swagger-codegen/src/main/resources/akka-scala/README.mustache @@ -1,42 +1,40 @@ -# NAME +# {{artifactId}} {{appName}} - -{{#appDescription}}{{{appDescription}}}{{/appDescription}} - -# VERSION - -Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - - API version: {{appVersion}} -- Package version: {{moduleVersion}} {{^hideGenerationTimestamp}} -- Build date: {{generatedDate}} + - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} -- Build package: {{generatorClass}} + +{{#appDescription}}{{{appDescription}}}{{/appDescription}} + {{#infoUrl}} -For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) {{/infoUrl}} -# Requirements +*Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)* -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. +## Requirements + +Building the API client library requires: +1. Java 1.7+ +2. Maven/Gradle/SBT ## Installation To install the API client library to your local Maven repository, simply execute: ```shell -mvn install +mvn clean install ``` To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: ```shell -mvn deploy +mvn clean deploy ``` -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. ### Maven users @@ -44,10 +42,10 @@ Add this dependency to your project's POM: ```xml - {{{groupId}}} - {{{artifactId}}} - {{{artifactVersion}}} - compile + {{{groupId}}} + {{{artifactId}}} + {{{artifactVersion}}} + compile ``` @@ -65,13 +63,15 @@ compile "{{{groupId}}}:{{{artifactId}}}:{{{artifactVersion}}}" libraryDependencies += "{{{groupId}}}" % "{{{artifactId}}}" % "{{{artifactVersion}}}" ``` +## Getting Started + ## Documentation for API Endpoints All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | **{{operationId}}** | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models @@ -101,28 +101,6 @@ Class | Method | HTTP request | Description {{/authMethods}} - -# BUILDING YOUR LIBRARY - -See the homepage `https://github.com/swagger-api/swagger-codegen` for full details. -But briefly, clone the git repository, build the codegen codebase, set up your build -config file, then run the API build script. You will need git, Java 7 or 8 and Apache -maven 3.0.3 or better already installed. - -Your library files will be built under `WWW::MyProjectName`. - - $ git clone https://github.com/swagger-api/swagger-codegen.git - $ cd swagger-codegen - $ mvn package - $ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ - -i [URL or file path to JSON swagger API spec] \ - -l akka-scala \ - -c /path/to/config/file.json \ - -o /path/to/output/folder - -Bang, all done. Run the `autodoc` script in the `bin` directory to see the API -you just built. - ## Author {{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} From ef832e7157198dc80b9c6047ecd6f347ad9fa607 Mon Sep 17 00:00:00 2001 From: Esteban Marin Date: Sat, 20 Jan 2018 07:24:33 +0100 Subject: [PATCH 63/65] [Feature][Angular] improve docs angular import (#7363) * #7354: improve docs about importing multiple ApiModules, prevent https://github.com/angular/angular/issues/20575#issuecomment-356261374 * #7354: prevent https://github.com/angular/angular/issues/20575#issuecomment-356261374 add error message about importing the HttpModule / HttpClientModule * #7354: generate sample files * #7354: generate README.md also for non-npm packages --- .../TypeScriptAngularClientCodegen.java | 2 +- .../typescript-angular/README.mustache | 34 +++- .../typescript-angular/api.module.mustache | 20 +-- .../default/.swagger-codegen/VERSION | 2 +- .../typescript-angular-v2/default/README.md | 167 ++++++++++++++++++ .../default/api.module.ts | 15 +- .../npm/.swagger-codegen/VERSION | 2 +- .../typescript-angular-v2/npm/README.md | 30 +++- .../typescript-angular-v2/npm/api.module.ts | 5 +- .../with-interfaces/.swagger-codegen/VERSION | 2 +- .../with-interfaces/README.md | 30 +++- .../with-interfaces/api.module.ts | 15 +- .../npm/.swagger-codegen/VERSION | 2 +- .../typescript-angular-v4.3/npm/README.md | 34 +++- .../typescript-angular-v4.3/npm/api.module.ts | 15 +- .../npm/rxjs-operators.ts | 11 ++ .../npm/.swagger-codegen/VERSION | 2 +- .../typescript-angular-v4/npm/README.md | 30 +++- .../typescript-angular-v4/npm/api.module.ts | 15 +- 19 files changed, 389 insertions(+), 44 deletions(-) create mode 100644 samples/client/petstore/typescript-angular-v2/default/README.md create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/rxjs-operators.ts diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java index 71eabaa4fad..a529711a5cf 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java @@ -93,6 +93,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("encoder.mustache", getIndexDirectory(), "encoder.ts")); supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); + supportingFiles.add(new SupportingFile("README.mustache", getIndexDirectory(), "README.md")); if (additionalProperties.containsKey(NPM_NAME)) { addNpmPackageGeneration(); @@ -143,7 +144,6 @@ private void addNpmPackageGeneration() { } //Files for building our lib - supportingFiles.add(new SupportingFile("README.mustache", getIndexDirectory(), "README.md")); supportingFiles.add(new SupportingFile("package.mustache", getIndexDirectory(), "package.json")); supportingFiles.add(new SupportingFile("typings.mustache", getIndexDirectory(), "typings.json")); supportingFiles.add(new SupportingFile("tsconfig.mustache", getIndexDirectory(), "tsconfig.json")); diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/README.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/README.mustache index c48b905d4cf..4025896cafa 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/README.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/README.mustache @@ -46,9 +46,16 @@ In your Angular project: ``` // without configuring providers import { ApiModule } from '{{npmName}}'; +{{#useHttpClient}}import { HttpClientModule } from '@angular/common/http';{{/useHttpClient}} +{{^useHttpClient}}import { HttpModule } from '@angular/http';{{/useHttpClient}} @NgModule({ - imports: [ ApiModule ], + imports: [ + ApiModule, + {{#useHttpClient}}// make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule{{/useHttpClient}}{{^useHttpClient}}HttpModule{{/useHttpClient}} + ], declarations: [ AppComponent ], providers: [], bootstrap: [ AppComponent ] @@ -87,6 +94,31 @@ export class AppComponent { Note: The ApiModule is restricted to being instantiated once app wide. This is to ensure that all services are treated as singletons. +#### Using multiple swagger files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different swagger files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +{{#useHttpClient}}import { HttpClientModule } from '@angular/common/http';{{/useHttpClient}} +{{^useHttpClient}}import { HttpModule } from '@angular/http';{{/useHttpClient}} + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + {{#useHttpClient}}// make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule{{/useHttpClient}}{{^useHttpClient}}HttpModule{{/useHttpClient}} + ] +}) +export class AppModule { + +} +``` + + ### Set service base path If different than the generated base path, during app bootstrap, you can provide the base path to your service. diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/api.module.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.module.mustache index f4ae7435980..f5afbdc552e 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/api.module.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/api.module.mustache @@ -1,12 +1,7 @@ import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; -import { CommonModule } from '@angular/common'; -{{#useHttpClient}} -import { HttpClientModule } from '@angular/common/http'; -{{/useHttpClient}} -{{^useHttpClient}} -import { HttpModule } from '@angular/http'; -{{/useHttpClient}} import { Configuration } from './configuration'; +{{#useHttpClient}}import { HttpClient } from '@angular/common/http';{{/useHttpClient}} +{{^useHttpClient}}import { Http } from '@angular/http';{{/useHttpClient}} {{#apiInfo}} {{#apis}} @@ -15,7 +10,7 @@ import { {{classname}} } from './{{importPath}}'; {{/apiInfo}} @NgModule({ - imports: [ CommonModule, {{#useHttpClient}}HttpClientModule{{/useHttpClient}}{{^useHttpClient}}HttpModule{{/useHttpClient}} ], + imports: [], declarations: [], exports: [], providers: [ @@ -30,9 +25,14 @@ export class ApiModule { } } - constructor( @Optional() @SkipSelf() parentModule: ApiModule) { + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: {{#useHttpClient}}HttpClient{{/useHttpClient}}{{^useHttpClient}}Http{{/useHttpClient}}) { if (parentModule) { - throw new Error('ApiModule is already loaded. Import your base AppModule only.'); + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the {{#useHttpClient}}HttpClientModule{{/useHttpClient}}{{^useHttpClient}}HttpModule{{/useHttpClient}} in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); } } } diff --git a/samples/client/petstore/typescript-angular-v2/default/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v2/default/.swagger-codegen/VERSION index cc6612c36e0..50794f17f1a 100644 --- a/samples/client/petstore/typescript-angular-v2/default/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v2/default/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0 \ No newline at end of file +2.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v2/default/README.md b/samples/client/petstore/typescript-angular-v2/default/README.md new file mode 100644 index 00000000000..d1eaaa92928 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v2/default/README.md @@ -0,0 +1,167 @@ +## @ + +### Building + +To build an compile the typescript sources to javascript use: +``` +npm install +npm run build +``` + +### publishing + +First build the package than run ```npm publish``` + +### consuming + +navigate to the folder of your consuming project and run one of next commando's. + +_published:_ + +``` +npm install @ --save +``` + +_unPublished (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE --save +``` + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE: +``` +npm link +``` + +In your project: +``` +npm link @ +``` + +In your Angular project: + + +``` +// without configuring providers +import { ApiModule } from ''; + +import { HttpModule } from '@angular/http'; + +@NgModule({ + imports: [ + ApiModule, + HttpModule + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from ''; + +export function apiConfigFactory (): Configuration => { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from ''; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple swagger files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different swagger files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; + +import { HttpModule } from '@angular/http'; + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + HttpModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from ''; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from ''; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @angular/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from ''; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v2/default/api.module.ts b/samples/client/petstore/typescript-angular-v2/default/api.module.ts index 4b290cd5a49..1504d60e630 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api.module.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api.module.ts @@ -1,14 +1,14 @@ import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { HttpModule } from '@angular/http'; import { Configuration } from './configuration'; +import { Http } from '@angular/http'; + import { PetService } from './api/pet.service'; import { StoreService } from './api/store.service'; import { UserService } from './api/user.service'; @NgModule({ - imports: [ CommonModule, HttpModule ], + imports: [], declarations: [], exports: [], providers: [ @@ -24,9 +24,14 @@ export class ApiModule { } } - constructor( @Optional() @SkipSelf() parentModule: ApiModule) { + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: Http) { if (parentModule) { - throw new Error('ApiModule is already loaded. Import your base AppModule only.'); + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); } } } diff --git a/samples/client/petstore/typescript-angular-v2/npm/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v2/npm/.swagger-codegen/VERSION index cc6612c36e0..50794f17f1a 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v2/npm/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0 \ No newline at end of file +2.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v2/npm/README.md b/samples/client/petstore/typescript-angular-v2/npm/README.md index afa7807e82a..507613134c5 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/README.md +++ b/samples/client/petstore/typescript-angular-v2/npm/README.md @@ -47,8 +47,13 @@ In your Angular project: // without configuring providers import { ApiModule } from '@swagger/angular2-typescript-petstore'; +import { HttpModule } from '@angular/http'; + @NgModule({ - imports: [ ApiModule ], + imports: [ + ApiModule, + HttpModule + ], declarations: [ AppComponent ], providers: [], bootstrap: [ AppComponent ] @@ -87,6 +92,29 @@ export class AppComponent { Note: The ApiModule is restricted to being instantiated once app wide. This is to ensure that all services are treated as singletons. +#### Using multiple swagger files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different swagger files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; + +import { HttpModule } from '@angular/http'; + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + HttpModule + ] +}) +export class AppModule { + +} +``` + + ### Set service base path If different than the generated base path, during app bootstrap, you can provide the base path to your service. diff --git a/samples/client/petstore/typescript-angular-v2/npm/api.module.ts b/samples/client/petstore/typescript-angular-v2/npm/api.module.ts index 4b290cd5a49..e192f195ab4 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api.module.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api.module.ts @@ -1,6 +1,5 @@ import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { HttpModule } from '@angular/http'; import { Configuration } from './configuration'; import { PetService } from './api/pet.service'; @@ -8,7 +7,7 @@ import { StoreService } from './api/store.service'; import { UserService } from './api/user.service'; @NgModule({ - imports: [ CommonModule, HttpModule ], + imports: [], declarations: [], exports: [], providers: [ @@ -26,7 +25,7 @@ export class ApiModule { constructor( @Optional() @SkipSelf() parentModule: ApiModule) { if (parentModule) { - throw new Error('ApiModule is already loaded. Import your base AppModule only.'); + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); } } } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v2/with-interfaces/.swagger-codegen/VERSION index cc6612c36e0..50794f17f1a 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0 \ No newline at end of file +2.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/README.md b/samples/client/petstore/typescript-angular-v2/with-interfaces/README.md index afa7807e82a..507613134c5 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/README.md +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/README.md @@ -47,8 +47,13 @@ In your Angular project: // without configuring providers import { ApiModule } from '@swagger/angular2-typescript-petstore'; +import { HttpModule } from '@angular/http'; + @NgModule({ - imports: [ ApiModule ], + imports: [ + ApiModule, + HttpModule + ], declarations: [ AppComponent ], providers: [], bootstrap: [ AppComponent ] @@ -87,6 +92,29 @@ export class AppComponent { Note: The ApiModule is restricted to being instantiated once app wide. This is to ensure that all services are treated as singletons. +#### Using multiple swagger files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different swagger files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; + +import { HttpModule } from '@angular/http'; + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + HttpModule + ] +}) +export class AppModule { + +} +``` + + ### Set service base path If different than the generated base path, during app bootstrap, you can provide the base path to your service. diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api.module.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api.module.ts index 4b290cd5a49..1504d60e630 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api.module.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api.module.ts @@ -1,14 +1,14 @@ import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { HttpModule } from '@angular/http'; import { Configuration } from './configuration'; +import { Http } from '@angular/http'; + import { PetService } from './api/pet.service'; import { StoreService } from './api/store.service'; import { UserService } from './api/user.service'; @NgModule({ - imports: [ CommonModule, HttpModule ], + imports: [], declarations: [], exports: [], providers: [ @@ -24,9 +24,14 @@ export class ApiModule { } } - constructor( @Optional() @SkipSelf() parentModule: ApiModule) { + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: Http) { if (parentModule) { - throw new Error('ApiModule is already loaded. Import your base AppModule only.'); + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); } } } diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen/VERSION index cc6612c36e0..50794f17f1a 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0 \ No newline at end of file +2.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/README.md b/samples/client/petstore/typescript-angular-v4.3/npm/README.md index afa7807e82a..211bb2292fb 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/README.md +++ b/samples/client/petstore/typescript-angular-v4.3/npm/README.md @@ -46,9 +46,16 @@ In your Angular project: ``` // without configuring providers import { ApiModule } from '@swagger/angular2-typescript-petstore'; +import { HttpClientModule } from '@angular/common/http'; + @NgModule({ - imports: [ ApiModule ], + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ], declarations: [ AppComponent ], providers: [], bootstrap: [ AppComponent ] @@ -87,6 +94,31 @@ export class AppComponent { Note: The ApiModule is restricted to being instantiated once app wide. This is to ensure that all services are treated as singletons. +#### Using multiple swagger files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different swagger files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpClientModule } from '@angular/common/http'; + + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + + ### Set service base path If different than the generated base path, during app bootstrap, you can provide the base path to your service. diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api.module.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api.module.ts index b18695a280a..72f2a15ddcb 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api.module.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api.module.ts @@ -1,14 +1,14 @@ import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { HttpClientModule } from '@angular/common/http'; import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + import { PetService } from './api/pet.service'; import { StoreService } from './api/store.service'; import { UserService } from './api/user.service'; @NgModule({ - imports: [ CommonModule, HttpClientModule ], + imports: [], declarations: [], exports: [], providers: [ @@ -24,9 +24,14 @@ export class ApiModule { } } - constructor( @Optional() @SkipSelf() parentModule: ApiModule) { + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { if (parentModule) { - throw new Error('ApiModule is already loaded. Import your base AppModule only.'); + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); } } } diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/rxjs-operators.ts b/samples/client/petstore/typescript-angular-v4.3/npm/rxjs-operators.ts new file mode 100644 index 00000000000..5659cd0694f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/rxjs-operators.ts @@ -0,0 +1,11 @@ +// RxJS imports according to https://angular.io/docs/ts/latest/guide/server-communication.html#!#rxjs + +// See node_module/rxjs/Rxjs.js +// Import just the rxjs statics and operators we need for THIS app. + +// Statics +import 'rxjs/add/observable/throw'; + +// Operators +import 'rxjs/add/operator/catch'; +import 'rxjs/add/operator/map'; diff --git a/samples/client/petstore/typescript-angular-v4/npm/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v4/npm/.swagger-codegen/VERSION index cc6612c36e0..50794f17f1a 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v4/npm/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.0 \ No newline at end of file +2.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v4/npm/README.md b/samples/client/petstore/typescript-angular-v4/npm/README.md index afa7807e82a..507613134c5 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/README.md +++ b/samples/client/petstore/typescript-angular-v4/npm/README.md @@ -47,8 +47,13 @@ In your Angular project: // without configuring providers import { ApiModule } from '@swagger/angular2-typescript-petstore'; +import { HttpModule } from '@angular/http'; + @NgModule({ - imports: [ ApiModule ], + imports: [ + ApiModule, + HttpModule + ], declarations: [ AppComponent ], providers: [], bootstrap: [ AppComponent ] @@ -87,6 +92,29 @@ export class AppComponent { Note: The ApiModule is restricted to being instantiated once app wide. This is to ensure that all services are treated as singletons. +#### Using multiple swagger files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different swagger files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; + +import { HttpModule } from '@angular/http'; + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + HttpModule + ] +}) +export class AppModule { + +} +``` + + ### Set service base path If different than the generated base path, during app bootstrap, you can provide the base path to your service. diff --git a/samples/client/petstore/typescript-angular-v4/npm/api.module.ts b/samples/client/petstore/typescript-angular-v4/npm/api.module.ts index 4b290cd5a49..1504d60e630 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api.module.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api.module.ts @@ -1,14 +1,14 @@ import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { HttpModule } from '@angular/http'; import { Configuration } from './configuration'; +import { Http } from '@angular/http'; + import { PetService } from './api/pet.service'; import { StoreService } from './api/store.service'; import { UserService } from './api/user.service'; @NgModule({ - imports: [ CommonModule, HttpModule ], + imports: [], declarations: [], exports: [], providers: [ @@ -24,9 +24,14 @@ export class ApiModule { } } - constructor( @Optional() @SkipSelf() parentModule: ApiModule) { + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: Http) { if (parentModule) { - throw new Error('ApiModule is already loaded. Import your base AppModule only.'); + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); } } } From 59ff4c198be4581fd6edcf30a2784828b568cf9f Mon Sep 17 00:00:00 2001 From: ccozzolino Date: Sat, 20 Jan 2018 00:31:06 -0600 Subject: [PATCH 64/65] =?UTF-8?q?[Java][library:=20vertx]=20Add=20default?= =?UTF-8?q?=20value=20and=20required=20parameter=20support=20to=20vertx=20?= =?UTF-8?q?server=20temp=E2=80=A6=20(#7410)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add default value and required parameter support to vertx server templates. Fix for #7409. * Added missing serviceId declaration to workaround #allParams section clearing the vendorExtensions map --- .../JavaVertXServer/apiVerticle.mustache | 48 +++++++++- .../java-vertx/async/.swagger-codegen/VERSION | 2 +- .../server/api/verticle/PetApiVerticle.java | 95 ++++++++++++++++--- .../server/api/verticle/StoreApiVerticle.java | 29 +++++- .../server/api/verticle/UserApiVerticle.java | 83 +++++++++++++--- .../java-vertx/rx/.swagger-codegen/VERSION | 2 +- .../server/api/verticle/PetApiVerticle.java | 95 ++++++++++++++++--- .../server/api/verticle/StoreApiVerticle.java | 29 +++++- .../server/api/verticle/UserApiVerticle.java | 83 +++++++++++++--- 9 files changed, 401 insertions(+), 65 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaVertXServer/apiVerticle.mustache b/modules/swagger-codegen/src/main/resources/JavaVertXServer/apiVerticle.mustache index 74b976f66a7..ad95c328257 100644 --- a/modules/swagger-codegen/src/main/resources/JavaVertXServer/apiVerticle.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaVertXServer/apiVerticle.mustache @@ -37,23 +37,61 @@ public class {{classname}}Verticle extends AbstractVerticle { //Consumer for {{#vendorExtensions}}{{x-serviceid}}{{/vendorExtensions}} vertx.eventBus(). consumer({{#vendorExtensions}}{{x-serviceid-varname}}{{/vendorExtensions}}).handler(message -> { try { + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "{{#vendorExtensions}}{{x-serviceid}}{{/vendorExtensions}}"; {{#hasParams}} {{#allParams}} {{#isListContainer}} - {{{dataType}}} {{paramName}} = Json.mapper.readValue(message.body().getJsonArray("{{baseName}}").encode(), - Json.mapper.getTypeFactory().constructCollectionType(List.class, {{{baseType}}}.class)); + JsonArray {{paramName}}Param = message.body().getJsonArray("{{baseName}}"); + {{#required}} + if({{paramName}}Param == null) { + manageError(message, new MainApiException(400, "{{baseName}} is required"), serviceId); + return; + } + {{{dataType}}} {{paramName}} = Json.mapper.readValue({{paramName}}Param.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, {{{baseType}}}.class)); + {{/required}} + {{^required}} + {{{dataType}}} {{paramName}} = ({{paramName}}Param == null) ? {{#defaultValue}}{{defaultValue}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} : Json.mapper.readValue({{paramName}}Param.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, {{{baseType}}}.class)); + {{/required}} {{/isListContainer}} {{^isListContainer}} {{#isPrimitiveType}} {{#isString}} - {{{dataType}}} {{paramName}} = message.body().getString("{{baseName}}"); + String {{paramName}}Param = message.body().getString("{{baseName}}"); + {{#required}} + if({{paramName}}Param == null) { + manageError(message, new MainApiException(400, "{{baseName}} is required"), serviceId); + return; + } + {{{dataType}}} {{paramName}} = {{paramName}}Param; + {{/required}} + {{^required}} + {{{dataType}}} {{paramName}} = ({{paramName}}Param == null) ? {{#defaultValue}}{{defaultValue}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} : {{paramName}}Param; + {{/required}} {{/isString}} {{^isString}} - {{{dataType}}} {{paramName}} = Json.mapper.readValue(message.body().getString("{{baseName}}"), {{{dataType}}}.class); + String {{paramName}}Param = message.body().getString("{{baseName}}"); + {{#required}} + if({{paramName}}Param == null) { + manageError(message, new MainApiException(400, "{{baseName}} is required"), serviceId); + return; + } + {{{dataType}}} {{paramName}} = Json.mapper.readValue({{paramName}}Param, {{{dataType}}}.class); + {{/required}} + {{^required}} + {{{dataType}}} {{paramName}} = ({{paramName}}Param == null) ? {{#defaultValue}}{{defaultValue}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} : Json.mapper.readValue({{paramName}}Param, {{{dataType}}}.class); + {{/required}} {{/isString}} {{/isPrimitiveType}} {{^isPrimitiveType}} - {{{dataType}}} {{paramName}} = Json.mapper.readValue(message.body().getJsonObject("{{baseName}}").encode(), {{{dataType}}}.class); + JsonObject {{paramName}}Param = message.body().getJsonObject("{{baseName}}"); + if ({{paramName}}Param == null) { + manageError(message, new MainApiException(400, "{{baseName}} is required"), serviceId); + return; + } + {{{dataType}}} {{paramName}} = Json.mapper.readValue({{paramName}}Param.encode(), {{{dataType}}}.class); {{/isPrimitiveType}} {{/isListContainer}} {{/allParams}} diff --git a/samples/server/petstore/java-vertx/async/.swagger-codegen/VERSION b/samples/server/petstore/java-vertx/async/.swagger-codegen/VERSION index 50794f17f1a..a6254504e40 100644 --- a/samples/server/petstore/java-vertx/async/.swagger-codegen/VERSION +++ b/samples/server/petstore/java-vertx/async/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +2.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java b/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java index f97369e6ad3..4746d134285 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java @@ -46,7 +46,14 @@ public void start() throws Exception { //Consumer for addPet vertx.eventBus(). consumer(ADDPET_SERVICE_ID).handler(message -> { try { - Pet body = Json.mapper.readValue(message.body().getJsonObject("body").encode(), Pet.class); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "addPet"; + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); + return; + } + Pet body = Json.mapper.readValue(bodyParam.encode(), Pet.class); service.addPet(body, result -> { if (result.succeeded()) message.reply(null); @@ -64,8 +71,16 @@ public void start() throws Exception { //Consumer for deletePet vertx.eventBus(). consumer(DELETEPET_SERVICE_ID).handler(message -> { try { - Long petId = Json.mapper.readValue(message.body().getString("petId"), Long.class); - String apiKey = message.body().getString("api_key"); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "deletePet"; + String petIdParam = message.body().getString("petId"); + if(petIdParam == null) { + manageError(message, new MainApiException(400, "petId is required"), serviceId); + return; + } + Long petId = Json.mapper.readValue(petIdParam, Long.class); + String apiKeyParam = message.body().getString("api_key"); + String apiKey = (apiKeyParam == null) ? null : apiKeyParam; service.deletePet(petId, apiKey, result -> { if (result.succeeded()) message.reply(null); @@ -83,8 +98,15 @@ public void start() throws Exception { //Consumer for findPetsByStatus vertx.eventBus(). consumer(FINDPETSBYSTATUS_SERVICE_ID).handler(message -> { try { - List status = Json.mapper.readValue(message.body().getJsonArray("status").encode(), - Json.mapper.getTypeFactory().constructCollectionType(List.class, String.class)); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "findPetsByStatus"; + JsonArray statusParam = message.body().getJsonArray("status"); + if(statusParam == null) { + manageError(message, new MainApiException(400, "status is required"), serviceId); + return; + } + List status = Json.mapper.readValue(statusParam.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, String.class)); service.findPetsByStatus(status, result -> { if (result.succeeded()) message.reply(new JsonArray(Json.encode(result.result())).encodePrettily()); @@ -102,8 +124,15 @@ public void start() throws Exception { //Consumer for findPetsByTags vertx.eventBus(). consumer(FINDPETSBYTAGS_SERVICE_ID).handler(message -> { try { - List tags = Json.mapper.readValue(message.body().getJsonArray("tags").encode(), - Json.mapper.getTypeFactory().constructCollectionType(List.class, String.class)); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "findPetsByTags"; + JsonArray tagsParam = message.body().getJsonArray("tags"); + if(tagsParam == null) { + manageError(message, new MainApiException(400, "tags is required"), serviceId); + return; + } + List tags = Json.mapper.readValue(tagsParam.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, String.class)); service.findPetsByTags(tags, result -> { if (result.succeeded()) message.reply(new JsonArray(Json.encode(result.result())).encodePrettily()); @@ -121,7 +150,14 @@ public void start() throws Exception { //Consumer for getPetById vertx.eventBus(). consumer(GETPETBYID_SERVICE_ID).handler(message -> { try { - Long petId = Json.mapper.readValue(message.body().getString("petId"), Long.class); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "getPetById"; + String petIdParam = message.body().getString("petId"); + if(petIdParam == null) { + manageError(message, new MainApiException(400, "petId is required"), serviceId); + return; + } + Long petId = Json.mapper.readValue(petIdParam, Long.class); service.getPetById(petId, result -> { if (result.succeeded()) message.reply(new JsonObject(Json.encode(result.result())).encodePrettily()); @@ -139,7 +175,14 @@ public void start() throws Exception { //Consumer for updatePet vertx.eventBus(). consumer(UPDATEPET_SERVICE_ID).handler(message -> { try { - Pet body = Json.mapper.readValue(message.body().getJsonObject("body").encode(), Pet.class); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "updatePet"; + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); + return; + } + Pet body = Json.mapper.readValue(bodyParam.encode(), Pet.class); service.updatePet(body, result -> { if (result.succeeded()) message.reply(null); @@ -157,9 +200,18 @@ public void start() throws Exception { //Consumer for updatePetWithForm vertx.eventBus(). consumer(UPDATEPETWITHFORM_SERVICE_ID).handler(message -> { try { - Long petId = Json.mapper.readValue(message.body().getString("petId"), Long.class); - String name = message.body().getString("name"); - String status = message.body().getString("status"); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "updatePetWithForm"; + String petIdParam = message.body().getString("petId"); + if(petIdParam == null) { + manageError(message, new MainApiException(400, "petId is required"), serviceId); + return; + } + Long petId = Json.mapper.readValue(petIdParam, Long.class); + String nameParam = message.body().getString("name"); + String name = (nameParam == null) ? null : nameParam; + String statusParam = message.body().getString("status"); + String status = (statusParam == null) ? null : statusParam; service.updatePetWithForm(petId, name, status, result -> { if (result.succeeded()) message.reply(null); @@ -177,9 +229,22 @@ public void start() throws Exception { //Consumer for uploadFile vertx.eventBus(). consumer(UPLOADFILE_SERVICE_ID).handler(message -> { try { - Long petId = Json.mapper.readValue(message.body().getString("petId"), Long.class); - String additionalMetadata = message.body().getString("additionalMetadata"); - File file = Json.mapper.readValue(message.body().getJsonObject("file").encode(), File.class); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "uploadFile"; + String petIdParam = message.body().getString("petId"); + if(petIdParam == null) { + manageError(message, new MainApiException(400, "petId is required"), serviceId); + return; + } + Long petId = Json.mapper.readValue(petIdParam, Long.class); + String additionalMetadataParam = message.body().getString("additionalMetadata"); + String additionalMetadata = (additionalMetadataParam == null) ? null : additionalMetadataParam; + JsonObject fileParam = message.body().getJsonObject("file"); + if (fileParam == null) { + manageError(message, new MainApiException(400, "file is required"), serviceId); + return; + } + File file = Json.mapper.readValue(fileParam.encode(), File.class); service.uploadFile(petId, additionalMetadata, file, result -> { if (result.succeeded()) message.reply(new JsonObject(Json.encode(result.result())).encodePrettily()); diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java b/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java index cc11fa49a2c..e2f608589bf 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java @@ -40,7 +40,14 @@ public void start() throws Exception { //Consumer for deleteOrder vertx.eventBus(). consumer(DELETEORDER_SERVICE_ID).handler(message -> { try { - String orderId = message.body().getString("orderId"); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "deleteOrder"; + String orderIdParam = message.body().getString("orderId"); + if(orderIdParam == null) { + manageError(message, new MainApiException(400, "orderId is required"), serviceId); + return; + } + String orderId = orderIdParam; service.deleteOrder(orderId, result -> { if (result.succeeded()) message.reply(null); @@ -58,6 +65,8 @@ public void start() throws Exception { //Consumer for getInventory vertx.eventBus(). consumer(GETINVENTORY_SERVICE_ID).handler(message -> { try { + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "getInventory"; service.getInventory(result -> { if (result.succeeded()) message.reply(new JsonObject(Json.encode(result.result())).encodePrettily()); @@ -75,7 +84,14 @@ public void start() throws Exception { //Consumer for getOrderById vertx.eventBus(). consumer(GETORDERBYID_SERVICE_ID).handler(message -> { try { - Long orderId = Json.mapper.readValue(message.body().getString("orderId"), Long.class); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "getOrderById"; + String orderIdParam = message.body().getString("orderId"); + if(orderIdParam == null) { + manageError(message, new MainApiException(400, "orderId is required"), serviceId); + return; + } + Long orderId = Json.mapper.readValue(orderIdParam, Long.class); service.getOrderById(orderId, result -> { if (result.succeeded()) message.reply(new JsonObject(Json.encode(result.result())).encodePrettily()); @@ -93,7 +109,14 @@ public void start() throws Exception { //Consumer for placeOrder vertx.eventBus(). consumer(PLACEORDER_SERVICE_ID).handler(message -> { try { - Order body = Json.mapper.readValue(message.body().getJsonObject("body").encode(), Order.class); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "placeOrder"; + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); + return; + } + Order body = Json.mapper.readValue(bodyParam.encode(), Order.class); service.placeOrder(body, result -> { if (result.succeeded()) message.reply(new JsonObject(Json.encode(result.result())).encodePrettily()); diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java b/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java index 70070fd59b4..5021215f4d1 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java @@ -44,7 +44,14 @@ public void start() throws Exception { //Consumer for createUser vertx.eventBus(). consumer(CREATEUSER_SERVICE_ID).handler(message -> { try { - User body = Json.mapper.readValue(message.body().getJsonObject("body").encode(), User.class); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "createUser"; + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); + return; + } + User body = Json.mapper.readValue(bodyParam.encode(), User.class); service.createUser(body, result -> { if (result.succeeded()) message.reply(null); @@ -62,8 +69,15 @@ public void start() throws Exception { //Consumer for createUsersWithArrayInput vertx.eventBus(). consumer(CREATEUSERSWITHARRAYINPUT_SERVICE_ID).handler(message -> { try { - List body = Json.mapper.readValue(message.body().getJsonArray("body").encode(), - Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class)); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "createUsersWithArrayInput"; + JsonArray bodyParam = message.body().getJsonArray("body"); + if(bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); + return; + } + List body = Json.mapper.readValue(bodyParam.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class)); service.createUsersWithArrayInput(body, result -> { if (result.succeeded()) message.reply(null); @@ -81,8 +95,15 @@ public void start() throws Exception { //Consumer for createUsersWithListInput vertx.eventBus(). consumer(CREATEUSERSWITHLISTINPUT_SERVICE_ID).handler(message -> { try { - List body = Json.mapper.readValue(message.body().getJsonArray("body").encode(), - Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class)); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "createUsersWithListInput"; + JsonArray bodyParam = message.body().getJsonArray("body"); + if(bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); + return; + } + List body = Json.mapper.readValue(bodyParam.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class)); service.createUsersWithListInput(body, result -> { if (result.succeeded()) message.reply(null); @@ -100,7 +121,14 @@ public void start() throws Exception { //Consumer for deleteUser vertx.eventBus(). consumer(DELETEUSER_SERVICE_ID).handler(message -> { try { - String username = message.body().getString("username"); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "deleteUser"; + String usernameParam = message.body().getString("username"); + if(usernameParam == null) { + manageError(message, new MainApiException(400, "username is required"), serviceId); + return; + } + String username = usernameParam; service.deleteUser(username, result -> { if (result.succeeded()) message.reply(null); @@ -118,7 +146,14 @@ public void start() throws Exception { //Consumer for getUserByName vertx.eventBus(). consumer(GETUSERBYNAME_SERVICE_ID).handler(message -> { try { - String username = message.body().getString("username"); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "getUserByName"; + String usernameParam = message.body().getString("username"); + if(usernameParam == null) { + manageError(message, new MainApiException(400, "username is required"), serviceId); + return; + } + String username = usernameParam; service.getUserByName(username, result -> { if (result.succeeded()) message.reply(new JsonObject(Json.encode(result.result())).encodePrettily()); @@ -136,8 +171,20 @@ public void start() throws Exception { //Consumer for loginUser vertx.eventBus(). consumer(LOGINUSER_SERVICE_ID).handler(message -> { try { - String username = message.body().getString("username"); - String password = message.body().getString("password"); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "loginUser"; + String usernameParam = message.body().getString("username"); + if(usernameParam == null) { + manageError(message, new MainApiException(400, "username is required"), serviceId); + return; + } + String username = usernameParam; + String passwordParam = message.body().getString("password"); + if(passwordParam == null) { + manageError(message, new MainApiException(400, "password is required"), serviceId); + return; + } + String password = passwordParam; service.loginUser(username, password, result -> { if (result.succeeded()) message.reply(new JsonObject(Json.encode(result.result())).encodePrettily()); @@ -155,6 +202,8 @@ public void start() throws Exception { //Consumer for logoutUser vertx.eventBus(). consumer(LOGOUTUSER_SERVICE_ID).handler(message -> { try { + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "logoutUser"; service.logoutUser(result -> { if (result.succeeded()) message.reply(null); @@ -172,8 +221,20 @@ public void start() throws Exception { //Consumer for updateUser vertx.eventBus(). consumer(UPDATEUSER_SERVICE_ID).handler(message -> { try { - String username = message.body().getString("username"); - User body = Json.mapper.readValue(message.body().getJsonObject("body").encode(), User.class); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "updateUser"; + String usernameParam = message.body().getString("username"); + if(usernameParam == null) { + manageError(message, new MainApiException(400, "username is required"), serviceId); + return; + } + String username = usernameParam; + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); + return; + } + User body = Json.mapper.readValue(bodyParam.encode(), User.class); service.updateUser(username, body, result -> { if (result.succeeded()) message.reply(null); diff --git a/samples/server/petstore/java-vertx/rx/.swagger-codegen/VERSION b/samples/server/petstore/java-vertx/rx/.swagger-codegen/VERSION index 50794f17f1a..a6254504e40 100644 --- a/samples/server/petstore/java-vertx/rx/.swagger-codegen/VERSION +++ b/samples/server/petstore/java-vertx/rx/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +2.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java b/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java index 1b7e08c336e..c3999ff191a 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java @@ -46,7 +46,14 @@ public void start() throws Exception { //Consumer for addPet vertx.eventBus(). consumer(ADDPET_SERVICE_ID).handler(message -> { try { - Pet body = Json.mapper.readValue(message.body().getJsonObject("body").encode(), Pet.class); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "addPet"; + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); + return; + } + Pet body = Json.mapper.readValue(bodyParam.encode(), Pet.class); service.addPet(body).subscribe( () -> { message.reply(null); @@ -63,8 +70,16 @@ public void start() throws Exception { //Consumer for deletePet vertx.eventBus(). consumer(DELETEPET_SERVICE_ID).handler(message -> { try { - Long petId = Json.mapper.readValue(message.body().getString("petId"), Long.class); - String apiKey = message.body().getString("api_key"); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "deletePet"; + String petIdParam = message.body().getString("petId"); + if(petIdParam == null) { + manageError(message, new MainApiException(400, "petId is required"), serviceId); + return; + } + Long petId = Json.mapper.readValue(petIdParam, Long.class); + String apiKeyParam = message.body().getString("api_key"); + String apiKey = (apiKeyParam == null) ? null : apiKeyParam; service.deletePet(petId, apiKey).subscribe( () -> { message.reply(null); @@ -81,8 +96,15 @@ public void start() throws Exception { //Consumer for findPetsByStatus vertx.eventBus(). consumer(FINDPETSBYSTATUS_SERVICE_ID).handler(message -> { try { - List status = Json.mapper.readValue(message.body().getJsonArray("status").encode(), - Json.mapper.getTypeFactory().constructCollectionType(List.class, String.class)); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "findPetsByStatus"; + JsonArray statusParam = message.body().getJsonArray("status"); + if(statusParam == null) { + manageError(message, new MainApiException(400, "status is required"), serviceId); + return; + } + List status = Json.mapper.readValue(statusParam.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, String.class)); service.findPetsByStatus(status).subscribe( result -> { message.reply(new JsonArray(Json.encode(result)).encodePrettily()); @@ -99,8 +121,15 @@ public void start() throws Exception { //Consumer for findPetsByTags vertx.eventBus(). consumer(FINDPETSBYTAGS_SERVICE_ID).handler(message -> { try { - List tags = Json.mapper.readValue(message.body().getJsonArray("tags").encode(), - Json.mapper.getTypeFactory().constructCollectionType(List.class, String.class)); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "findPetsByTags"; + JsonArray tagsParam = message.body().getJsonArray("tags"); + if(tagsParam == null) { + manageError(message, new MainApiException(400, "tags is required"), serviceId); + return; + } + List tags = Json.mapper.readValue(tagsParam.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, String.class)); service.findPetsByTags(tags).subscribe( result -> { message.reply(new JsonArray(Json.encode(result)).encodePrettily()); @@ -117,7 +146,14 @@ public void start() throws Exception { //Consumer for getPetById vertx.eventBus(). consumer(GETPETBYID_SERVICE_ID).handler(message -> { try { - Long petId = Json.mapper.readValue(message.body().getString("petId"), Long.class); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "getPetById"; + String petIdParam = message.body().getString("petId"); + if(petIdParam == null) { + manageError(message, new MainApiException(400, "petId is required"), serviceId); + return; + } + Long petId = Json.mapper.readValue(petIdParam, Long.class); service.getPetById(petId).subscribe( result -> { message.reply(new JsonObject(Json.encode(result)).encodePrettily()); @@ -134,7 +170,14 @@ public void start() throws Exception { //Consumer for updatePet vertx.eventBus(). consumer(UPDATEPET_SERVICE_ID).handler(message -> { try { - Pet body = Json.mapper.readValue(message.body().getJsonObject("body").encode(), Pet.class); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "updatePet"; + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); + return; + } + Pet body = Json.mapper.readValue(bodyParam.encode(), Pet.class); service.updatePet(body).subscribe( () -> { message.reply(null); @@ -151,9 +194,18 @@ public void start() throws Exception { //Consumer for updatePetWithForm vertx.eventBus(). consumer(UPDATEPETWITHFORM_SERVICE_ID).handler(message -> { try { - Long petId = Json.mapper.readValue(message.body().getString("petId"), Long.class); - String name = message.body().getString("name"); - String status = message.body().getString("status"); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "updatePetWithForm"; + String petIdParam = message.body().getString("petId"); + if(petIdParam == null) { + manageError(message, new MainApiException(400, "petId is required"), serviceId); + return; + } + Long petId = Json.mapper.readValue(petIdParam, Long.class); + String nameParam = message.body().getString("name"); + String name = (nameParam == null) ? null : nameParam; + String statusParam = message.body().getString("status"); + String status = (statusParam == null) ? null : statusParam; service.updatePetWithForm(petId, name, status).subscribe( () -> { message.reply(null); @@ -170,9 +222,22 @@ public void start() throws Exception { //Consumer for uploadFile vertx.eventBus(). consumer(UPLOADFILE_SERVICE_ID).handler(message -> { try { - Long petId = Json.mapper.readValue(message.body().getString("petId"), Long.class); - String additionalMetadata = message.body().getString("additionalMetadata"); - File file = Json.mapper.readValue(message.body().getJsonObject("file").encode(), File.class); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "uploadFile"; + String petIdParam = message.body().getString("petId"); + if(petIdParam == null) { + manageError(message, new MainApiException(400, "petId is required"), serviceId); + return; + } + Long petId = Json.mapper.readValue(petIdParam, Long.class); + String additionalMetadataParam = message.body().getString("additionalMetadata"); + String additionalMetadata = (additionalMetadataParam == null) ? null : additionalMetadataParam; + JsonObject fileParam = message.body().getJsonObject("file"); + if (fileParam == null) { + manageError(message, new MainApiException(400, "file is required"), serviceId); + return; + } + File file = Json.mapper.readValue(fileParam.encode(), File.class); service.uploadFile(petId, additionalMetadata, file).subscribe( result -> { message.reply(new JsonObject(Json.encode(result)).encodePrettily()); diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java b/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java index 67353e8ac87..8d15fb4c040 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java @@ -40,7 +40,14 @@ public void start() throws Exception { //Consumer for deleteOrder vertx.eventBus(). consumer(DELETEORDER_SERVICE_ID).handler(message -> { try { - String orderId = message.body().getString("orderId"); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "deleteOrder"; + String orderIdParam = message.body().getString("orderId"); + if(orderIdParam == null) { + manageError(message, new MainApiException(400, "orderId is required"), serviceId); + return; + } + String orderId = orderIdParam; service.deleteOrder(orderId).subscribe( () -> { message.reply(null); @@ -57,6 +64,8 @@ public void start() throws Exception { //Consumer for getInventory vertx.eventBus(). consumer(GETINVENTORY_SERVICE_ID).handler(message -> { try { + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "getInventory"; service.getInventory().subscribe( result -> { message.reply(new JsonObject(Json.encode(result)).encodePrettily()); @@ -73,7 +82,14 @@ public void start() throws Exception { //Consumer for getOrderById vertx.eventBus(). consumer(GETORDERBYID_SERVICE_ID).handler(message -> { try { - Long orderId = Json.mapper.readValue(message.body().getString("orderId"), Long.class); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "getOrderById"; + String orderIdParam = message.body().getString("orderId"); + if(orderIdParam == null) { + manageError(message, new MainApiException(400, "orderId is required"), serviceId); + return; + } + Long orderId = Json.mapper.readValue(orderIdParam, Long.class); service.getOrderById(orderId).subscribe( result -> { message.reply(new JsonObject(Json.encode(result)).encodePrettily()); @@ -90,7 +106,14 @@ public void start() throws Exception { //Consumer for placeOrder vertx.eventBus(). consumer(PLACEORDER_SERVICE_ID).handler(message -> { try { - Order body = Json.mapper.readValue(message.body().getJsonObject("body").encode(), Order.class); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "placeOrder"; + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); + return; + } + Order body = Json.mapper.readValue(bodyParam.encode(), Order.class); service.placeOrder(body).subscribe( result -> { message.reply(new JsonObject(Json.encode(result)).encodePrettily()); diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java b/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java index a6d8f69da06..fb175bd559a 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java @@ -44,7 +44,14 @@ public void start() throws Exception { //Consumer for createUser vertx.eventBus(). consumer(CREATEUSER_SERVICE_ID).handler(message -> { try { - User body = Json.mapper.readValue(message.body().getJsonObject("body").encode(), User.class); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "createUser"; + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); + return; + } + User body = Json.mapper.readValue(bodyParam.encode(), User.class); service.createUser(body).subscribe( () -> { message.reply(null); @@ -61,8 +68,15 @@ public void start() throws Exception { //Consumer for createUsersWithArrayInput vertx.eventBus(). consumer(CREATEUSERSWITHARRAYINPUT_SERVICE_ID).handler(message -> { try { - List body = Json.mapper.readValue(message.body().getJsonArray("body").encode(), - Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class)); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "createUsersWithArrayInput"; + JsonArray bodyParam = message.body().getJsonArray("body"); + if(bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); + return; + } + List body = Json.mapper.readValue(bodyParam.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class)); service.createUsersWithArrayInput(body).subscribe( () -> { message.reply(null); @@ -79,8 +93,15 @@ public void start() throws Exception { //Consumer for createUsersWithListInput vertx.eventBus(). consumer(CREATEUSERSWITHLISTINPUT_SERVICE_ID).handler(message -> { try { - List body = Json.mapper.readValue(message.body().getJsonArray("body").encode(), - Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class)); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "createUsersWithListInput"; + JsonArray bodyParam = message.body().getJsonArray("body"); + if(bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); + return; + } + List body = Json.mapper.readValue(bodyParam.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class)); service.createUsersWithListInput(body).subscribe( () -> { message.reply(null); @@ -97,7 +118,14 @@ public void start() throws Exception { //Consumer for deleteUser vertx.eventBus(). consumer(DELETEUSER_SERVICE_ID).handler(message -> { try { - String username = message.body().getString("username"); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "deleteUser"; + String usernameParam = message.body().getString("username"); + if(usernameParam == null) { + manageError(message, new MainApiException(400, "username is required"), serviceId); + return; + } + String username = usernameParam; service.deleteUser(username).subscribe( () -> { message.reply(null); @@ -114,7 +142,14 @@ public void start() throws Exception { //Consumer for getUserByName vertx.eventBus(). consumer(GETUSERBYNAME_SERVICE_ID).handler(message -> { try { - String username = message.body().getString("username"); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "getUserByName"; + String usernameParam = message.body().getString("username"); + if(usernameParam == null) { + manageError(message, new MainApiException(400, "username is required"), serviceId); + return; + } + String username = usernameParam; service.getUserByName(username).subscribe( result -> { message.reply(new JsonObject(Json.encode(result)).encodePrettily()); @@ -131,8 +166,20 @@ public void start() throws Exception { //Consumer for loginUser vertx.eventBus(). consumer(LOGINUSER_SERVICE_ID).handler(message -> { try { - String username = message.body().getString("username"); - String password = message.body().getString("password"); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "loginUser"; + String usernameParam = message.body().getString("username"); + if(usernameParam == null) { + manageError(message, new MainApiException(400, "username is required"), serviceId); + return; + } + String username = usernameParam; + String passwordParam = message.body().getString("password"); + if(passwordParam == null) { + manageError(message, new MainApiException(400, "password is required"), serviceId); + return; + } + String password = passwordParam; service.loginUser(username, password).subscribe( result -> { message.reply(new JsonObject(Json.encode(result)).encodePrettily()); @@ -149,6 +196,8 @@ public void start() throws Exception { //Consumer for logoutUser vertx.eventBus(). consumer(LOGOUTUSER_SERVICE_ID).handler(message -> { try { + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "logoutUser"; service.logoutUser().subscribe( () -> { message.reply(null); @@ -165,8 +214,20 @@ public void start() throws Exception { //Consumer for updateUser vertx.eventBus(). consumer(UPDATEUSER_SERVICE_ID).handler(message -> { try { - String username = message.body().getString("username"); - User body = Json.mapper.readValue(message.body().getJsonObject("body").encode(), User.class); + // Workaround for #allParams section clearing the vendorExtensions map + String serviceId = "updateUser"; + String usernameParam = message.body().getString("username"); + if(usernameParam == null) { + manageError(message, new MainApiException(400, "username is required"), serviceId); + return; + } + String username = usernameParam; + JsonObject bodyParam = message.body().getJsonObject("body"); + if (bodyParam == null) { + manageError(message, new MainApiException(400, "body is required"), serviceId); + return; + } + User body = Json.mapper.readValue(bodyParam.encode(), User.class); service.updateUser(username, body).subscribe( () -> { message.reply(null); From 6db63c7a1f03ee954dbc1bfcefee1c29b1b2c655 Mon Sep 17 00:00:00 2001 From: magnolia Date: Sat, 20 Jan 2018 15:31:43 +0900 Subject: [PATCH 65/65] deleted unnecessary notes (#7454) https://github.com/swagger-api/swagger-codegen/issues/7398 --- .../src/main/resources/scalatra/licenseInfo.mustache | 1 - samples/server/petstore/scalatra/src/main/scala/JettyMain.scala | 1 - .../petstore/scalatra/src/main/scala/ScalatraBootstrap.scala | 1 - samples/server/petstore/scalatra/src/main/scala/ServletApp.scala | 1 - .../scalatra/src/main/scala/io/swagger/server/api/PetApi.scala | 1 - .../scalatra/src/main/scala/io/swagger/server/api/StoreApi.scala | 1 - .../scalatra/src/main/scala/io/swagger/server/api/UserApi.scala | 1 - .../src/main/scala/io/swagger/server/model/ApiResponse.scala | 1 - .../src/main/scala/io/swagger/server/model/Category.scala | 1 - .../scalatra/src/main/scala/io/swagger/server/model/Order.scala | 1 - .../scalatra/src/main/scala/io/swagger/server/model/Pet.scala | 1 - .../scalatra/src/main/scala/io/swagger/server/model/Tag.scala | 1 - .../scalatra/src/main/scala/io/swagger/server/model/User.scala | 1 - 13 files changed, 13 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/scalatra/licenseInfo.mustache b/modules/swagger-codegen/src/main/resources/scalatra/licenseInfo.mustache index bbd8742e52a..adabafe0728 100644 --- a/modules/swagger-codegen/src/main/resources/scalatra/licenseInfo.mustache +++ b/modules/swagger-codegen/src/main/resources/scalatra/licenseInfo.mustache @@ -7,5 +7,4 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. */ diff --git a/samples/server/petstore/scalatra/src/main/scala/JettyMain.scala b/samples/server/petstore/scalatra/src/main/scala/JettyMain.scala index 757a745ad10..3c7b68f90a6 100644 --- a/samples/server/petstore/scalatra/src/main/scala/JettyMain.scala +++ b/samples/server/petstore/scalatra/src/main/scala/JettyMain.scala @@ -7,7 +7,6 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. */ import org.eclipse.jetty.server._ diff --git a/samples/server/petstore/scalatra/src/main/scala/ScalatraBootstrap.scala b/samples/server/petstore/scalatra/src/main/scala/ScalatraBootstrap.scala index 7171a0e2a31..0fc9bf289b6 100644 --- a/samples/server/petstore/scalatra/src/main/scala/ScalatraBootstrap.scala +++ b/samples/server/petstore/scalatra/src/main/scala/ScalatraBootstrap.scala @@ -7,7 +7,6 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. */ diff --git a/samples/server/petstore/scalatra/src/main/scala/ServletApp.scala b/samples/server/petstore/scalatra/src/main/scala/ServletApp.scala index a48bb76a74e..47234828ab9 100644 --- a/samples/server/petstore/scalatra/src/main/scala/ServletApp.scala +++ b/samples/server/petstore/scalatra/src/main/scala/ServletApp.scala @@ -7,7 +7,6 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. */ diff --git a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/PetApi.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/PetApi.scala index 9b2f3da7185..482a00f5bfe 100644 --- a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/PetApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/PetApi.scala @@ -7,7 +7,6 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. */ diff --git a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/StoreApi.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/StoreApi.scala index e515a8ded49..eb6256bbaf3 100644 --- a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/StoreApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/StoreApi.scala @@ -7,7 +7,6 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. */ diff --git a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/UserApi.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/UserApi.scala index 31de254933e..3b34708598d 100644 --- a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/UserApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/api/UserApi.scala @@ -7,7 +7,6 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. */ diff --git a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/ApiResponse.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/ApiResponse.scala index f47a2cbf8e6..0e619dbef83 100644 --- a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/ApiResponse.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/ApiResponse.scala @@ -7,7 +7,6 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. */ package io.swagger.server.model diff --git a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Category.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Category.scala index 7d092fa7109..e70c9720c06 100644 --- a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Category.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Category.scala @@ -7,7 +7,6 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. */ package io.swagger.server.model diff --git a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Order.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Order.scala index 13eaeb08609..7a6b72afcbf 100644 --- a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Order.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Order.scala @@ -7,7 +7,6 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. */ package io.swagger.server.model diff --git a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Pet.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Pet.scala index 4a658da88fc..c433411df89 100644 --- a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Pet.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Pet.scala @@ -7,7 +7,6 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. */ package io.swagger.server.model diff --git a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Tag.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Tag.scala index f91b9ca4878..cc22d336a79 100644 --- a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Tag.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/Tag.scala @@ -7,7 +7,6 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. */ package io.swagger.server.model diff --git a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/User.scala b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/User.scala index 1065c5492b5..5989838c8dd 100644 --- a/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/User.scala +++ b/samples/server/petstore/scalatra/src/main/scala/io/swagger/server/model/User.scala @@ -7,7 +7,6 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. */ package io.swagger.server.model